1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "ui/gfx/geometry/point.h"
11 #include "base/strings/stringprintf.h"
16 Point::Point(DWORD point
) {
17 POINTS points
= MAKEPOINTS(point
);
22 Point::Point(const POINT
& point
) : x_(point
.x
), y_(point
.y
) {
25 Point
& Point::operator=(const POINT
& point
) {
31 POINT
Point::ToPOINT() const {
39 void Point::SetToMin(const Point
& other
) {
40 x_
= x_
<= other
.x_
? x_
: other
.x_
;
41 y_
= y_
<= other
.y_
? y_
: other
.y_
;
44 void Point::SetToMax(const Point
& other
) {
45 x_
= x_
>= other
.x_
? x_
: other
.x_
;
46 y_
= y_
>= other
.y_
? y_
: other
.y_
;
49 std::string
Point::ToString() const {
50 return base::StringPrintf("%d,%d", x(), y());