summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2012-06-11 20:19:32 +0200
committerMiklos Vajna <vmiklos@suse.cz>2012-06-12 09:41:58 +0200
commit9ee04b49642b90d36aa51d5611d0def8f7c0516e (patch)
treef2703af82d555c18851051ec34e52b124fbad3db
parent0b8e6b2ba733719fc09dfe379b0d6b738723cdee (diff)
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@suse.cz>
-rw-r--r--drawinglayer/source/primitive2d/borderlineprimitive2d.cxx7
1 files changed, 5 insertions, 2 deletions
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 ) );