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

Unified Diff: ui/gfx/size.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.h
diff --git a/ui/gfx/size.h b/ui/gfx/size.h
index 4425207a18fa4b25b3a8bb433a4bd7b9da9940a8..d9eee533ab38220b0a7d1b187476783f9d6e4dcb 100644
--- a/ui/gfx/size.h
+++ b/ui/gfx/size.h
@@ -11,6 +11,7 @@
#include "ui/base/ui_export.h"
#include "ui/gfx/size_base.h"
#include "ui/gfx/size_f.h"
+#include "ui/gfx/vector2d.h"
#if defined(OS_WIN)
typedef struct tagSIZE SIZE;
@@ -66,6 +67,10 @@ inline bool operator!=(const Size& lhs, const Size& rhs) {
return !(lhs == rhs);
}
+inline Size SizeOfVector2d(const Vector2d& v) {
+ return Size(std::abs(v.x()), std::abs(v.y()));
+}
+
#if !defined(COMPILER_MSVC)
extern template class SizeBase<Size, int>;
#endif
« ui/gfx/point_f.h ('K') | « ui/gfx/render_text.cc ('k') | ui/gfx/size_f.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698