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

Unified Diff: ui/gfx/vector2d_f.h

Issue 11293193: ui: Add non-member Vector2dScale() and Vector3dScale() methods to create scaled vectors (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review Created 8 years, 1 month 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 | « cc/page_scale_animation.cc ('k') | ui/gfx/vector2d_f.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/vector2d_f.h
diff --git a/ui/gfx/vector2d_f.h b/ui/gfx/vector2d_f.h
index e78c68821b7f2f18d85decfccc30a7ba61a9bddd..a245bb33882d4a670e964bcbfc660bed1a1082ef 100644
--- a/ui/gfx/vector2d_f.h
+++ b/ui/gfx/vector2d_f.h
@@ -82,6 +82,17 @@ UI_EXPORT double CrossProduct(const Vector2dF& lhs, const Vector2dF& rhs);
// Return the dot product of two vectors.
UI_EXPORT double DotProduct(const Vector2dF& lhs, const Vector2dF& rhs);
+// Return a vector that is |v| scaled by the given scale factors along each
+// axis.
+UI_EXPORT Vector2dF ScaleVector2d(const Vector2dF& v,
+ float x_scale,
+ float y_scale);
+
+// Return a vector that is |v| scaled by the given scale factor.
+inline Vector2dF ScaleVector2d(const Vector2dF& v, float scale) {
+ return ScaleVector2d(v, scale, scale);
+}
+
} // namespace gfx
#endif // UI_GFX_VECTOR2D_F_H_
« no previous file with comments | « cc/page_scale_animation.cc ('k') | ui/gfx/vector2d_f.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698