diff options
-rw-r--r-- | src/effects/SkDashPathEffect.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/effects/SkDashPathEffect.cpp b/src/effects/SkDashPathEffect.cpp index 24361bd369..f6c7caecd9 100644 --- a/src/effects/SkDashPathEffect.cpp +++ b/src/effects/SkDashPathEffect.cpp @@ -565,10 +565,12 @@ SkDashPathEffect::SkDashPathEffect(SkReadBuffer& buffer) : INHERITED(buffer) { if (useOldPic) { fPhase = 0; - for (int i = 0; i < fInitialDashIndex; ++i) { - fPhase += fIntervals[i]; + if (fInitialDashLength != -1) { // Signal for bad dash interval + for (int i = 0; i < fInitialDashIndex; ++i) { + fPhase += fIntervals[i]; + } + fPhase += fIntervals[fInitialDashIndex] - fInitialDashLength; } - fPhase += fIntervals[fInitialDashIndex] - fInitialDashLength; } else { this->setInternalMembers(fPhase); } |