aboutsummaryrefslogtreecommitdiffstats
path: root/src/quickshapes/qquickshapegenericrenderer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/quickshapes/qquickshapegenericrenderer.cpp')
-rw-r--r--src/quickshapes/qquickshapegenericrenderer.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/quickshapes/qquickshapegenericrenderer.cpp b/src/quickshapes/qquickshapegenericrenderer.cpp
index e9bc715952..98170be6d9 100644
--- a/src/quickshapes/qquickshapegenericrenderer.cpp
+++ b/src/quickshapes/qquickshapegenericrenderer.cpp
@@ -188,8 +188,12 @@ void QQuickShapeGenericRenderer::setPath(int index, const QQuickPath *path)
void QQuickShapeGenericRenderer::setStrokeColor(int index, const QColor &color)
{
ShapePathData &d(m_sp[index]);
+ const bool wasTransparent = d.strokeColor.a == 0;
d.strokeColor = colorToColor4ub(color);
+ const bool isTransparent = d.strokeColor.a == 0;
d.syncDirty |= DirtyColor;
+ if (wasTransparent && !isTransparent)
+ d.syncDirty |= DirtyStrokeGeom;
}
void QQuickShapeGenericRenderer::setStrokeWidth(int index, qreal w)
@@ -204,8 +208,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)
@@ -1276,3 +1284,5 @@ QSGMaterialShader *QQuickShapeConicalGradientMaterial::createShader() const
}
QT_END_NAMESPACE
+
+#include "moc_qquickshapegenericrenderer_p.cpp"