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

Unified Diff: webkit/glue/webinputevent_mac.mm

Issue 40241: Convert from line scrolling to pixel scrolling. Increase pixel scroll amount... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 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 | « webkit/glue/webinputevent_linux.cc ('k') | webkit/glue/webinputevent_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/glue/webinputevent_mac.mm
===================================================================
--- webkit/glue/webinputevent_mac.mm (revision 11127)
+++ webkit/glue/webinputevent_mac.mm (working copy)
@@ -35,8 +35,6 @@
#undef LOG
#include "base/logging.h"
-static const unsigned long kDefaultScrollLinesPerWheelDelta = 3;
-
// WebMouseEvent --------------------------------------------------------------
WebMouseEvent::WebMouseEvent(NSEvent *event, NSView* view) {
@@ -136,14 +134,13 @@
x = location.x;
y = [view frame].size.height - location.y; // flip y
- // Convert wheel delta amount to a number of lines to scroll.
+ // Convert wheel delta amount to a number of pixels to scroll.
+ static const float kScrollbarPixelsPerTick = 40.0f;
float wheel_delta = [event deltaY];
- const float delta_lines = wheel_delta * kDefaultScrollLinesPerWheelDelta;
+ const float delta_lines = wheel_delta * kScrollbarPixelsPerTick;
// Set scroll amount based on above calculations.
if ([event modifierFlags] & NSShiftKeyMask) {
- // Scrolling up should move left, scrolling down should move right. This is
- // opposite Safari, but seems more consistent with vertical scrolling.
delta_x = delta_lines;
delta_y = 0;
} else {
« no previous file with comments | « webkit/glue/webinputevent_linux.cc ('k') | webkit/glue/webinputevent_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698