summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2012-06-11 20:19:32 +0200
committerMichael Stahl <mstahl@redhat.com>2012-06-11 20:33:45 +0200
commit0044bd800b742f28056805bb163ff243cf4095f3 (patch)
tree693466c88b37a02b3ae04687d66441073e456239
parent277b7fd3a483351368604ef2b71fb5ff44801e8b (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
-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 ) );