Supervised user whitelists: Cleanup
[chromium-blink-merge.git] / ui / gfx / geometry / point.cc
blob2248a4dbe7e654dd109b6e2b4ccf829beba88457
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"
7 #if defined(OS_WIN)
8 #include <windows.h>
9 #endif
11 #include "base/strings/stringprintf.h"
13 namespace gfx {
15 #if defined(OS_WIN)
16 Point::Point(DWORD point) {
17 POINTS points = MAKEPOINTS(point);
18 x_ = points.x;
19 y_ = points.y;
22 Point::Point(const POINT& point) : x_(point.x), y_(point.y) {
25 Point& Point::operator=(const POINT& point) {
26 x_ = point.x;
27 y_ = point.y;
28 return *this;
31 POINT Point::ToPOINT() const {
32 POINT p;
33 p.x = x();
34 p.y = y();
35 return p;
37 #endif
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());
53 } // namespace gfx