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

Unified Diff: src/utils/SkDashPath.cpp

Issue 1779803002: Revert of don't create zero length intervals (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 9 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 | « gm/bug530095.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/utils/SkDashPath.cpp
diff --git a/src/utils/SkDashPath.cpp b/src/utils/SkDashPath.cpp
index 0d2783eba257b35bef23ca56e7d71c8a51094bfc..cd01a9972b94695e1a4b27e1e819bb675fcb56e0 100644
--- a/src/utils/SkDashPath.cpp
+++ b/src/utils/SkDashPath.cpp
@@ -16,12 +16,11 @@
static SkScalar find_first_interval(const SkScalar intervals[], SkScalar phase,
int32_t* index, int count) {
for (int i = 0; i < count; ++i) {
- SkScalar gap = intervals[i];
- if (phase > gap || (phase == gap && gap)) {
- phase -= gap;
+ if (phase > intervals[i]) {
+ phase -= intervals[i];
} else {
*index = i;
- return gap - phase;
+ return intervals[i] - phase;
}
}
// If we get here, phase "appears" to be larger than our length. This
« no previous file with comments | « gm/bug530095.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698