summaryrefslogtreecommitdiff
path: root/basegfx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2016-07-19 14:02:13 +0100
committerCaolán McNamara <caolanm@redhat.com>2016-07-19 14:26:51 +0100
commite11e73ff02051ce9744ae302827abcaf6b5e16ed (patch)
tree756d7fb02f65b77f4049e7eda38b6fc756047641 /basegfx
parentd074b2728afa0b902c75ca0ebaae209454e6d922 (diff)
simplify code now
Change-Id: Ic9fed523c9077f3e9efa2af00ac5f9e9071a0dc9
Diffstat (limited to 'basegfx')
-rw-r--r--basegfx/source/polygon/b2dpolygonclipper.cxx35
1 files changed, 8 insertions, 27 deletions
diff --git a/basegfx/source/polygon/b2dpolygonclipper.cxx b/basegfx/source/polygon/b2dpolygonclipper.cxx
index 360263a4f91b..f0e8ede6a27d 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