Effect Maker: Change blur helper to match helper on qtquickdesigner

When running effect in project, source property for effect doesn't
seem to have actual dimensions, so use the root item dimensions.

Task-number: QDS-11542
Change-Id: Ibc4053224de8882dead338f1833bf65397f5eac3
Reviewed-by: Qt CI Patch Build Bot <ci_patchbuild_bot@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
Miikka Heikkinen
2023-12-15 13:21:05 +02:00
parent 2d166d0839
commit 6bf7ae11a0

View File

@@ -25,7 +25,6 @@ Item {
QtObject {
id: priv
property bool useBlurItem1: true
property bool useBlurItem2: rootItem.blurMax > 2
property bool useBlurItem3: rootItem.blurMax > 8
property bool useBlurItem4: rootItem.blurMax > 16
@@ -34,12 +33,12 @@ Item {
BlurItem {
id: blurredItemSource1
property Item src: priv.useBlurItem1 ? source : null
property Item src: source
// Size of the first blurred item is by default half of the source.
// Increase for quality and decrease for performance & more blur.
readonly property int blurItemSize: 8
width: src ? Math.ceil(src.width / 16) * blurItemSize : 0
height: src ? Math.ceil(src.height / 16) * blurItemSize : 0
width: Math.ceil(rootItem.width / 16) * blurItemSize
height: Math.ceil(rootItem.height / 16) * blurItemSize
}
BlurItem {
id: blurredItemSource2