Chromium Code Reviews| Index: ui/gfx/rect_f.h |
| diff --git a/ui/gfx/rect_f.h b/ui/gfx/rect_f.h |
| index 78524a07587d609c0c0bc3b9f9c851a23ab4df69..b6bc361fa0b5afaa7358a38921f0f46c2b18a24f 100644 |
| --- a/ui/gfx/rect_f.h |
| +++ b/ui/gfx/rect_f.h |
| @@ -69,8 +69,15 @@ inline bool operator!=(const RectF& lhs, const RectF& rhs) { |
| return !(lhs == rhs); |
| } |
| -UI_EXPORT RectF operator+(const RectF& lhs, const Vector2dF& rhs); |
| -UI_EXPORT RectF operator-(const RectF& lhs, const Vector2dF& rhs); |
| +inline RectF operator+(const RectF& lhs, const Vector2dF& rhs) { |
| + return RectF(lhs.x() + rhs.x(), lhs.y() + rhs.y(), |
| + lhs.width(), lhs.height()); |
| +} |
| + |
| +inline RectF operator-(const RectF& lhs, const Vector2dF& rhs) { |
| + return RectF(lhs.x() - rhs.x(), lhs.y() - rhs.y(), |
| + lhs.width(), lhs.height()); |
| +} |
| inline RectF operator+(const Vector2dF& lhs, const RectF& rhs) { |
| return rhs + lhs; |
| @@ -79,7 +86,12 @@ inline RectF operator+(const Vector2dF& lhs, const RectF& rhs) { |
| UI_EXPORT RectF IntersectRects(const RectF& a, const RectF& b); |
| UI_EXPORT RectF UnionRects(const RectF& a, const RectF& b); |
| UI_EXPORT RectF SubtractRects(const RectF& a, const RectF& b); |
| -UI_EXPORT RectF ScaleRect(const RectF& r, float x_scale, float y_scale); |
| + |
| +inline RectF ScaleRect(const RectF& r, float x_scale, float y_scale) { |
| + return RectF( |
| + r.x() * x_scale, r.y() * y_scale, |
|
tfarina
2013/01/30 14:55:02
nit: this does fit above, so, please move it above
|
| + r.width() * x_scale, r.height() * y_scale); |
| +} |
| inline RectF ScaleRect(const RectF& r, float scale) { |
| return ScaleRect(r, scale, scale); |