From 01104522ef890bb535994311e627ba1bbfff023c Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Mon, 20 Jan 2014 12:03:39 -0500 Subject: Ensure that the pixel line is at least 1 pixel wide. Without this, some dashed lines may not get drawn at all at some zoom levels. Change-Id: I273c1548325d14f56618df8ca4166aac58a3ff3f --- drawinglayer/source/processor2d/vclpixelprocessor2d.cxx | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'drawinglayer') diff --git a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx index ce226875adb4..439ce616977d 100644 --- a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx +++ b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx @@ -430,7 +430,12 @@ namespace drawinglayer if (fX + fBlockW > fX2) // Clip the right end in case it spills over the range. fBlockW = fX2 - fX + 1; - aTarget.append(makeRectPolygon(fX, fY1, fBlockW, aRange.getHeight())); + + double fH = aRange.getHeight(); + if (basegfx::fTools::equalZero(fH)) + fH = 1.0; + + aTarget.append(makeRectPolygon(fX, fY1, fBlockW, fH)); } bLine = !bLine; // line and blank alternate. @@ -497,7 +502,12 @@ namespace drawinglayer if (fY + fBlockH > fY2) // Clip the bottom end in case it spills over the range. fBlockH = fY2 - fY + 1; - aTarget.append(makeRectPolygon(fX1, fY, aRange.getWidth(), fBlockH)); + + double fW = aRange.getWidth(); + if (basegfx::fTools::equalZero(fW)) + fW = 1.0; + + aTarget.append(makeRectPolygon(fX1, fY, fW, fBlockH)); } bLine = !bLine; // line and blank alternate. -- cgit v1.2.3