diff options
author | Kohei Yoshida <kohei.yoshida@collabora.com> | 2014-01-20 12:03:39 -0500 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@collabora.com> | 2014-01-20 14:37:04 -0500 |
commit | 01104522ef890bb535994311e627ba1bbfff023c (patch) | |
tree | 170a81d05e99c511d4c733861cb69621d62fd566 /drawinglayer | |
parent | 41bee5b83102760a6da7eaca3b770e4c4e310d4d (diff) |
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
Diffstat (limited to 'drawinglayer')
-rw-r--r-- | drawinglayer/source/processor2d/vclpixelprocessor2d.cxx | 14 |
1 files changed, 12 insertions, 2 deletions
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. |