summaryrefslogtreecommitdiffstats
path: root/webkit/glue/event_conversion.cc
diff options
context:
space:
mode:
authorpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-05 01:59:56 +0000
committerpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-05 01:59:56 +0000
commitdf813ac7b79f6c935df34dc82d8d6018d0a3d032 (patch)
tree53dca8daa1bb20a8a4b6b8e21ed4abd77c7b6a07 /webkit/glue/event_conversion.cc
parent28ffe87d1aedc84f67c54b79ec1843cab237c9ff (diff)
downloadchromium_src-df813ac7b79f6c935df34dc82d8d6018d0a3d032.zip
chromium_src-df813ac7b79f6c935df34dc82d8d6018d0a3d032.tar.gz
chromium_src-df813ac7b79f6c935df34dc82d8d6018d0a3d032.tar.bz2
Various fixes to mouse wheel scrolling:
* Now that WebCore uses floating-point scroll deltas, eliminate complicated carryover code and just use simple floating-point arithmetic when calculating scroll delta. * Now that WebCore supports scrolling by page, plumb this instead of using a hacky "10 times the normal scroll amount" constant. * Don't pretend shift was down when it wasn't (e.g. WM_MOUSEHWHEEL). * Use SPI_GETWHEELSCROLLCHARS for horizontal scrolling, per MSDN. * Fix horizontal scrolling to be "scroll down to go right" as the comment said (behavior was backwards) * Clean up code. * Reorder Mac/Linux code to match Windows code ordering. Review URL: http://codereview.chromium.org/40135 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10959 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/event_conversion.cc')
-rw-r--r--webkit/glue/event_conversion.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/webkit/glue/event_conversion.cc b/webkit/glue/event_conversion.cc
index 39cdc90..548bfa5 100644
--- a/webkit/glue/event_conversion.cc
+++ b/webkit/glue/event_conversion.cc
@@ -123,10 +123,11 @@ MakePlatformWheelEvent::MakePlatformWheelEvent(Widget* widget,
const WebMouseWheelEvent& e) {
m_position = widget->convertFromContainingWindow(IntPoint(e.x, e.y));
m_globalPosition = IntPoint(e.global_x, e.global_y);
- m_deltaX = static_cast<float>(e.delta_x);
- m_deltaY = static_cast<float>(e.delta_y);
+ m_deltaX = e.delta_x;
+ m_deltaY = e.delta_y;
m_isAccepted = false;
- m_granularity = ScrollByLineWheelEvent;
+ m_granularity = e.scroll_by_page ?
+ ScrollByPageWheelEvent : ScrollByLineWheelEvent;
m_shiftKey = (e.modifiers & WebInputEvent::SHIFT_KEY) != 0;
m_ctrlKey = (e.modifiers & WebInputEvent::CTRL_KEY) != 0;
m_altKey = (e.modifiers & WebInputEvent::ALT_KEY) != 0;