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

Unified Diff: include/core/SkPoint.h

Issue 785933003: change SkPoint::setLength to set itself to (0,0) if it starting length is degenerate (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years 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 | src/core/SkPath.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkPoint.h
diff --git a/include/core/SkPoint.h b/include/core/SkPoint.h
index 18b371f2ca3910274fc0520de772c87ef90075d2..323c824a1b0e10d523cb2305cd8f0d5de9f4f2a8 100644
--- a/include/core/SkPoint.h
+++ b/include/core/SkPoint.h
@@ -258,25 +258,25 @@ struct SK_API SkPoint {
/** Set the point (vector) to be unit-length in the same direction as it
already points. If the point has a degenerate length (i.e. nearly 0)
- then return false and do nothing; otherwise return true.
+ then set it to (0,0) and return false; otherwise return true.
*/
bool normalize();
/** Set the point (vector) to be unit-length in the same direction as the
x,y params. If the vector (x,y) has a degenerate length (i.e. nearly 0)
- then return false and do nothing, otherwise return true.
+ then set it to (0,0) and return false, otherwise return true.
*/
bool setNormalize(SkScalar x, SkScalar y);
/** Scale the point (vector) to have the specified length, and return that
length. If the original length is degenerately small (nearly zero),
- do nothing and return false, otherwise return true.
+ set it to (0,0) and return false, otherwise return true.
*/
bool setLength(SkScalar length);
/** Set the point (vector) to have the specified length in the same
direction as (x,y). If the vector (x,y) has a degenerate length
- (i.e. nearly 0) then return false and do nothing, otherwise return true.
+ (i.e. nearly 0) then set it to (0,0) and return false, otherwise return true.
*/
bool setLength(SkScalar x, SkScalar y, SkScalar length);
@@ -423,7 +423,7 @@ struct SK_API SkPoint {
static SkScalar Length(SkScalar x, SkScalar y);
/** Normalize pt, returning its previous length. If the prev length is too
- small (degenerate), return 0 and leave pt unchanged. This uses the same
+ small (degenerate), set pt to (0,0) and return 0. This uses the same
tolerance as CanNormalize.
Note that this method may be significantly more expensive than
« no previous file with comments | « no previous file | src/core/SkPath.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698