| Index: ui/gfx/geometry/point.cc
|
| diff --git a/ui/gfx/geometry/point.cc b/ui/gfx/geometry/point.cc
|
| index 5a68ba67bdd8fe108105905a0f16c7e3e7a8f1ea..2248a4dbe7e654dd109b6e2b4ccf829beba88457 100644
|
| --- a/ui/gfx/geometry/point.cc
|
| +++ b/ui/gfx/geometry/point.cc
|
| @@ -12,22 +12,19 @@
|
|
|
| namespace gfx {
|
|
|
| -template class PointBase<Point, int, Vector2d>;
|
| -
|
| #if defined(OS_WIN)
|
| -Point::Point(DWORD point) : PointBase<Point, int, Vector2d>(0, 0){
|
| +Point::Point(DWORD point) {
|
| POINTS points = MAKEPOINTS(point);
|
| - set_x(points.x);
|
| - set_y(points.y);
|
| + x_ = points.x;
|
| + y_ = points.y;
|
| }
|
|
|
| -Point::Point(const POINT& point)
|
| - : PointBase<Point, int, Vector2d>(point.x, point.y) {
|
| +Point::Point(const POINT& point) : x_(point.x), y_(point.y) {
|
| }
|
|
|
| Point& Point::operator=(const POINT& point) {
|
| - set_x(point.x);
|
| - set_y(point.y);
|
| + x_ = point.x;
|
| + y_ = point.y;
|
| return *this;
|
| }
|
|
|
| @@ -37,15 +34,17 @@ POINT Point::ToPOINT() const {
|
| p.y = y();
|
| return p;
|
| }
|
| -#elif defined(OS_MACOSX)
|
| -Point::Point(const CGPoint& point)
|
| - : PointBase<Point, int, Vector2d>(point.x, point.y) {
|
| +#endif
|
| +
|
| +void Point::SetToMin(const Point& other) {
|
| + x_ = x_ <= other.x_ ? x_ : other.x_;
|
| + y_ = y_ <= other.y_ ? y_ : other.y_;
|
| }
|
|
|
| -CGPoint Point::ToCGPoint() const {
|
| - return CGPointMake(x(), y());
|
| +void Point::SetToMax(const Point& other) {
|
| + x_ = x_ >= other.x_ ? x_ : other.x_;
|
| + y_ = y_ >= other.y_ ? y_ : other.y_;
|
| }
|
| -#endif
|
|
|
| std::string Point::ToString() const {
|
| return base::StringPrintf("%d,%d", x(), y());
|
|
|