| 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 #ifndef UI_GFX_RECT_F_H_ | 5 #ifndef UI_GFX_RECT_F_H_ |
| 6 #define UI_GFX_RECT_F_H_ | 6 #define UI_GFX_RECT_F_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "ui/gfx/point_f.h" | 10 #include "ui/gfx/point_f.h" |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 }; | 42 }; |
| 43 | 43 |
| 44 inline bool operator==(const RectF& lhs, const RectF& rhs) { | 44 inline bool operator==(const RectF& lhs, const RectF& rhs) { |
| 45 return lhs.origin() == rhs.origin() && lhs.size() == rhs.size(); | 45 return lhs.origin() == rhs.origin() && lhs.size() == rhs.size(); |
| 46 } | 46 } |
| 47 | 47 |
| 48 inline bool operator!=(const RectF& lhs, const RectF& rhs) { | 48 inline bool operator!=(const RectF& lhs, const RectF& rhs) { |
| 49 return !(lhs == rhs); | 49 return !(lhs == rhs); |
| 50 } | 50 } |
| 51 | 51 |
| 52 UI_EXPORT RectF IntersectRects(const RectF& a, const RectF& b); |
| 53 UI_EXPORT RectF UnionRects(const RectF& a, const RectF& b); |
| 54 UI_EXPORT RectF SubtractRects(const RectF& a, const RectF& b); |
| 55 UI_EXPORT RectF ScaleRect(const RectF& r, float x_scale, float y_scale); |
| 56 |
| 57 inline RectF ScaleRect(const RectF& r, float scale) { |
| 58 return ScaleRect(r, scale, scale); |
| 59 } |
| 60 |
| 52 #if !defined(COMPILER_MSVC) | 61 #if !defined(COMPILER_MSVC) |
| 53 extern template class RectBase<RectF, PointF, SizeF, InsetsF, float>; | 62 extern template class RectBase<RectF, PointF, SizeF, InsetsF, float>; |
| 54 #endif | 63 #endif |
| 55 | 64 |
| 56 } // namespace gfx | 65 } // namespace gfx |
| 57 | 66 |
| 58 #endif // UI_GFX_RECT_F_H_ | 67 #endif // UI_GFX_RECT_F_H_ |
| OLD | NEW |