[Libreoffice-commits] .: Branch 'libreoffice-3-5' - drawinglayer/source

Miklos Vajna vmiklos at kemper.freedesktop.org
Tue Jun 12 00:40:49 PDT 2012


 drawinglayer/source/primitive2d/borderlineprimitive2d.cxx |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

New commits:
commit 9ee04b49642b90d36aa51d5611d0def8f7c0516e
Author: Michael Stahl <mstahl at redhat.com>
Date:   Mon Jun 11 20:19:32 2012 +0200

    fdo#38116, fdo#49438: fix double hairline border drawing some more:
    
    These two fixes interact in a bad way:
    49bd0e4e6bb0ed0671de72d84700ddcc49828f69 (fdo#48647)
    ee42895d684be9430a414adf3f569d279d437148 (fdo#49438)
    
    The problem is that now hairline borders are detected properly, and the
    double hairline borders are clipped to the right area, but the clipping
    polygon actually collapses to a single line for the hairline border,
    with the result that the clipped border line is an empty PolyPolygon
    for e.g. a double border 3 twips wide.
    
    Fix this by enforcing a minimum clipping polygon width of 2 units,
    which seems to work nicely.
    
    Change-Id: If9cf9f0ed6a5c837860c2313a84cd26b07734b03
    (cherry picked from commit 0044bd800b742f28056805bb163ff243cf4095f3)
    
    Signed-off-by: Miklos Vajna <vmiklos at suse.cz>

diff --git a/drawinglayer/source/primitive2d/borderlineprimitive2d.cxx b/drawinglayer/source/primitive2d/borderlineprimitive2d.cxx
index 4591330..66fcfaf 100644
--- a/drawinglayer/source/primitive2d/borderlineprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/borderlineprimitive2d.cxx
@@ -89,8 +89,11 @@ namespace drawinglayer
             const basegfx::B2DVector aPerpendicular(basegfx::getPerpendicular(aVector));
 
             // Get the points
-            const basegfx::B2DVector aLeftOff(aPerpendicular * (-0.5 * (getWidth(rViewInformation))));
-            const basegfx::B2DVector aRightOff(aPerpendicular * (0.5 * (getWidth(rViewInformation))));
+            const double fWidth(getWidth(rViewInformation));
+            const basegfx::B2DVector aLeftOff(
+                    aPerpendicular * (-0.5 * std::max(fWidth, 1.0)));
+            const basegfx::B2DVector aRightOff(
+                    aPerpendicular * (0.5 * std::max(fWidth, 1.0)));
 
             const basegfx::B2DVector aSLVector( aLeftOff - ( getExtendLeftStart() * aVector ) );
             clipPolygon.append( basegfx::B2DPoint( getStart() + aSLVector * 2.0 ) );


More information about the Libreoffice-commits mailing list