Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(170)

Unified Diff: src/core/SkPathMeasure.cpp

Issue 1314213002: zero-length cap fix (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: add gm test decl Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include/core/SkPaint.h ('k') | src/core/SkStroke.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkPathMeasure.cpp
diff --git a/src/core/SkPathMeasure.cpp b/src/core/SkPathMeasure.cpp
index a5dd84048c56c88334020f1a6d6907b54b918413..17ae95e8014930abdb010ed8bc3b0300f5dd2d70 100644
--- a/src/core/SkPathMeasure.cpp
+++ b/src/core/SkPathMeasure.cpp
@@ -314,7 +314,12 @@ static void seg_to(const SkPoint pts[], int segType,
SkASSERT(startT <= stopT);
if (startT == stopT) {
- return; // should we report this, to undo a moveTo?
+ /* if the dash as a zero-length on segment, add a corresponding zero-length line.
+ The stroke code will add end caps to zero length lines as appropriate */
+ SkPoint lastPt;
+ SkAssertResult(dst->getLastPt(&lastPt));
+ dst->lineTo(lastPt);
+ return;
}
SkPoint tmp0[7], tmp1[7];
@@ -568,7 +573,7 @@ bool SkPathMeasure::getSegment(SkScalar startD, SkScalar stopD, SkPath* dst,
if (stopD > length) {
stopD = length;
}
- if (startD >= stopD) {
+ if (startD > stopD) {
return false;
}
« no previous file with comments | « include/core/SkPaint.h ('k') | src/core/SkStroke.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698