mirror of https://github.com/KDE/kasts.git
Fix image masking and smoothing
Image masking with MultiEffect was not applying antialiasing at the edges with the default settings. The mipmap setting was ignored if the image source was changed (e.g. on HeaderBar). Added a hack to reset this AFTER the image has changed.
This commit is contained in:
parent
eb74c913a9
commit
ae3cdc207a
|
@ -166,7 +166,7 @@ Controls.ItemDelegate {
|
|||
imageSource: feed.cachedImage
|
||||
imageTitle: feed.name
|
||||
isLoading: feed.refreshing
|
||||
absoluteRadius: Kirigami.Units.smallSpacing + borderWidth
|
||||
absoluteRadius: Kirigami.Units.smallSpacing - borderWidth
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
|
|
|
@ -26,6 +26,14 @@ Item {
|
|||
property bool imageResize: true
|
||||
property bool mipmap: false
|
||||
|
||||
// HACK: if mipmap has been set to true, then reset it AFTER image has
|
||||
// changed, otherwise it will be ignored
|
||||
onImageSourceChanged: {
|
||||
if (root.mipmap) {
|
||||
root.mipmap = true;
|
||||
}
|
||||
}
|
||||
|
||||
Loader {
|
||||
id: imageLoader
|
||||
anchors.fill: parent
|
||||
|
@ -38,6 +46,8 @@ Item {
|
|||
source: imageLoader.item
|
||||
opacity: root.imageOpacity
|
||||
maskEnabled: true
|
||||
maskThresholdMin: 0.5
|
||||
maskSpreadAtMin: 0.5
|
||||
maskSource: ShaderEffectSource {
|
||||
width: imageLoader.width
|
||||
height: imageLoader.height
|
||||
|
|
Loading…
Reference in New Issue