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

Unified Diff: ui/gfx/vector3d_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: use it in cc/ 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
Index: ui/gfx/vector3d_f.cc
diff --git a/ui/gfx/vector3d_f.cc b/ui/gfx/vector3d_f.cc
index 730f00b9975cf48782963c296e1e51171437f60a..e547a62363861656129fbed714b0b61ff2b75e71 100644
--- a/ui/gfx/vector3d_f.cc
+++ b/ui/gfx/vector3d_f.cc
@@ -76,4 +76,11 @@ float DotProduct(const Vector3dF& lhs, const Vector3dF& rhs) {
return lhs.x() * rhs.x() + lhs.y() * rhs.y() + lhs.z() * rhs.z();
}
+Vector3dF ScaleVector3d(
+ const Vector3dF& v, float x_scale, float y_scale, float z_scale) {
sky 2012/11/09 17:06:21 nit on wrapping here too.
danakj 2012/11/09 18:21:47 Done.
+ Vector3dF scaled_v(v);
+ scaled_v.Scale(x_scale, y_scale, z_scale);
+ return scaled_v;
+}
+
} // namespace gfx

Powered by Google App Engine
This is Rietveld 408576698