aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Olav Tvete <paul.tvete@qt.io>2023-10-03 13:45:30 +0200
committerPaul Olav Tvete <paul.tvete@qt.io>2023-10-03 12:10:25 +0000
commite559d5cf2b66c4a973f83f173d57676a21d287ef (patch)
tree26410978b7384fd6997ec2474d28ff280d83dce8
parentf69412e623d05376617b79bc11d61be5d90e8c68 (diff)
Curve renderer: quick fix for unsafe static_castv6.6.06.6.0
Use the correct type to avoid dependence on compiler-specific memory layout. Pick-to: 6.6 Change-Id: I5af56074d4710be444816011367bc8cbf965b2e2 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
-rw-r--r--src/quickshapes/qquickshapecurverenderer.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/quickshapes/qquickshapecurverenderer.cpp b/src/quickshapes/qquickshapecurverenderer.cpp
index 820c16fe6d..a950b71752 100644
--- a/src/quickshapes/qquickshapecurverenderer.cpp
+++ b/src/quickshapes/qquickshapecurverenderer.cpp
@@ -309,8 +309,13 @@ void QQuickShapeCurveRenderer::updateNode()
static_cast<QQuickShapeCurveNode *>(pathNode)->setColor(pathData.fillColor);
}
if (!(dirtyFlags & StrokeDirty)) {
- for (auto &strokeNode : std::as_const(pathData.strokeNodes))
- static_cast<QQuickShapeCurveNode *>(strokeNode)->setColor(pathData.pen.color());
+ if (useTriangulatingStroker) {
+ for (auto &strokeNode : std::as_const(pathData.strokeNodes))
+ static_cast<QQuickShapeCurveNode *>(strokeNode)->setColor(pathData.pen.color());
+ } else {
+ for (auto &strokeNode : std::as_const(pathData.strokeNodes))
+ static_cast<QQuickShapeStrokeNode *>(strokeNode)->setColor(pathData.pen.color());
+ }
}
}