summaryrefslogtreecommitdiffstats
path: root/ui/gfx/rect_f.h
diff options
context:
space:
mode:
authordanakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-10 06:17:35 +0000
committerdanakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-10 06:17:35 +0000
commit83d7bf18448ea2731ac687d4ea4980649bfd2eb0 (patch)
tree622077740374cd5569147d775930e7e0628c83f0 /ui/gfx/rect_f.h
parent67ddf0de211817778e6d4106e907f285e489f31c (diff)
downloadchromium_src-83d7bf18448ea2731ac687d4ea4980649bfd2eb0.zip
chromium_src-83d7bf18448ea2731ac687d4ea4980649bfd2eb0.tar.gz
chromium_src-83d7bf18448ea2731ac687d4ea4980649bfd2eb0.tar.bz2
Revert 167062 - 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. R=sky BUG=160158 Review URL: https://codereview.chromium.org/11365160 TBR=danakj@chromium.org Apparently there are now Aura unit tests that rely on negative sizes: http://build.chromium.org/p/chromium.win/buildstatus?builder=Win%20Aura&number=24205 Review URL: https://codereview.chromium.org/11275243 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@167066 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/gfx/rect_f.h')
-rw-r--r--ui/gfx/rect_f.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/ui/gfx/rect_f.h b/ui/gfx/rect_f.h
index 965e5af..7595091 100644
--- a/ui/gfx/rect_f.h
+++ b/ui/gfx/rect_f.h
@@ -37,6 +37,7 @@ class UI_EXPORT RectF
set_origin(ScalePoint(origin(), x_scale, y_scale));
SizeF new_size = size().Scale(x_scale, y_scale);
+ new_size.ClampToNonNegative();
set_size(new_size);
}