| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ui/gfx/rect.h" | 5 #include "ui/gfx/geometry/rect.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #if defined(OS_WIN) | 9 #if defined(OS_WIN) |
| 10 #include <windows.h> | 10 #include <windows.h> |
| 11 #elif defined(TOOLKIT_GTK) | 11 #elif defined(TOOLKIT_GTK) |
| 12 #include <gdk/gdk.h> | 12 #include <gdk/gdk.h> |
| 13 #endif | 13 #endif |
| 14 | 14 |
| 15 #include "base/logging.h" | 15 #include "base/logging.h" |
| 16 #include "base/strings/stringprintf.h" | 16 #include "base/strings/stringprintf.h" |
| 17 #include "ui/gfx/insets.h" | 17 #include "ui/gfx/geometry/insets.h" |
| 18 #include "ui/gfx/rect_base_impl.h" | 18 #include "ui/gfx/geometry/rect_base_impl.h" |
| 19 | 19 |
| 20 namespace gfx { | 20 namespace gfx { |
| 21 | 21 |
| 22 template class RectBase<Rect, Point, Size, Insets, Vector2d, int>; | 22 template class RectBase<Rect, Point, Size, Insets, Vector2d, int>; |
| 23 | 23 |
| 24 typedef class RectBase<Rect, Point, Size, Insets, Vector2d, int> RectBaseT; | 24 typedef class RectBase<Rect, Point, Size, Insets, Vector2d, int> RectBaseT; |
| 25 | 25 |
| 26 #if defined(OS_WIN) | 26 #if defined(OS_WIN) |
| 27 Rect::Rect(const RECT& r) | 27 Rect::Rect(const RECT& r) |
| 28 : RectBaseT(gfx::Point(r.left, r.top)) { | 28 : RectBaseT(gfx::Point(r.left, r.top)) { |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 | 101 |
| 102 Rect BoundingRect(const Point& p1, const Point& p2) { | 102 Rect BoundingRect(const Point& p1, const Point& p2) { |
| 103 int rx = std::min(p1.x(), p2.x()); | 103 int rx = std::min(p1.x(), p2.x()); |
| 104 int ry = std::min(p1.y(), p2.y()); | 104 int ry = std::min(p1.y(), p2.y()); |
| 105 int rr = std::max(p1.x(), p2.x()); | 105 int rr = std::max(p1.x(), p2.x()); |
| 106 int rb = std::max(p1.y(), p2.y()); | 106 int rb = std::max(p1.y(), p2.y()); |
| 107 return Rect(rx, ry, rr - rx, rb - ry); | 107 return Rect(rx, ry, rr - rx, rb - ry); |
| 108 } | 108 } |
| 109 | 109 |
| 110 } // namespace gfx | 110 } // namespace gfx |
| OLD | NEW |