| Index: ui/gfx/geometry/rect.h
|
| diff --git a/ui/gfx/geometry/rect.h b/ui/gfx/geometry/rect.h
|
| index fed202d2bd30b769f91ee041c70224f618495010..c9ae1eeaa429b1474f40ed42041dae1ee57450f1 100644
|
| --- a/ui/gfx/geometry/rect.h
|
| +++ b/ui/gfx/geometry/rect.h
|
| @@ -59,7 +59,8 @@ class GFX_EXPORT Rect {
|
| #endif
|
|
|
| operator RectF() const {
|
| - return RectF(origin().x(), origin().y(), size().width(), size().height());
|
| + return RectF(static_cast<float>(x()), static_cast<float>(y()),
|
| + static_cast<float>(width()), static_cast<float>(height()));
|
| }
|
|
|
| int x() const { return origin_.x(); }
|
| @@ -220,10 +221,12 @@ GFX_EXPORT Rect BoundingRect(const Point& p1, const Point& p2);
|
| inline Rect ScaleToEnclosingRect(const Rect& rect,
|
| float x_scale,
|
| float y_scale) {
|
| - int x = std::floor(rect.x() * x_scale);
|
| - int y = std::floor(rect.y() * y_scale);
|
| - int r = rect.width() == 0 ? x : std::ceil(rect.right() * x_scale);
|
| - int b = rect.height() == 0 ? y : std::ceil(rect.bottom() * y_scale);
|
| + int x = static_cast<int>(std::floor(rect.x() * x_scale));
|
| + int y = static_cast<int>(std::floor(rect.y() * y_scale));
|
| + int r = rect.width() == 0 ?
|
| + x : static_cast<int>(std::ceil(rect.right() * x_scale));
|
| + int b = rect.height() == 0 ?
|
| + y : static_cast<int>(std::ceil(rect.bottom() * y_scale));
|
| return Rect(x, y, r - x, b - y);
|
| }
|
|
|
| @@ -234,10 +237,12 @@ inline Rect ScaleToEnclosingRect(const Rect& rect, float scale) {
|
| inline Rect ScaleToEnclosedRect(const Rect& rect,
|
| float x_scale,
|
| float y_scale) {
|
| - int x = std::ceil(rect.x() * x_scale);
|
| - int y = std::ceil(rect.y() * y_scale);
|
| - int r = rect.width() == 0 ? x : std::floor(rect.right() * x_scale);
|
| - int b = rect.height() == 0 ? y : std::floor(rect.bottom() * y_scale);
|
| + int x = static_cast<int>(std::ceil(rect.x() * x_scale));
|
| + int y = static_cast<int>(std::ceil(rect.y() * y_scale));
|
| + int r = rect.width() == 0 ?
|
| + x : static_cast<int>(std::floor(rect.right() * x_scale));
|
| + int b = rect.height() == 0 ?
|
| + y : static_cast<int>(std::floor(rect.bottom() * y_scale));
|
| return Rect(x, y, r - x, b - y);
|
| }
|
|
|
|
|