summaryrefslogtreecommitdiffstats
path: root/ui/gfx/rect_f.h
diff options
context:
space:
mode:
Diffstat (limited to 'ui/gfx/rect_f.h')
-rw-r--r--ui/gfx/rect_f.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/ui/gfx/rect_f.h b/ui/gfx/rect_f.h
index 78524a0..bbc16cc 100644
--- a/ui/gfx/rect_f.h
+++ b/ui/gfx/rect_f.h
@@ -49,7 +49,10 @@ class UI_EXPORT RectF
void Scale(float x_scale, float y_scale) {
set_origin(ScalePoint(origin(), x_scale, y_scale));
- set_size(ScaleSize(size(), x_scale, y_scale));
+
+ SizeF new_size = gfx::ScaleSize(size(), x_scale, y_scale);
+ new_size.ClampToNonNegative();
+ set_size(new_size);
}
// This method reports if the RectF can be safely converted to an integer