From a12f6ba302e54c1570c54aa4c722f2dafbf794af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Tue, 5 Mar 2013 15:43:50 +0100 Subject: Fixed dashes being rendered differently depending on system clip. We need to clip lines to the unclipped device rect in the case of dashing, since otherwise the dashes will be shifted and rendered differently when partial repaints are done. Task-number: QTBUG-24762 Change-Id: I3599b54baa552acc20bf8cc2e12f846b45f6019e Reviewed-by: Lars Knoll Reviewed-by: Gunnar Sletta --- src/gui/painting/qcosmeticstroker.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/gui/painting/qcosmeticstroker.cpp') diff --git a/src/gui/painting/qcosmeticstroker.cpp b/src/gui/painting/qcosmeticstroker.cpp index 1ba55aa7f1..1de955bc13 100644 --- a/src/gui/painting/qcosmeticstroker.cpp +++ b/src/gui/painting/qcosmeticstroker.cpp @@ -290,11 +290,14 @@ void QCosmeticStroker::setup() ppl = buffer->bytesPerLine()>>2; } + // dashes are sensitive to clips, so we need to clip consistently when painting to the same device + QRect clipRect = strokeSelection & Dashed ? deviceRect : clip; + // setup FP clip bounds - xmin = clip.left() - 1; - xmax = clip.right() + 2; - ymin = clip.top() - 1; - ymax = clip.bottom() + 2; + xmin = clipRect.left() - 1; + xmax = clipRect.right() + 2; + ymin = clipRect.top() - 1; + ymax = clipRect.bottom() + 2; lastPixel.x = -1; } -- cgit v1.2.3