Fix <rdar://4965715> Horizontal scrollwheel scrolling moves in opposite...
authoraroben <aroben@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 29 Sep 2007 03:58:51 +0000 (03:58 +0000)
committeraroben <aroben@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 29 Sep 2007 03:58:51 +0000 (03:58 +0000)
         Reviewed by Sam.

         No regression test possible.

         * platform/win/WheelEventWin.cpp:
         (WebCore::PlatformWheelEvent::PlatformWheelEvent): Use a negative
         delta when scrolling right to match EventHandler's expectations (which
         are based on AppKit).

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@25803 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog
WebCore/platform/win/WheelEventWin.cpp

index 5659430134db443c317b4b440a71c9a8971465e2..9a99021bdf62f3959a0cbcb71621552323f6fe21 100644 (file)
@@ -1,3 +1,16 @@
+2007-09-29  Adam Roben  <aroben@apple.com>
+
+        Fix <rdar://4965715> Horizontal scrollwheel scrolling moves in opposite direction on Vista
+
+        Reviewed by Sam.
+
+        No regression test possible.
+
+        * platform/win/WheelEventWin.cpp:
+        (WebCore::PlatformWheelEvent::PlatformWheelEvent): Use a negative
+        delta when scrolling right to match EventHandler's expectations (which
+        are based on AppKit).
+
 2007-09-28  Kevin Decker  <kdecker@apple.com>
 
         Reviewed by Mark Rowe
index aeaab6c5ce5d859d1fd9c00df4cfa4ac725bac72..4a6132a1831c676273537cb436b3cf9d7977d04c 100644 (file)
@@ -57,7 +57,10 @@ PlatformWheelEvent::PlatformWheelEvent(HWND hWnd, WPARAM wParam, LPARAM lParam,
 {
     float delta = short(HIWORD(wParam)) / (float)WHEEL_DELTA;
     if (isHorizontal) {
-        m_deltaX = delta;
+        // Windows sends a positive delta for scrolling right, while AppKit
+        // sends a negative delta. EventHandler expects the AppKit values,
+        // so we have to negate our horizontal delta to match.
+        m_deltaX = -delta;
         m_deltaY = 0;
     } else {
         m_deltaX = 0;