diff --git a/juce_amalgamated.cpp b/juce_amalgamated.cpp index f90b7ff8b9..c367713c82 100644 --- a/juce_amalgamated.cpp +++ b/juce_amalgamated.cpp @@ -85740,6 +85740,8 @@ bool PathFlatteningIterator::next() throw() } else { + jassert (type == Path::moveMarker); + subPathIndex = -1; subPathCloseX = x1 = x2; subPathCloseY = y1 = y2; diff --git a/juce_amalgamated.h b/juce_amalgamated.h index 35fb740344..201debdf61 100644 --- a/juce_amalgamated.h +++ b/juce_amalgamated.h @@ -39562,7 +39562,9 @@ public: int subPathIndex; /** Returns true if the current segment is the last in the current sub-path. */ - bool isLastInSubpath() const throw() { return stackPos == stackBase; } + bool isLastInSubpath() const throw() { return stackPos == stackBase + && (index >= path.numElements + || points [index] == Path::moveMarker); } juce_UseDebuggingNewOperator diff --git a/src/juce_appframework/gui/graphics/geometry/juce_PathIterator.cpp b/src/juce_appframework/gui/graphics/geometry/juce_PathIterator.cpp index 2d33435475..8fa95b7f64 100644 --- a/src/juce_appframework/gui/graphics/geometry/juce_PathIterator.cpp +++ b/src/juce_appframework/gui/graphics/geometry/juce_PathIterator.cpp @@ -286,6 +286,8 @@ bool PathFlatteningIterator::next() throw() } else { + jassert (type == Path::moveMarker); + subPathIndex = -1; subPathCloseX = x1 = x2; subPathCloseY = y1 = y2; diff --git a/src/juce_appframework/gui/graphics/geometry/juce_PathIterator.h b/src/juce_appframework/gui/graphics/geometry/juce_PathIterator.h index 798b756aa8..836708fe79 100644 --- a/src/juce_appframework/gui/graphics/geometry/juce_PathIterator.h +++ b/src/juce_appframework/gui/graphics/geometry/juce_PathIterator.h @@ -101,7 +101,9 @@ public: int subPathIndex; /** Returns true if the current segment is the last in the current sub-path. */ - bool isLastInSubpath() const throw() { return stackPos == stackBase; } + bool isLastInSubpath() const throw() { return stackPos == stackBase + && (index >= path.numElements + || points [index] == Path::moveMarker); } //==============================================================================