diff options
author | Xisco Fauli <xiscofauli@libreoffice.org> | 2024-03-15 11:15:08 +0100 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2024-03-15 14:54:45 +0100 |
commit | 485ae0bc7e1a1d615dd1d4133d3e42d655dec029 (patch) | |
tree | 7223567e7de7b073716bde8bcfce92374f669aee /svgio | |
parent | 8a0543f9fec90b0b7538fa5f219c9dc38b07ea34 (diff) |
tdf#48062: use mergeToSinglePolyPolygon instead of createPolygonFromRect
Otherwise, in files like
https://bug-attachments.documentfoundation.org/attachment.cgi?id=193126
where no rectangles are used the mask is displayed
as a rectangle
Change-Id: I8cafb22bd6055db729d0d56b4756119d7989abb2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164863
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'svgio')
-rw-r--r-- | svgio/source/svgreader/svgfecompositenode.cxx | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/svgio/source/svgreader/svgfecompositenode.cxx b/svgio/source/svgreader/svgfecompositenode.cxx index 1e20a0ef00f2..88ba5c62df68 100644 --- a/svgio/source/svgreader/svgfecompositenode.cxx +++ b/svgio/source/svgreader/svgfecompositenode.cxx @@ -22,6 +22,7 @@ #include <basegfx/polygon/b2dpolypolygoncutter.hxx> #include <basegfx/polygon/b2dpolypolygon.hxx> #include <drawinglayer/primitive2d/maskprimitive2d.hxx> +#include <drawinglayer/processor2d/contourextractor2d.hxx> namespace svgio::svgreader { @@ -102,20 +103,22 @@ void SvgFeCompositeNode::apply(drawinglayer::primitive2d::Primitive2DContainer& = pParent->findGraphicSource(maIn2)) { rTarget.append(*pSource2); - const basegfx::B2DRange aRange2( - pSource2->getB2DRange(drawinglayer::geometry::ViewInformation2D())); - - aPolyPolygon2 = basegfx::B2DPolyPolygon(basegfx::utils::createPolygonFromRect(aRange2)); + drawinglayer::processor2d::ContourExtractor2D aExtractor( + drawinglayer::geometry::ViewInformation2D(), true); + aExtractor.process(*pSource2); + const basegfx::B2DPolyPolygonVector& rResult(aExtractor.getExtractedContour()); + aPolyPolygon2 = basegfx::utils::mergeToSinglePolyPolygon(rResult); } if (const drawinglayer::primitive2d::Primitive2DContainer* pSource = pParent->findGraphicSource(maIn)) { rTarget.append(*pSource); - const basegfx::B2DRange aRange( - pSource->getB2DRange(drawinglayer::geometry::ViewInformation2D())); - - aPolyPolygon = basegfx::B2DPolyPolygon(basegfx::utils::createPolygonFromRect(aRange)); + drawinglayer::processor2d::ContourExtractor2D aExtractor( + drawinglayer::geometry::ViewInformation2D(), true); + aExtractor.process(*pSource); + const basegfx::B2DPolyPolygonVector& rResult(aExtractor.getExtractedContour()); + aPolyPolygon = basegfx::utils::mergeToSinglePolyPolygon(rResult); } basegfx::B2DPolyPolygon aResult; |