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

Unified Diff: ui/base/events/event.cc

Issue 12321090: events: Make sure the unaccelerated scroll deltas get adjusted properly for device-scale-factor. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years, 10 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/base/events/event.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/events/event.cc
diff --git a/ui/base/events/event.cc b/ui/base/events/event.cc
index 079e5f7fa9f1baf0c56c1029d0f8ca4967dbde66..ad26a24744d63245cdbe49a6a02a171991f8541f 100644
--- a/ui/base/events/event.cc
+++ b/ui/base/events/event.cc
@@ -679,6 +679,17 @@ void ScrollEvent::Scale(const float factor) {
y_offset_ordinal_ *= factor;
}
+void ScrollEvent::UpdateForRootTransform(const gfx::Transform& root_transform) {
+ LocatedEvent::UpdateForRootTransform(root_transform);
+ gfx::DecomposedTransform decomp;
+ bool success = gfx::DecomposeTransform(&decomp, root_transform);
+ DCHECK(success);
+ if (decomp.scale[0])
+ x_offset_ordinal_ /= decomp.scale[0];
+ if (decomp.scale[1])
+ y_offset_ordinal_ /= decomp.scale[1];
+}
+
////////////////////////////////////////////////////////////////////////////////
// GestureEvent
« no previous file with comments | « ui/base/events/event.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698