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

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

Issue 23034006: WheelEvent's deltaX/deltaY should report real amount of pixels scrolled (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: No Change 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-expected.txt ('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 870c9b648736fefe18a7bdd9870709d3d4e90f1f..c393f373b15d202736dfefe6f34c28777892f5d2 100644
--- a/Source/core/dom/WheelEvent.h
+++ b/Source/core/dom/WheelEvent.h
@@ -85,11 +85,11 @@ public:
double deltaY() const { return m_deltaY; } // Positive when scrolling down.
double deltaZ() const { return m_deltaZ; }
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(); }
+ int wheelDeltaX() const { return m_wheelDelta.x(); } // Deprecated, negative when scrolling right.
+ int wheelDeltaY() const { return m_wheelDelta.y(); } // Deprecated, negative when scrolling down.
unsigned deltaMode() const { return m_deltaMode; }
+ float ticksX() const { return static_cast<float>(m_wheelDelta.x()) / TickMultiplier; }
+ float ticksY() const { return static_cast<float>(m_wheelDelta.y()) / TickMultiplier; }
bool webkitDirectionInvertedFromDevice() const { return m_directionInvertedFromDevice; }
@@ -103,10 +103,10 @@ private:
unsigned, PassRefPtr<AbstractView>, const IntPoint& screenLocation, const IntPoint& pageLocation,
bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, bool directionInvertedFromDevice);
+ IntPoint m_wheelDelta;
double m_deltaX;
double m_deltaY;
double m_deltaZ;
- IntPoint m_rawDelta;
unsigned m_deltaMode;
bool m_directionInvertedFromDevice;
};
« no previous file with comments | « LayoutTests/fast/events/wheelevent-basic-expected.txt ('k') | Source/core/dom/WheelEvent.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698