summaryrefslogtreecommitdiff
path: root/drawinglayer
diff options
context:
space:
mode:
authorBalazs Varga <balazs.varga.extern@allotropia.de>2025-01-15 09:53:15 +0100
committerBalazs Varga <balazs.varga.extern@allotropia.de>2025-01-20 14:47:05 +0100
commit0e01a536d8173270d6a4545a861c2b0b1ba4db17 (patch)
tree89e62a7ddafa0e96ea9fd5cbf7624630a440b028 /drawinglayer
parent1552102dd32cfa76a8b5b5c083be8921871941af (diff)
tdf#164622 - SVG: fix broken cropped svg files at metafile export
For creating metafile, there mask polygon from MaskPrimitive2D needs to be closed. Otherwise later during the metafile export the we will skipp the rendering of the last points of the polylines. SVG clipping paths: "A clipping path is a set of closed vector path that may consist of an arbitrary number of straight and curved segments." Change-Id: I21487a81b904ec7ec5c6bd2a89b7539aeb86d606 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180278 Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com> Tested-by: Jenkins
Diffstat (limited to 'drawinglayer')
-rw-r--r--drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx6
1 files changed, 6 insertions, 0 deletions
diff --git a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
index 2658ed6410de..b39341f72612 100644
--- a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
@@ -2247,6 +2247,12 @@ void VclMetafileProcessor2D::processMaskPrimitive2D(
if (aMask.count())
{
+ // A clipping path is a set of closed vector path that may consist of an arbitrary number
+ // of straight and curved segments. The region(s) enclosed by the path define(s) the visible area,
+ // i.e. after applying a clipping path, only those portions of the subsequently drawn graphics that
+ // fall inside the enclosed area are visible, everything else is cut away.
+ if (!aMask.isClosed())
+ aMask.setClosed(true);
// prepare new mask polygon and rescue current one
aMask.transform(maCurrentTransformation);
const basegfx::B2DPolyPolygon aLastClipPolyPolygon(maClipPolyPolygon);