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 14:45:09 +0000 |
commit | d307a27cd982b000355cbd0233262feff1759372 (patch) | |
tree | 63e0cebaf3e0e6b1d531bb52ec578e5d5adc0ab4 /src/quickshapes | |
parent | b058ed7ef22a55014ace934783b8ab2a9c33b723 (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>
Diffstat (limited to 'src/quickshapes')
-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 e9bc715952..289dee1081 100644 --- a/src/quickshapes/qquickshapegenericrenderer.cpp +++ b/src/quickshapes/qquickshapegenericrenderer.cpp @@ -204,8 +204,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) |