diff options
author | Laszlo Agocs <laszlo.agocs@qt.io> | 2021-01-13 09:52:58 +0100 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@qt.io> | 2021-01-13 11:02:24 +0100 |
commit | a129c02e7b0d9977eafa66dc191ef185774f461e (patch) | |
tree | 1174674adcf182666155c73710d975229dcff900 /src/quickshapes | |
parent | 8f2502abe2901d97719bc8f9d4bfe4002451d4c0 (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.
Pick-to: 6.0 5.15
Fixes: QTBUG-85103
Change-Id: I180b9eb78bd98b99bc87c4d960108b95eb6ae723
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
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 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) |