diff options
author | cpu@chromium.org <cpu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-10 00:38:23 +0000 |
---|---|---|
committer | cpu@chromium.org <cpu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-10 00:38:23 +0000 |
commit | b8f0d0daa59b11aa8303952fe34a82471d6c3015 (patch) | |
tree | 29682e00e76d171b3a4779a444ea7d6c69fdfee9 /ui/gfx/rect_base_impl.h | |
parent | acf2eb009a525699a4054e94a9455c1cc60091b6 (diff) | |
download | chromium_src-b8f0d0daa59b11aa8303952fe34a82471d6c3015.zip chromium_src-b8f0d0daa59b11aa8303952fe34a82471d6c3015.tar.gz chromium_src-b8f0d0daa59b11aa8303952fe34a82471d6c3015.tar.bz2 |
Revert 160976 - The center of a rect is x+width/2, y+height/2
If a rect is (0, 0, 5, 5) the center should be 2.5, 2.5, not 2, 2.
Tests:
ui_unittests:RectTest.CenterPoint
ui_unittests:RectTest.CenterPointF
BUG=147395
Review URL: https://chromiumcodereview.appspot.com/11065050
TBR=danakj@chromium.org
Review URL: https://codereview.chromium.org/11086037
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@160993 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/gfx/rect_base_impl.h')
-rw-r--r-- | ui/gfx/rect_base_impl.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/ui/gfx/rect_base_impl.h b/ui/gfx/rect_base_impl.h index d592fde..84caa76 100644 --- a/ui/gfx/rect_base_impl.h +++ b/ui/gfx/rect_base_impl.h @@ -268,7 +268,7 @@ template<typename Class, typename Type> PointClass RectBase<Class, PointClass, SizeClass, InsetsClass, Type>:: CenterPoint() const { - return PointClass(x() + width() / 2, y() + height() / 2); + return PointClass(x() + (width() - 1) / 2, y() + (height() - 1) / 2); } template<typename Class, |