From 5a6887ae8536c0b751e7b870ab629ecbf8784d22 Mon Sep 17 00:00:00 2001 From: Berthold Krevert Date: Thu, 3 Aug 2017 22:51:30 +0200 Subject: Normalize dashOffset behavior between renderer backends Software and tessellation backends assume that dashOffset is defined in units of strokeWidth. That means the nvpr backend has to scale the dashOffset by the strokeWidth to keep behavior in sync. Change-Id: Ie1735f8dcdc6ac89fc4425b29166f88ad2638a92 Reviewed-by: Laszlo Agocs --- src/imports/shapes/qquickshapenvprrenderer.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/imports/shapes/qquickshapenvprrenderer.cpp b/src/imports/shapes/qquickshapenvprrenderer.cpp index 4f49bb5256..a859ca45b6 100644 --- a/src/imports/shapes/qquickshapenvprrenderer.cpp +++ b/src/imports/shapes/qquickshapenvprrenderer.cpp @@ -370,11 +370,11 @@ void QQuickShapeNvprRenderer::updateNode() } if (dirty & DirtyDash) { - dst.dashOffset = src.dashOffset; + // Multiply by strokeWidth because the Shape API follows QPen + // meaning the input dash pattern and dash offset here are in width units. + dst.dashOffset = src.dashOffset * src.strokeWidth; if (src.dashActive) { dst.dashPattern.resize(src.dashPattern.count()); - // Multiply by strokeWidth because the Shape API follows QPen - // meaning the input dash pattern here is in width units. for (int i = 0; i < src.dashPattern.count(); ++i) dst.dashPattern[i] = GLfloat(src.dashPattern[i]) * src.strokeWidth; } else { -- cgit v1.2.3