Index: ui/gfx/geometry/rect.h |
diff --git a/ui/gfx/geometry/rect.h b/ui/gfx/geometry/rect.h |
index 241ff3cf2d1d941732ddb6332a85bfe530b6c128..95251e931122887261cd0927318d0c52a8f04807 100644 |
--- a/ui/gfx/geometry/rect.h |
+++ b/ui/gfx/geometry/rect.h |
@@ -245,6 +245,15 @@ inline Rect ScaleToEnclosingRect(const Rect& rect, float scale) { |
return ScaleToEnclosingRect(rect, scale, scale); |
} |
+// Returns the smallest Rect that encloses the given Rect after scaling by |
+// scale. If the result is scaling would make any dimension of the rect be too |
danakj
2015/06/15 19:13:47
result from
|
+// big to be represented by an integer, then use the largest integer for that |
+// dimension. |
+// Note that the resulting rect x(), y(), width(), height(), right(), bottom() |
+// will all return valid integer values. This means that if x() is max_int, |
+// then width would() have to be 0 in order for right() to be max_int. |
+GFX_EXPORT Rect SafelyScaleToEnclosingRect(const Rect& rect, float scale); |
danakj
2015/06/15 19:13:47
Should we be returning a bool equivalent of |clipp
|
+ |
inline Rect ScaleToEnclosedRect(const Rect& rect, |
float x_scale, |
float y_scale) { |