From 0044bd800b742f28056805bb163ff243cf4095f3 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Mon, 11 Jun 2012 20:19:32 +0200 Subject: 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 --- drawinglayer/source/primitive2d/borderlineprimitive2d.cxx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'drawinglayer') diff --git a/drawinglayer/source/primitive2d/borderlineprimitive2d.cxx b/drawinglayer/source/primitive2d/borderlineprimitive2d.cxx index 4591330655e4..66fcfaf17b9e 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 ) ); -- cgit v1.2.3