Chromium Code Reviews| Index: ui/gfx/point.h |
| diff --git a/ui/gfx/point.h b/ui/gfx/point.h |
| index dfb227d190eb22afb01371d9f2ba35e12969bf27..9e4074093b32e1d198b4ca8d16b18df82d70ba2a 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; |
| @@ -24,6 +25,7 @@ class UI_EXPORT Point : public PointBase<Point, int> { |
| public: |
| Point(); |
| Point(int x, int y); |
| + Point(const Point& other); |
|
sky
2012/09/28 23:05:49
explicit
danakj
2012/09/28 23:19:14
thanks. i was able to remove the copy constructors
|
| #if defined(OS_WIN) |
| // |point| is a DWORD value that contains a coordinate. The x-coordinate is |
| // the low-order short and the y-coordinate is the high-order short. This |
| @@ -45,8 +47,20 @@ class UI_EXPORT Point : public PointBase<Point, int> { |
| // Returns a string representation of point. |
| std::string ToString() const; |
| + |
| + operator PointF() const WARN_UNUSED_RESULT { |
|
sky
2012/09/28 23:05:49
Why the WARN_UNUSED_RESULT?
danakj
2012/09/28 23:19:14
removed.
|
| + return PointF(x(), y()); |
| + } |
| }; |
| +inline Point operator+(Point lhs, Point rhs) { |
| + 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 |