diff options
author | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-24 16:08:47 +0000 |
---|---|---|
committer | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-24 16:08:47 +0000 |
commit | e2ca8cc8afff4e85bdb090e487c9b1ff70b677c8 (patch) | |
tree | 5986b0f1fd6a317eb41d4d087679e800580db348 /views | |
parent | ea218e8454e5ed8ed09a93f9b5540ee94f734dfc (diff) | |
download | chromium_src-e2ca8cc8afff4e85bdb090e487c9b1ff70b677c8.zip chromium_src-e2ca8cc8afff4e85bdb090e487c9b1ff70b677c8.tar.gz chromium_src-e2ca8cc8afff4e85bdb090e487c9b1ff70b677c8.tar.bz2 |
Fixes rounding bug in transform. This is needed to avoid rounding
something like -.9998 to 0 instead of -1. Without this a transformed
views bounds would end up with an extra scale-1 pixels on the left edge.
BUG=none
TEST=covered by unit test
R=ben@chromium.org,wjmaclean@chromium.org
Review URL: http://codereview.chromium.org/7066010
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@86430 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views')
-rw-r--r-- | views/view_unittest.cc | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/views/view_unittest.cc b/views/view_unittest.cc index 3d12188..5f86edd 100644 --- a/views/view_unittest.cc +++ b/views/view_unittest.cc @@ -1979,6 +1979,15 @@ TEST_F(ViewTest, ConvertPointToViewWithTransform) { EXPECT_EQ(5, point.x()); EXPECT_EQ(5, point.y()); } + + // Conversions from top_view to child with a value that should be negative. + // This ensures we don't round up with negative numbers. + { + gfx::Point point(6, 18); + View::ConvertPointToView(&top_view, child, &point); + EXPECT_EQ(-1, point.x()); + EXPECT_EQ(-1, point.y()); + } } TEST_F(ViewTest, Contains) { |