From e559d5cf2b66c4a973f83f173d57676a21d287ef Mon Sep 17 00:00:00 2001 From: Paul Olav Tvete Date: Tue, 3 Oct 2023 13:45:30 +0200 Subject: Curve renderer: quick fix for unsafe static_cast Use the correct type to avoid dependence on compiler-specific memory layout. Pick-to: 6.6 Change-Id: I5af56074d4710be444816011367bc8cbf965b2e2 Reviewed-by: Eskil Abrahamsen Blomfeldt --- src/quickshapes/qquickshapecurverenderer.cpp | 9 +++++++-- 1 file 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(pathNode)->setColor(pathData.fillColor); } if (!(dirtyFlags & StrokeDirty)) { - for (auto &strokeNode : std::as_const(pathData.strokeNodes)) - static_cast(strokeNode)->setColor(pathData.pen.color()); + if (useTriangulatingStroker) { + for (auto &strokeNode : std::as_const(pathData.strokeNodes)) + static_cast(strokeNode)->setColor(pathData.pen.color()); + } else { + for (auto &strokeNode : std::as_const(pathData.strokeNodes)) + static_cast(strokeNode)->setColor(pathData.pen.color()); + } } } -- cgit v1.2.3