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

Unified Diff: ui/gfx/vector2d_f.cc

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 | « ui/gfx/vector2d_f.h ('k') | ui/gfx/vector2d_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/vector2d_f.cc
diff --git a/ui/gfx/vector2d_f.cc b/ui/gfx/vector2d_f.cc
index 3671c62869c6a7fc3e4c39471b1c71294c5dcf70..f0d28c94335875b0dd1281676546ea03567ebeb1 100644
--- a/ui/gfx/vector2d_f.cc
+++ b/ui/gfx/vector2d_f.cc
@@ -61,4 +61,10 @@ double DotProduct(const Vector2dF& lhs, const Vector2dF& rhs) {
static_cast<double>(lhs.y()) * rhs.y();
}
+Vector2dF ScaleVector2d(const Vector2dF& v, float x_scale, float y_scale) {
+ Vector2dF scaled_v(v);
+ scaled_v.Scale(x_scale, y_scale);
+ return scaled_v;
+}
+
} // namespace gfx
« no previous file with comments | « ui/gfx/vector2d_f.h ('k') | ui/gfx/vector2d_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698