[Libreoffice-commits] core.git: Branch 'feature/calc-cell-borders' - drawinglayer/source

Kohei Yoshida kohei.yoshida at collabora.com
Mon Jan 20 09:03:55 PST 2014


 drawinglayer/source/processor2d/vclpixelprocessor2d.cxx |   14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

New commits:
commit 3b15f5324bc3dc6eeadee545d8a5884f670d811b
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Mon Jan 20 12:03:39 2014 -0500

    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

diff --git a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
index ce22687..439ce61 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.


More information about the Libreoffice-commits mailing list