tdf#101611, tdf#108813, tdf#86211, sdext,pdfimport: Clip fills

The pdf processor carefully records clip paths, but does very little
with them.  It's currently just used in the recently added
tiling pattern fill.

Make the existing solid fills use the clip path.

This resolves 101611, 108813, and helps some
side issues in tdf#155170 In particular, the fish bowl on p.15
now looks about correct, but the fishes are still very, erm, square.

(I think there may be a longer term task to rework the clipping
completely)

Change-Id: Ie48901dbc6070465bac4fdb47b0bbc65a35c5792
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172448
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
Dr. David Alan Gilbert
2024-08-29 14:29:47 +02:00
committed by Noel Grandin
parent db92117fae
commit b416c5b8e3
@@ -463,6 +463,13 @@ void PDFIProcessor::fillPath( const uno::Reference< rendering::XPolyPolygon2D >&
basegfx::B2DPolyPolygon aPoly=basegfx::unotools::b2DPolyPolygonFromXPolyPolygon2D(rPath);
aPoly.transform(getCurrentContext().Transformation);
basegfx::B2DPolyPolygon aCurClip = getCurrentContext().Clip;
if( aCurClip.count() ) {
aPoly = basegfx::utils::clipPolyPolygonOnPolyPolygon( aPoly, aCurClip,
true, /* bInside, keep parts inside the clip */
false /* bStroke, filled not stroked */ );
}
PolyPolyElement* pPoly = ElementFactory::createPolyPolyElement(
m_pCurElement,
getGCId(getCurrentContext()),
@@ -478,6 +485,13 @@ void PDFIProcessor::eoFillPath( const uno::Reference< rendering::XPolyPolygon2D
basegfx::B2DPolyPolygon aPoly=basegfx::unotools::b2DPolyPolygonFromXPolyPolygon2D(rPath);
aPoly.transform(getCurrentContext().Transformation);
basegfx::B2DPolyPolygon aCurClip = getCurrentContext().Clip;
if( aCurClip.count() ) {
aPoly = basegfx::utils::clipPolyPolygonOnPolyPolygon( aPoly, aCurClip,
true, /* bInside, keep parts inside the clip */
false /* bStroke, filled not stroked */ );
}
PolyPolyElement* pPoly = ElementFactory::createPolyPolyElement(
m_pCurElement,
getGCId(getCurrentContext()),