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

Unified Diff: src/core/SkGeometry.cpp

Issue 2312923002: compare degenerates with tolerance (Closed)
Patch Set: Created 4 years, 3 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 | « no previous file | tests/PathTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkGeometry.cpp
diff --git a/src/core/SkGeometry.cpp b/src/core/SkGeometry.cpp
index 8f270f9722c66f59bbad86c2168f291c0b760cb6..a3ebfb38a892740aed025a08e31653f9a5585e5c 100644
--- a/src/core/SkGeometry.cpp
+++ b/src/core/SkGeometry.cpp
@@ -1176,7 +1176,8 @@ int SkConic::chopIntoQuadsPOW2(SkPoint pts[], int pow2) const {
SkConic dst[2];
this->chop(dst);
// check to see if the first chop generates a pair of lines
- if (dst[0].fPts[1] == dst[0].fPts[2] && dst[1].fPts[0] == dst[1].fPts[1]) {
+ if (dst[0].fPts[1].equalsWithinTolerance(dst[0].fPts[2])
+ && dst[1].fPts[0].equalsWithinTolerance(dst[1].fPts[1])) {
pts[1] = pts[2] = pts[3] = dst[0].fPts[1]; // set ctrl == end to make lines
pts[4] = dst[1].fPts[2];
pow2 = 1;
« no previous file with comments | « no previous file | tests/PathTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698