diff options
Diffstat (limited to 'basegfx/source/polygon/b2dtrapezoid.cxx')
-rw-r--r-- | basegfx/source/polygon/b2dtrapezoid.cxx | 40 |
1 files changed, 19 insertions, 21 deletions
diff --git a/basegfx/source/polygon/b2dtrapezoid.cxx b/basegfx/source/polygon/b2dtrapezoid.cxx index 0bfb8fb5705f..b7991dbf55d4 100644 --- a/basegfx/source/polygon/b2dtrapezoid.cxx +++ b/basegfx/source/polygon/b2dtrapezoid.cxx @@ -395,28 +395,26 @@ namespace basegfx::trapezoidhelper aEdgeB.getStart(), aDeltaB, CutFlagValue::LINE, &fCutA, - &fCutB) != CutFlagValue::NONE) - { - // use a simple metric (length criteria) for choosing the numerically - // better cut - const double fSimpleLengthA(aDeltaA.getX() + aDeltaA.getY()); - const double fSimpleLengthB(aDeltaB.getX() + aDeltaB.getY()); - const bool bAIsLonger(fSimpleLengthA > fSimpleLengthB); - B2DPoint* pNewPoint = bAIsLonger - ? maNewPoints.allocatePoint(aEdgeA.getStart() + (fCutA * aDeltaA)) - : maNewPoints.allocatePoint(aEdgeB.getStart() + (fCutB * aDeltaB)); - - // try to split both edges - bool bRetval = splitEdgeAtGivenPoint(aEdgeA, *pNewPoint, aCurrent); - bRetval |= splitEdgeAtGivenPoint(aEdgeB, *pNewPoint, aCurrent); - - if(!bRetval) - maNewPoints.freeIfLast(pNewPoint); - - return bRetval; - } + &fCutB) == CutFlagValue::NONE) + return false; + + // use a simple metric (length criteria) for choosing the numerically + // better cut + const double fSimpleLengthA(aDeltaA.getX() + aDeltaA.getY()); + const double fSimpleLengthB(aDeltaB.getX() + aDeltaB.getY()); + const bool bAIsLonger(fSimpleLengthA > fSimpleLengthB); + B2DPoint* pNewPoint = bAIsLonger + ? maNewPoints.allocatePoint(aEdgeA.getStart() + (fCutA * aDeltaA)) + : maNewPoints.allocatePoint(aEdgeB.getStart() + (fCutB * aDeltaB)); + + // try to split both edges + bool bRetval = splitEdgeAtGivenPoint(aEdgeA, *pNewPoint, aCurrent); + bRetval |= splitEdgeAtGivenPoint(aEdgeB, *pNewPoint, aCurrent); + + if(!bRetval) + maNewPoints.freeIfLast(pNewPoint); - return false; + return bRetval; } void solveHorizontalEdges(TrDeSimpleEdges& rTrDeSimpleEdges) |