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-08 16:02:05 +0000
committerdanakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-01-08 16:02:05 +0000
commit190d06bf03d4c310f042396046b2b5b5f7af43cf (patch)
treed2b11881ccfe6f6c78557b83f14fe9c64d7d1b21 /ui/gfx/rect_f.h
parent41b9266435fba2235d705ee0df8ca960b3c72f03 (diff)
downloadchromium_src-190d06bf03d4c310f042396046b2b5b5f7af43cf.zip
chromium_src-190d06bf03d4c310f042396046b2b5b5f7af43cf.tar.gz
chromium_src-190d06bf03d4c310f042396046b2b5b5f7af43cf.tar.bz2
ui: Remove gfx::Size::ClampToNonNegative, prevent negative sizes always.
This was added with the intention of using Size as a vector, replacing use of IntSize. Since we have Vector2d now, negative sizes should not exist, so clamp them in set_width/set_height and the constructor. Not covered by tests, as we can't test DCHECKs. TBR=sky BUG=160158 Relanding: https://codereview.chromium.org/11365160/ Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=167255 Review URL: https://chromiumcodereview.appspot.com/11410024 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@175535 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