blob: 4eeb216a371b0fcdd3e84bfe05584141cea8d1bf [file] [log] [blame]
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "ui/gfx/geometry/point.h"
#include "base/strings/stringprintf.h"
namespace gfx {
void Point::SetToMin(const Point& other) {
x_ = x_ <= other.x_ ? x_ : other.x_;
y_ = y_ <= other.y_ ? y_ : other.y_;
}
void Point::SetToMax(const Point& other) {
x_ = x_ >= other.x_ ? x_ : other.x_;
y_ = y_ >= other.y_ ? y_ : other.y_;
}
std::string Point::ToString() const {
return base::StringPrintf("%d,%d", x(), y());
}
} // namespace gfx