From 569fe21e7ff55d72bdd4a87ff10640da5a4ef174 Mon Sep 17 00:00:00 2001 From: jules Date: Mon, 28 Oct 2013 13:59:09 +0000 Subject: [PATCH] Minor tidying. --- .../geometry/juce_PathIterator.cpp | 60 +++++++++---------- 1 file changed, 29 insertions(+), 31 deletions(-) diff --git a/modules/juce_graphics/geometry/juce_PathIterator.cpp b/modules/juce_graphics/geometry/juce_PathIterator.cpp index 9658264564..0a15581ceb 100644 --- a/modules/juce_graphics/geometry/juce_PathIterator.cpp +++ b/modules/juce_graphics/geometry/juce_PathIterator.cpp @@ -69,48 +69,45 @@ bool PathFlatteningIterator::next() float y3 = 0; float x4 = 0; float y4 = 0; - float type; for (;;) { + float type; + if (stackPos == stackBase) { if (index >= path.numElements) - { return false; - } - else + + type = points [index++]; + + if (type != Path::closeSubPathMarker) { - type = points [index++]; + x2 = points [index++]; + y2 = points [index++]; - if (type != Path::closeSubPathMarker) + if (type == Path::quadMarker) { - x2 = points [index++]; - y2 = points [index++]; + x3 = points [index++]; + y3 = points [index++]; - if (type == Path::quadMarker) - { - x3 = points [index++]; - y3 = points [index++]; + if (! isIdentityTransform) + transform.transformPoints (x2, y2, x3, y3); + } + else if (type == Path::cubicMarker) + { + x3 = points [index++]; + y3 = points [index++]; + x4 = points [index++]; + y4 = points [index++]; - if (! isIdentityTransform) - transform.transformPoints (x2, y2, x3, y3); - } - else if (type == Path::cubicMarker) - { - x3 = points [index++]; - y3 = points [index++]; - x4 = points [index++]; - y4 = points [index++]; - - if (! isIdentityTransform) - transform.transformPoints (x2, y2, x3, y3, x4, y4); - } - else - { - if (! isIdentityTransform) - transform.transformPoint (x2, y2); - } + if (! isIdentityTransform) + transform.transformPoints (x2, y2, x3, y3, x4, y4); + } + else + { + if (! isIdentityTransform) + transform.transformPoint (x2, y2); } } } @@ -150,7 +147,8 @@ bool PathFlatteningIterator::next() return true; } - else if (type == Path::quadMarker) + + if (type == Path::quadMarker) { const size_t offset = (size_t) (stackPos - stackBase);