diff options
author | Michael Stahl <mstahl@redhat.com> | 2012-04-18 22:15:19 +0200 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2012-04-20 13:23:06 +0100 |
commit | 339a502e1f78388512cc8b9ba2117b674c770efc (patch) | |
tree | 7c8a579b3e6bb27221fad75c80e3bbfdd02ccd30 | |
parent | 488b766836ef41c51670175fc2eeff7c9640e86c (diff) |
fdo#48647: drawinglayer: fix double hairline borders:
Clipping the border polygon to the region defined by the Extends is
sufficient to create a nice looking 1 twip double border in Writer.
(regression from 0f0896c26fb260d1bbf31d7a886df3f61837f0f2)
(cherry picked from commit 49bd0e4e6bb0ed0671de72d84700ddcc49828f69)
Signed-off-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | drawinglayer/source/primitive2d/borderlineprimitive2d.cxx | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/drawinglayer/source/primitive2d/borderlineprimitive2d.cxx b/drawinglayer/source/primitive2d/borderlineprimitive2d.cxx index 1834d361d637..86f58d653c49 100644 --- a/drawinglayer/source/primitive2d/borderlineprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/borderlineprimitive2d.cxx @@ -114,9 +114,14 @@ namespace drawinglayer aLeft.append(aTmpStart); aLeft.append(aTmpEnd); - xRetval[nInsert++] = Primitive2DReference(new PolygonHairlinePrimitive2D( - aLeft, - getRGBColorLeft())); + basegfx::B2DPolyPolygon const aClipped = + basegfx::tools::clipPolygonOnPolyPolygon( + aLeft, aClipRegion, true, true); + + xRetval[nInsert++] = + new PolyPolygonHairlinePrimitive2D( + aClipped, + getRGBColorLeft()); aGap.append( getStart() - getExtendLeftStart() * aVector ); aGap.append( getEnd() + getExtendLeftEnd() * aVector ); @@ -159,9 +164,14 @@ namespace drawinglayer aRight.append(aTmpStart); aRight.append(aTmpEnd); - xRetval[nInsert++] = Primitive2DReference(new PolygonHairlinePrimitive2D( - aRight, - getRGBColorRight())); + basegfx::B2DPolyPolygon const aClipped = + basegfx::tools::clipPolygonOnPolyPolygon( + aRight, aClipRegion, true, true); + + xRetval[nInsert++] = + new PolyPolygonHairlinePrimitive2D( + aClipped, + getRGBColorRight()); aGap.append( getStart() - getExtendRightStart() * aVector ); aGap.append( getEnd() + getExtendRightEnd() * aVector ); |