diff options
author | danakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-10 05:24:19 +0000 |
---|---|---|
committer | danakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-10 05:24:19 +0000 |
commit | 685836bbb4799a9333821b431a7535b29391bd2e (patch) | |
tree | e594b61457e5a487267c6be0a039353f849548f3 /ui/gfx/size_f.cc | |
parent | fc290d614c7fab02dcdaf88b992a0204be23aa90 (diff) | |
download | chromium_src-685836bbb4799a9333821b431a7535b29391bd2e.zip chromium_src-685836bbb4799a9333821b431a7535b29391bd2e.tar.gz chromium_src-685836bbb4799a9333821b431a7535b29391bd2e.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.
R=sky
BUG=160158
Review URL: https://codereview.chromium.org/11365160
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@167062 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/gfx/size_f.cc')
-rw-r--r-- | ui/gfx/size_f.cc | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/ui/gfx/size_f.cc b/ui/gfx/size_f.cc index 96c1867..0aad4ad 100644 --- a/ui/gfx/size_f.cc +++ b/ui/gfx/size_f.cc @@ -4,8 +4,8 @@ #include "ui/gfx/size_f.h" -#include "base/logging.h" #include "base/stringprintf.h" +#include "ui/gfx/size_base_impl.h" namespace gfx { @@ -13,9 +13,8 @@ template class SizeBase<SizeF, float>; SizeF::SizeF() : SizeBase<SizeF, float>(0, 0) {} -SizeF::SizeF(float width, float height) : SizeBase<SizeF, float>(0, 0) { - set_width(width); - set_height(height); +SizeF::SizeF(float width, float height) + : SizeBase<SizeF, float>(width, height) { } SizeF::~SizeF() {} |