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

Unified Diff: ui/gfx/size_f.h

Issue 11269022: Add Vector2d classes that represent offsets, instead of using Point. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: vector length and conversion to size Created 8 years, 2 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
Index: ui/gfx/size_f.h
diff --git a/ui/gfx/size_f.h b/ui/gfx/size_f.h
index f9ac6bd890e5b5ab7ec4e7d4c880a5c7f4fef84b..89a9998c6ab9cf6b65b34b0c563f57003d241f94 100644
--- a/ui/gfx/size_f.h
+++ b/ui/gfx/size_f.h
@@ -9,6 +9,7 @@
#include "ui/base/ui_export.h"
#include "ui/gfx/size_base.h"
+#include "ui/gfx/vector2d_f.h"
namespace gfx {
@@ -38,6 +39,10 @@ inline bool operator!=(const SizeF& lhs, const SizeF& rhs) {
return !(lhs == rhs);
}
+inline SizeF SizeOfVector2d(const Vector2dF& v) {
+ return SizeF(std::abs(v.x()), std::abs(v.y()));
+}
+
#if !defined(COMPILER_MSVC)
extern template class SizeBase<SizeF, float>;
#endif
« ui/gfx/point_f.h ('K') | « ui/gfx/size.h ('k') | ui/gfx/size_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698