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

Unified Diff: Source/core/dom/WheelEvent.h

Issue 22888005: WheelEvent's deltaX/deltaY sign is wrong (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix comment 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 | « LayoutTests/fast/events/wheelevent-basic.html ('k') | Source/core/dom/WheelEvent.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/WheelEvent.h
diff --git a/Source/core/dom/WheelEvent.h b/Source/core/dom/WheelEvent.h
index ea2e81c8fe9d3851529450e4d6684faafb44711d..870c9b648736fefe18a7bdd9870709d3d4e90f1f 100644
--- a/Source/core/dom/WheelEvent.h
+++ b/Source/core/dom/WheelEvent.h
@@ -81,12 +81,12 @@ public:
int screenX, int screenY, int pageX, int pageY,
bool ctrlKey, bool altKey, bool shiftKey, bool metaKey);
- double deltaX() const { return m_deltaX; }
- double deltaY() const { return m_deltaY; }
+ double deltaX() const { return m_deltaX; } // Positive when scrolling right.
+ double deltaY() const { return m_deltaY; } // Positive when scrolling down.
double deltaZ() const { return m_deltaZ; }
- int wheelDelta() const { return m_deltaY ? m_deltaY : m_deltaX; } // Deprecated.
- int wheelDeltaX() const { return m_deltaX; } // Deprecated.
- int wheelDeltaY() const { return m_deltaY; } // Deprecated.
+ int wheelDelta() const { return wheelDeltaY() ? wheelDeltaY() : wheelDeltaX(); } // Deprecated.
+ int wheelDeltaX() const { return -m_deltaX; } // Deprecated, negative when scrolling right.
+ int wheelDeltaY() const { return -m_deltaY; } // Deprecated, negative when scrolling down.
int rawDeltaX() const { return m_rawDelta.x(); }
int rawDeltaY() const { return m_rawDelta.y(); }
unsigned deltaMode() const { return m_deltaMode; }
« no previous file with comments | « LayoutTests/fast/events/wheelevent-basic.html ('k') | Source/core/dom/WheelEvent.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698