Chromium Code Reviews| Index: ui/aura/event.cc |
| diff --git a/ui/aura/event.cc b/ui/aura/event.cc |
| index 8a3bab0f7842004b6908a5f81e18ead4fa3dfa8f..84885f835c6ebf784c01e6637ccb79a75556b218 100644 |
| --- a/ui/aura/event.cc |
| +++ b/ui/aura/event.cc |
| @@ -100,7 +100,7 @@ LocatedEvent::LocatedEvent(const base::NativeEvent& native_event) |
| ui::EventTypeFromNative(native_event), |
| ui::EventFlagsFromNative(native_event)), |
| location_(ui::EventLocationFromNative(native_event)), |
| - root_location_(location_) { |
| + root_location_(ui::EventRootLocationFromNative(native_event)) { |
| } |
| LocatedEvent::LocatedEvent(const LocatedEvent& model, |
| @@ -124,11 +124,14 @@ LocatedEvent::LocatedEvent(ui::EventType type, |
| void LocatedEvent::UpdateForRootTransform(const ui::Transform& root_transform) { |
| // Transform has to be done at root level. |
| - DCHECK_EQ(root_location_.x(), location_.x()); |
| - DCHECK_EQ(root_location_.y(), location_.y()); |
| - gfx::Point3f p(location_); |
| - root_transform.TransformPointReverse(p); |
| - root_location_ = location_ = p.AsPoint(); |
| + if (!root_transform.matrix().isIdentity()) { |
| + // TODO(oshima): This isn't correct with more than two RootWindows. |
|
Daniel Erat
2012/05/09 20:58:27
Not sure I understand this. Should it be "two or
|
| + DCHECK_EQ(root_location_.x(), location_.x()); |
| + DCHECK_EQ(root_location_.y(), location_.y()); |
| + gfx::Point3f p(location_); |
| + root_transform.TransformPointReverse(p); |
| + root_location_ = location_ = p.AsPoint(); |
| + } |
| } |
| MouseEvent::MouseEvent(const base::NativeEvent& native_event) |