| Index: ui/gfx/rect.h
|
| diff --git a/ui/gfx/rect.h b/ui/gfx/rect.h
|
| index 36f822cd353daf3e28f4932ed7a7c82113a5bb6e..0f0794875efd5788b08caee1a0dd51f2b0186d03 100644
|
| --- a/ui/gfx/rect.h
|
| +++ b/ui/gfx/rect.h
|
| @@ -68,7 +68,7 @@ class UI_EXPORT Rect : public RectBase<Rect, Point, Size, Insets, int> {
|
| CGRect ToCGRect() const;
|
| #endif
|
|
|
| - RectF ToRectF() const {
|
| + operator RectF() const {
|
| return RectF(origin().x(), origin().y(), size().width(), size().height());
|
| }
|
|
|
| @@ -77,12 +77,21 @@ class UI_EXPORT Rect : public RectBase<Rect, Point, Size, Insets, int> {
|
| }
|
|
|
| RectF Scale(float x_scale, float y_scale) const WARN_UNUSED_RESULT {
|
| - return ToRectF().Scale(x_scale, y_scale);
|
| + RectF original = *this;
|
| + return original.Scale(x_scale, y_scale);
|
| }
|
|
|
| std::string ToString() const;
|
| };
|
|
|
| +inline bool operator==(const Rect& lhs, const Rect& rhs) {
|
| + return lhs.origin() == rhs.origin() && lhs.size() == rhs.size();
|
| +}
|
| +
|
| +inline bool operator!=(const Rect& lhs, const Rect& rhs) {
|
| + return !(lhs == rhs);
|
| +}
|
| +
|
| #if !defined(COMPILER_MSVC)
|
| extern template class RectBase<Rect, Point, Size, Insets, int>;
|
| #endif
|
|
|