Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(123)

Unified Diff: ui/events/event.cc

Issue 1906603002: mus: Fix event transformation in client code. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/aura/window_event_dispatcher.cc ('k') | ui/events/event_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/events/event.cc
diff --git a/ui/events/event.cc b/ui/events/event.cc
index 7753a8af74eac39b3dbc73dafb8510df33a8949d..6541415d9524065c674e3516fc65d807e906f21f 100644
--- a/ui/events/event.cc
+++ b/ui/events/event.cc
@@ -444,10 +444,20 @@ LocatedEvent::LocatedEvent(EventType type,
void LocatedEvent::UpdateForRootTransform(
const gfx::Transform& reversed_root_transform) {
// Transform has to be done at root level.
+ bool locations_equal = location_ == root_location_;
gfx::Point3F p(location_);
reversed_root_transform.TransformPoint(&p);
location_ = p.AsPointF();
- root_location_ = location_;
+ if (locations_equal) {
+ root_location_ = location_;
+ LOG(ERROR) << name() << " Set to " << root_location_.ToString();
+ } else {
+ p = gfx::Point3F(root_location_);
+ reversed_root_transform.TransformPoint(&p);
+ root_location_ = p.AsPointF();
+ LOG(ERROR) << name() << " Set to " << root_location_.ToString()
+ << " instead of " << location_.ToString();
+ }
}
////////////////////////////////////////////////////////////////////////////////
« no previous file with comments | « ui/aura/window_event_dispatcher.cc ('k') | ui/events/event_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698