Chromium Code Reviews| Index: ui/gfx/point.h |
| diff --git a/ui/gfx/point.h b/ui/gfx/point.h |
| index dfb227d190eb22afb01371d9f2ba35e12969bf27..4cfe466163ea449c43fe196fd5e03b8afb9b9c96 100644 |
| --- a/ui/gfx/point.h |
| +++ b/ui/gfx/point.h |
| @@ -7,6 +7,7 @@ |
| #include "ui/base/ui_export.h" |
| #include "ui/gfx/point_base.h" |
| +#include "ui/gfx/point_f.h" |
| #if defined(OS_WIN) |
| typedef unsigned long DWORD; |
| @@ -45,8 +46,20 @@ class UI_EXPORT Point : public PointBase<Point, int> { |
| // Returns a string representation of point. |
| std::string ToString() const; |
| + |
| + operator PointF() const { |
| + return PointF(x(), y()); |
| + } |
| }; |
| +inline Point operator+(Point lhs, Point rhs) { |
|
sky
2012/10/01 21:02:20
const Point& here (and 59).
danakj
2012/10/01 22:03:37
Done.
|
| + return lhs.Add(rhs); |
| +} |
| + |
| +inline Point operator-(Point lhs, Point rhs) { |
| + return lhs.Subtract(rhs); |
| +} |
| + |
| #if !defined(COMPILER_MSVC) |
| extern template class PointBase<Point, int>; |
| #endif |