diff options
author | commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-08-09 19:48:26 +0000 |
---|---|---|
committer | commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-08-09 19:48:26 +0000 |
commit | 9d54aeb8a192845f1f8122dba780d40ee6a0de1b (patch) | |
tree | 352ea45c40fe1b3758a2dcd3d641870e9021f328 /src | |
parent | 80e18c93bbeefe54f8192a380586e6468f179917 (diff) |
All rSomethingTo() immediately following a close() are relative to the point we closed from, not the point we close to. Fix that.
Seems like this has been broken since the stone ages.
BUG=skia:1474, code.google.com/p/android/issues/detail?id=41216
R=bsalomon@google.com
Author: mtklein@google.com
Review URL: https://chromiumcodereview.appspot.com/22681006
git-svn-id: http://skia.googlecode.com/svn/trunk@10666 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src')
-rw-r--r-- | src/core/SkPath.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/core/SkPath.cpp b/src/core/SkPath.cpp index 97204bba01..ed2f555ca5 100644 --- a/src/core/SkPath.cpp +++ b/src/core/SkPath.cpp @@ -749,6 +749,7 @@ void SkPath::lineTo(SkScalar x, SkScalar y) { } void SkPath::rLineTo(SkScalar x, SkScalar y) { + this->injectMoveToIfNeeded(); // This can change the result of this->getLastPt(). SkPoint pt; this->getLastPt(&pt); this->lineTo(pt.fX + x, pt.fY + y); @@ -770,6 +771,7 @@ void SkPath::quadTo(SkScalar x1, SkScalar y1, SkScalar x2, SkScalar y2) { } void SkPath::rQuadTo(SkScalar x1, SkScalar y1, SkScalar x2, SkScalar y2) { + this->injectMoveToIfNeeded(); // This can change the result of this->getLastPt(). SkPoint pt; this->getLastPt(&pt); this->quadTo(pt.fX + x1, pt.fY + y1, pt.fX + x2, pt.fY + y2); @@ -803,6 +805,7 @@ void SkPath::conicTo(SkScalar x1, SkScalar y1, SkScalar x2, SkScalar y2, void SkPath::rConicTo(SkScalar dx1, SkScalar dy1, SkScalar dx2, SkScalar dy2, SkScalar w) { + this->injectMoveToIfNeeded(); // This can change the result of this->getLastPt(). SkPoint pt; this->getLastPt(&pt); this->conicTo(pt.fX + dx1, pt.fY + dy1, pt.fX + dx2, pt.fY + dy2, w); @@ -827,6 +830,7 @@ void SkPath::cubicTo(SkScalar x1, SkScalar y1, SkScalar x2, SkScalar y2, void SkPath::rCubicTo(SkScalar x1, SkScalar y1, SkScalar x2, SkScalar y2, SkScalar x3, SkScalar y3) { + this->injectMoveToIfNeeded(); // This can change the result of this->getLastPt(). SkPoint pt; this->getLastPt(&pt); this->cubicTo(pt.fX + x1, pt.fY + y1, pt.fX + x2, pt.fY + y2, |