diff options
author | Berthold Krevert <berthold.krevert@basyskom.com> | 2017-08-03 22:51:30 +0200 |
---|---|---|
committer | Berthold Krevert <berthold.krevert@basyskom.com> | 2017-08-05 11:23:32 +0000 |
commit | 5a6887ae8536c0b751e7b870ab629ecbf8784d22 (patch) | |
tree | 528bacba3773455e9f8476037a4b1a742901dfea /src/imports/shapes/qquickshapenvprrenderer.cpp | |
parent | 2b7a9aa1c78483f13576685f4e130c58258da94d (diff) |
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 <laszlo.agocs@qt.io>
Diffstat (limited to 'src/imports/shapes/qquickshapenvprrenderer.cpp')
-rw-r--r-- | src/imports/shapes/qquickshapenvprrenderer.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
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 { |