summaryrefslogtreecommitdiffstats
path: root/ui/gfx/rect_f.h
diff options
context:
space:
mode:
authordanakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-01-23 03:51:36 +0000
committerdanakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-01-23 03:51:36 +0000
commit62c607121a2c0b5bf463cd6da0fd568140523e30 (patch)
treee99d2d69b958590be8a1afa65065d76d97a3a025 /ui/gfx/rect_f.h
parent55b4f27b45cf6a09f0f29222efef8f561a0733c7 (diff)
downloadchromium_src-62c607121a2c0b5bf463cd6da0fd568140523e30.zip
chromium_src-62c607121a2c0b5bf463cd6da0fd568140523e30.tar.gz
chromium_src-62c607121a2c0b5bf463cd6da0fd568140523e30.tar.bz2
ui: Prevent negative sizes.
Negative sizes are clamped to be 0, but keeping the setter methods inline, so without DCHECKs. TBR=sky BUG=160158 Relanding https://codereview.chromium.org/11365160/ in pieces. Review URL: https://chromiumcodereview.appspot.com/12042029 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@178237 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/gfx/rect_f.h')
-rw-r--r--ui/gfx/rect_f.h5
1 files changed, 1 insertions, 4 deletions
diff --git a/ui/gfx/rect_f.h b/ui/gfx/rect_f.h
index bbc16cc..78524a0 100644
--- a/ui/gfx/rect_f.h
+++ b/ui/gfx/rect_f.h
@@ -49,10 +49,7 @@ class UI_EXPORT RectF
void Scale(float x_scale, float y_scale) {
set_origin(ScalePoint(origin(), x_scale, y_scale));
-
- SizeF new_size = gfx::ScaleSize(size(), x_scale, y_scale);
- new_size.ClampToNonNegative();
- set_size(new_size);
+ set_size(ScaleSize(size(), x_scale, y_scale));
}
// This method reports if the RectF can be safely converted to an integer