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

Unified Diff: ash/display/event_transformation_handler.cc

Issue 23452037: Do not scale ScrollEvent by device scale factor (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Update the comment Created 7 years, 3 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/display/event_transformation_handler.cc
diff --git a/ash/display/event_transformation_handler.cc b/ash/display/event_transformation_handler.cc
index cb33891edf6bbd8261898723976780e840903dce..5f25e145c41401a43d22757fbfa6cc5a8dbf0c74 100644
--- a/ash/display/event_transformation_handler.cc
+++ b/ash/display/event_transformation_handler.cc
@@ -40,20 +40,17 @@ void EventTransformationHandler::OnScrollEvent(ui::ScrollEvent* event) {
if (transformation_mode_ == TRANSFORM_NONE)
return;
- // Get the device scale factor and stack it on the final scale factor.
+ // It is unnecessary to scale the event for the device scale factor since
+ // the event locations etc. are already in DIP.
gfx::Point point_in_screen(event->location());
aura::Window* target = static_cast<aura::Window*>(event->target());
- const float scale_at_target = ui::GetDeviceScaleFactor(target->layer());
- float scale = scale_at_target;
-
- // Apply some additional scaling if the display is non-integrated.
wm::ConvertPointToScreen(target, &point_in_screen);
const gfx::Display& display =
Shell::GetScreen()->GetDisplayNearestPoint(point_in_screen);
- if (!display.IsInternal())
- scale *= kBoostForNonIntegrated;
- event->Scale(scale);
+ // Apply some additional scaling if the display is non-integrated.
+ if (!display.IsInternal())
+ event->Scale(kBoostForNonIntegrated);
}
#if defined(OS_CHROMEOS)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698