diff options
author | Laszlo Agocs <laszlo.agocs@qt.io> | 2021-01-13 09:52:58 +0100 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2021-01-13 11:26:45 +0000 |
commit | 6f04dffb4ee8b49327a19b1f32246188ddc23267 (patch) | |
tree | 604bad984f779ff53fbd45380cb7135d3cb5dd8d | |
parent | f2eb8dfd709d9073b6b0499db6ac1a91704305c5 (diff) |
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 <andy.nichols@qt.io>
(cherry picked from commit a129c02e7b0d9977eafa66dc191ef185774f461e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r-- | src/quickshapes/qquickshapegenericrenderer.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
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) |