basegfx/source/polygon/b2dpolygonclipper.cxx | 43 +++++---------------------- 1 file changed, 8 insertions(+), 35 deletions(-)
New commits: commit e11e73ff02051ce9744ae302827abcaf6b5e16ed Author: Caolán McNamara <[email protected]> Date: Tue Jul 19 14:02:13 2016 +0100 simplify code now Change-Id: Ic9fed523c9077f3e9efa2af00ac5f9e9071a0dc9 diff --git a/basegfx/source/polygon/b2dpolygonclipper.cxx b/basegfx/source/polygon/b2dpolygonclipper.cxx index 360263a..f0e8ede 100644 --- a/basegfx/source/polygon/b2dpolygonclipper.cxx +++ b/basegfx/source/polygon/b2dpolygonclipper.cxx @@ -414,35 +414,10 @@ namespace basegfx // check for simplification with ranges if !bStroke (handling as stroke is more simple), // but also only when bInside, else the simplification may lead to recursive calls (see // calls to clipPolyPolygonOnPolyPolygon in clipPolyPolygonOnRange and clipPolygonOnRange) - if(bInside) + if (bInside && basegfx::tools::isRectangle(rClip)) { // #i125349# detect if both given PolyPolygons are indeed ranges - bool bBothRectangle(false); - - if(basegfx::tools::isRectangle(rCandidate)) - { - if(basegfx::tools::isRectangle(rClip)) - { - // both are ranges - bBothRectangle = true; - } - } - else if(basegfx::tools::isRectangle(rClip)) - { - if(basegfx::tools::isRectangle(rCandidate)) - { - // both are ranges - bBothRectangle = true; - } - else - { - // rClip is rectangle -> clip rCandidate on rRectangle, use the much - // cheaper and numerically more stable clipping against a range - return clipPolyPolygonOnRange(rCandidate, rClip.getB2DRange(), bInside, bStroke); - } - } - - if(bBothRectangle) + if (basegfx::tools::isRectangle(rCandidate)) { // both are rectangle if(rCandidate.getB2DRange().equal(rClip.getB2DRange())) @@ -472,6 +447,12 @@ namespace basegfx } } } + else + { + // rClip is rectangle -> clip rCandidate on rRectangle, use the much + // cheaper and numerically more stable clipping against a range + return clipPolyPolygonOnRange(rCandidate, rClip.getB2DRange(), bInside, bStroke); + } } // area clipping commit d074b2728afa0b902c75ca0ebaae209454e6d922 Author: Caolán McNamara <[email protected]> Date: Tue Jul 19 14:01:02 2016 +0100 Resolves: tdf#100909 artifacts in hole of polypolygon shape regression from... commit 1ca06ce59b7d3cea873d2dc109a2acaec0a80759 Date: Tue Aug 5 16:11:21 2014 +0000 Related: #i125349# moved clip enhancements to base clipping functionality The "reversed" clipPolyPolygonOnRange path is the problem apparently. The case in #i125349# uses the other clipPolyPolygonOnRange path. So for simplicity just remove the branch that's causing trouble here. Change-Id: Ia4c60ebc44a8c239c1a7d5c84e9b970c2885ff05 diff --git a/basegfx/source/polygon/b2dpolygonclipper.cxx b/basegfx/source/polygon/b2dpolygonclipper.cxx index 7b49169..360263a 100644 --- a/basegfx/source/polygon/b2dpolygonclipper.cxx +++ b/basegfx/source/polygon/b2dpolygonclipper.cxx @@ -426,14 +426,6 @@ namespace basegfx // both are ranges bBothRectangle = true; } - else - { - // rCandidate is rectangle -> clip rClip on rRectangle, use the much - // cheaper and numerically more stable clipping against a range - // This simplification (exchanging content and clip) is valid - // since we do a logical AND operation - return clipPolyPolygonOnRange(rClip, rCandidate.getB2DRange(), bInside, bStroke); - } } else if(basegfx::tools::isRectangle(rClip)) {
_______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
