Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / ui / gfx / geometry / point.cc
index 5a68ba6..2248a4d 100644 (file)
 
 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());