aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>2025-12-01 11:59:15 +0100
committerEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>2025-12-02 10:33:52 +0100
commitf28b61d428245c07978bb33fc021d905b93e6ba5 (patch)
treeec655f41ce20b608e727ba21b9669e6f2d2c057f /src
parentc45dd3e90b6f3da5ba9994a708da384ccf597dbd (diff)
VectorImage: Fix opacity on masked items
If the masked item has opacity != 1, we have to set this on the shader effect that applies the mask, not on the input item to the mask, same as transforms and animations. Change-Id: I87d937f51e7d1913f313968eb3cfee2855336de5 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/quickvectorimage/generator/qquickqmlgenerator.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/quickvectorimage/generator/qquickqmlgenerator.cpp b/src/quickvectorimage/generator/qquickqmlgenerator.cpp
index b9fd394a74..c80d1376ad 100644
--- a/src/quickvectorimage/generator/qquickqmlgenerator.cpp
+++ b/src/quickvectorimage/generator/qquickqmlgenerator.cpp
@@ -104,9 +104,6 @@ QString QQuickQmlGenerator::generateNodeBase(const NodeInfo &info)
stream() << "implicitHeight: originalBounds.height";
}
- if (!info.isDefaultOpacity)
- stream() << "opacity: " << info.opacity.defaultValue().toReal();
-
stream() << "transformOrigin: Item.TopLeft";
if (!info.maskId.isEmpty()) {
@@ -115,6 +112,9 @@ QString QQuickQmlGenerator::generateNodeBase(const NodeInfo &info)
stream() << "layer.textureSize: " << info.maskId << "_" << info.id << "_mask.textureSize";
stream() << "layer.sourceRect: " << info.maskId << ".maskRect(" << info.id << ")";
} else {
+ if (!info.isDefaultOpacity)
+ stream() << "opacity: " << info.opacity.defaultValue().toReal();
+
generateItemAnimations(idString, info);
}
@@ -343,6 +343,9 @@ void QQuickQmlGenerator::generateMaskUse(const NodeInfo &info)
stream() << "property bool isAlpha: " << (info.isMaskAlpha ? "true" : "false");
stream() << "property bool isInverted: " << (info.isMaskInverted ? "true" : "false");
+ if (!info.isDefaultOpacity)
+ stream() << "opacity: " << info.opacity.defaultValue().toReal();
+
generateItemAnimations(maskShaderId, info);
m_indentLevel--;