From 6f04dffb4ee8b49327a19b1f32246188ddc23267 Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Wed, 13 Jan 2021 09:52:58 +0100 Subject: Regenerate Shape fill geometry when alpha changes to non-zero An alpha of 0 removes the scenegraph node for the fill. If the alpha changes to non-zero afterwards, the geometry needs to be regenerated. Fixes: QTBUG-85103 Change-Id: I180b9eb78bd98b99bc87c4d960108b95eb6ae723 Reviewed-by: Andy Nichols (cherry picked from commit a129c02e7b0d9977eafa66dc191ef185774f461e) Reviewed-by: Qt Cherry-pick Bot --- src/quickshapes/qquickshapegenericrenderer.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/quickshapes/qquickshapegenericrenderer.cpp b/src/quickshapes/qquickshapegenericrenderer.cpp index c1cadb82ef..f5fcd72152 100644 --- a/src/quickshapes/qquickshapegenericrenderer.cpp +++ b/src/quickshapes/qquickshapegenericrenderer.cpp @@ -161,8 +161,12 @@ void QQuickShapeGenericRenderer::setStrokeWidth(int index, qreal w) void QQuickShapeGenericRenderer::setFillColor(int index, const QColor &color) { ShapePathData &d(m_sp[index]); + const bool wasTransparent = d.fillColor.a == 0; d.fillColor = colorToColor4ub(color); + const bool isTransparent = d.fillColor.a == 0; d.syncDirty |= DirtyColor; + if (wasTransparent && !isTransparent) + d.syncDirty |= DirtyFillGeom; } void QQuickShapeGenericRenderer::setFillRule(int index, QQuickShapePath::FillRule fillRule) -- cgit v1.2.3