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

Unified Diff: content/browser/renderer_host/input/web_input_event_builders_win.cc

Issue 23532015: Fix scroll_delta computation on windows for vertical scroll by page (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 4 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: content/browser/renderer_host/input/web_input_event_builders_win.cc
diff --git a/content/browser/renderer_host/input/web_input_event_builders_win.cc b/content/browser/renderer_host/input/web_input_event_builders_win.cc
index a5a9b20f6154b8c51dfa04832baef13838967116..ba081fd429ba2fa2babc67ba68938f3e25cf17bc 100644
--- a/content/browser/renderer_host/input/web_input_event_builders_win.cc
+++ b/content/browser/renderer_host/input/web_input_event_builders_win.cc
@@ -428,20 +428,22 @@ WebMouseWheelEventBuilder::Build(HWND hwnd, UINT message,
// reading articles.
static const float kScrollbarPixelsPerLine = 100.0f / 3.0f;
wheel_delta /= WHEEL_DELTA;
- float scroll_delta = wheel_delta * kScrollbarPixelsPerLine;
+ float scroll_delta = wheel_delta;
if (horizontal_scroll) {
unsigned long scroll_chars = kDefaultScrollCharsPerWheelDelta;
SystemParametersInfo(SPI_GETWHEELSCROLLCHARS, 0, &scroll_chars, 0);
// TODO(pkasting): Should probably have a different multiplier
// scrollbarPixelsPerChar here.
- scroll_delta *= static_cast<float>(scroll_chars);
+ scroll_delta *= static_cast<float>(scroll_chars) * kScrollbarPixelsPerLine;
} else {
unsigned long scroll_lines = kDefaultScrollLinesPerWheelDelta;
SystemParametersInfo(SPI_GETWHEELSCROLLLINES, 0, &scroll_lines, 0);
if (scroll_lines == WHEEL_PAGESCROLL)
result.scrollByPage = true;
- if (!result.scrollByPage)
- scroll_delta *= static_cast<float>(scroll_lines);
+ if (!result.scrollByPage) {
+ scroll_delta *=
+ static_cast<float>(scroll_lines) * kScrollbarPixelsPerLine;
+ }
}
// Set scroll amount based on above calculations. WebKit expects positive
« 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