| Index: ui/gfx/geometry/rect.cc
|
| diff --git a/ui/gfx/geometry/rect.cc b/ui/gfx/geometry/rect.cc
|
| index e7a3aa2aac93f14eb96c4832a130f4bbeafa9253..b7bdc3947d57f14d6dd168adbe4cd5867d982d49 100644
|
| --- a/ui/gfx/geometry/rect.cc
|
| +++ b/ui/gfx/geometry/rect.cc
|
| @@ -239,6 +239,19 @@ int Rect::ManhattanInternalDistance(const Rect& rect) const {
|
| return x + y;
|
| }
|
|
|
| +float Rect::MaxDistanceToCorners(const gfx::Point& point) const {
|
| + const float distance_to_top_left = (origin() - point).Length();
|
| + const float distance_to_top_right = (top_right() - point).Length();
|
| + const float distance_to_bottom_left = (bottom_left() - point).Length();
|
| + const float distance_to_bottom_right = (bottom_right() - point).Length();
|
| +
|
| + float largest_distance =
|
| + std::max(distance_to_top_left, distance_to_top_right);
|
| + largest_distance = std::max(largest_distance, distance_to_bottom_left);
|
| + largest_distance = std::max(largest_distance, distance_to_bottom_right);
|
| + return largest_distance;
|
| +}
|
| +
|
| std::string Rect::ToString() const {
|
| return base::StringPrintf("%s %s",
|
| origin().ToString().c_str(),
|
|
|