summaryrefslogtreecommitdiffstats
path: root/ui/base
diff options
context:
space:
mode:
authoroshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-14 22:42:11 +0000
committeroshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-14 22:42:11 +0000
commitab254696bbf9608710cb64e432457dbb4bf1ef63 (patch)
tree4c8efddbf9fb6d9136c77790482da1d255c5566e /ui/base
parent5d6f2d1c2e7495b6880c37bafbb87aa36f68535f (diff)
downloadchromium_src-ab254696bbf9608710cb64e432457dbb4bf1ef63.zip
chromium_src-ab254696bbf9608710cb64e432457dbb4bf1ef63.tar.gz
chromium_src-ab254696bbf9608710cb64e432457dbb4bf1ef63.tar.bz2
Fix translate amount when rotated.
The origin starts at (0, 0), so the actual amount to translate is width-1/height-1. Use ToRoundedPoint to convert translated point as translation can convert to negative side by small margin. (like -0.000001, which becomes -1 instead of 0) R=jamescook@chromium.org BUG=119268 TEST=updated the test. Review URL: https://codereview.chromium.org/12844004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@188220 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/base')
-rw-r--r--ui/base/events/event.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/ui/base/events/event.cc b/ui/base/events/event.cc
index f29e84e..9588076 100644
--- a/ui/base/events/event.cc
+++ b/ui/base/events/event.cc
@@ -273,7 +273,8 @@ void LocatedEvent::UpdateForRootTransform(
// Transform has to be done at root level.
gfx::Point3F p(location_);
root_transform.TransformPointReverse(p);
- root_location_ = location_ = gfx::ToFlooredPoint(p.AsPointF());
+ // Use ToRoundedPoint so that the value -0.00001 becomes 0.
+ root_location_ = location_ = gfx::ToRoundedPoint(p.AsPointF());
}
////////////////////////////////////////////////////////////////////////////////