summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sw/source/core/doc/notxtfrm.cxx29
1 files changed, 27 insertions, 2 deletions
diff --git a/sw/source/core/doc/notxtfrm.cxx b/sw/source/core/doc/notxtfrm.cxx
index 6dd910fab9ee..6055384ac8a7 100644
--- a/sw/source/core/doc/notxtfrm.cxx
+++ b/sw/source/core/doc/notxtfrm.cxx
@@ -988,9 +988,34 @@ void paintGraphicUsingPrimitivesHelper(
ceil(aClipRange.getMaxX() + aSinglePixelXY.getX()),
ceil(aClipRange.getMaxY() + aSinglePixelXY.getY()));
+ // create the enclosing rectangle as polygon
+ basegfx::B2DPolyPolygon aTarget(basegfx::utils::createPolygonFromRect(aExpandedClipRange));
+
+ // tdf#124272 the fix above (tdf#114076) was too rough - the
+ // clip region used may be a PolyPolygon. In that case that
+ // PolyPolygon would have to be scaled to mentioned PixelBounds.
+ // Since that is not really possible geometrically (would need
+ // more some 'grow in outside direction' but with unequal grow
+ // values in all directions - just maaany problems
+ // involved), use a graphical trick: The topology of the
+ // PolyPolygon uses the stndard FillRule, so adding the now
+ // guaranteed to be bigger or equal bounding (enclosing)
+ // rectangle twice as polygon will expand the BoundRange, but
+ // not change the geometry visualization at all
+ if(!rOutputDevice.GetClipRegion().IsRectangle())
+ {
+ // double the outer rectangle range polygon to have it
+ // included twice
+ aTarget.append(aTarget.getB2DPolygon(0));
+
+ // add the original clip 'inside' (due to being smaller
+ // or equal). That PolyPolygon may have an unknown number
+ // of polygons (>=1)
+ aTarget.append(aClip);
+ }
+
aContent[0] = new drawinglayer::primitive2d::MaskPrimitive2D(
- basegfx::B2DPolyPolygon(
- basegfx::utils::createPolygonFromRect(aExpandedClipRange)),
+ aTarget,
aContent);
}
}