mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
26 lines
620 B
C++
26 lines
620 B
C++
// 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
|