summaryrefslogtreecommitdiffstats
path: root/WebCore/platform/mac/WheelEventMac.mm
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore/platform/mac/WheelEventMac.mm')
-rw-r--r--WebCore/platform/mac/WheelEventMac.mm14
1 files changed, 10 insertions, 4 deletions
diff --git a/WebCore/platform/mac/WheelEventMac.mm b/WebCore/platform/mac/WheelEventMac.mm
index 7b60494..5821139 100644
--- a/WebCore/platform/mac/WheelEventMac.mm
+++ b/WebCore/platform/mac/WheelEventMac.mm
@@ -27,6 +27,7 @@
#import "PlatformWheelEvent.h"
#import "PlatformMouseEvent.h"
+#import "Scrollbar.h"
#import "WebCoreSystemInterface.h"
namespace WebCore {
@@ -34,6 +35,7 @@ namespace WebCore {
PlatformWheelEvent::PlatformWheelEvent(NSEvent* event)
: m_position(pointForEvent(event))
, m_globalPosition(globalPointForEvent(event))
+ , m_granularity(ScrollByPixelWheelEvent)
, m_isAccepted(false)
, m_shiftKey([event modifierFlags] & NSShiftKeyMask)
, m_ctrlKey([event modifierFlags] & NSControlKeyMask)
@@ -42,10 +44,14 @@ PlatformWheelEvent::PlatformWheelEvent(NSEvent* event)
{
BOOL continuous;
wkGetWheelEventDeltas(event, &m_deltaX, &m_deltaY, &continuous);
- m_granularity = continuous ? ScrollByPixelWheelEvent : ScrollByLineWheelEvent;
- if (m_granularity == ScrollByLineWheelEvent) {
- m_deltaX *= horizontalLineMultiplier();
- m_deltaY *= verticalLineMultiplier();
+ if (continuous) {
+ m_wheelTicksX = m_deltaX / static_cast<float>(cScrollbarPixelsPerLineStep);
+ m_wheelTicksY = m_deltaY / static_cast<float>(cScrollbarPixelsPerLineStep);
+ } else {
+ m_wheelTicksX = m_deltaX;
+ m_wheelTicksY = m_deltaY;
+ m_deltaX *= static_cast<float>(cScrollbarPixelsPerLineStep);
+ m_deltaY *= static_cast<float>(cScrollbarPixelsPerLineStep);
}
}