Fix <rdar://problem/
5169261>
REGRESSION: Google Maps zooming too sensitive when using two fingers on trackpad
Use line based delta values when generating DOM wheel events, use pixel deltas
for scrolling only.
No test case, requires user interaction and specific hardware.
* page/EventHandler.cpp:
(WebCore::EventHandler::handleWheelEvent):
* platform/PlatformWheelEvent.h:
(WebCore::PlatformWheelEvent::continuousDeltaX):
(WebCore::PlatformWheelEvent::continuousDeltaY):
* platform/mac/WheelEventMac.mm:
(WebCore::PlatformWheelEvent::PlatformWheelEvent):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@21188
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2007-04-29 Antti Koivisto <antti@apple.com>
+
+ Reviewed by Oliver.
+
+ Fix <rdar://problem/5169261>
+ REGRESSION: Google Maps zooming too sensitive when using two fingers on trackpad
+
+ Use line based delta values when generating DOM wheel events, use pixel deltas
+ for scrolling only.
+
+ No test case, requires user interaction and specific hardware.
+
+ * page/EventHandler.cpp:
+ (WebCore::EventHandler::handleWheelEvent):
+ * platform/PlatformWheelEvent.h:
+ (WebCore::PlatformWheelEvent::continuousDeltaX):
+ (WebCore::PlatformWheelEvent::continuousDeltaY):
+ * platform/mac/WheelEventMac.mm:
+ (WebCore::PlatformWheelEvent::PlatformWheelEvent):
+
2007-04-29 Oliver Hunt <oliver@apple.com>
Reviewed by Brady.
if (node->renderer()) {
// Just break up into two scrolls if we need to. Diagonal movement on
// a MacBook pro is an example of a 2-dimensional mouse wheel event (where both deltaX and deltaY can be set).
- if (e.deltaX() && node->renderer()->scroll(e.deltaX() < 0 ? ScrollRight : ScrollLeft, e.isContinuous() ? ScrollByPixel : ScrollByLine,
- e.deltaX() < 0 ? -e.deltaX() : e.deltaX()))
+ float deltaX = e.isContinuous() ? e.continuousDeltaX() : e.deltaX();
+ float deltaY = e.isContinuous() ? e.continuousDeltaY() : e.deltaY();
+ if (deltaX && node->renderer()->scroll(deltaX < 0 ? ScrollRight : ScrollLeft, e.isContinuous() ? ScrollByPixel : ScrollByLine,
+ deltaX < 0 ? -deltaX : deltaX))
e.accept();
- if (e.deltaY() && node->renderer()->scroll(e.deltaY() < 0 ? ScrollDown : ScrollUp, e.isContinuous() ? ScrollByPixel : ScrollByLine,
- e.deltaY() < 0 ? -e.deltaY() : e.deltaY()))
+ if (deltaY && node->renderer()->scroll(deltaY < 0 ? ScrollDown : ScrollUp, e.isContinuous() ? ScrollByPixel : ScrollByLine,
+ deltaY < 0 ? -deltaY : deltaY))
e.accept();
}
}
void ignore() { m_isAccepted = false; }
bool isContinuous() const { return m_isContinuous; }
+ float continuousDeltaX() const { return m_continuousDeltaX; }
+ float continuousDeltaY() const { return m_continuousDeltaY; }
#if PLATFORM(MAC)
PlatformWheelEvent(NSEvent*);
bool m_altKey;
bool m_metaKey;
bool m_isContinuous;
+ float m_continuousDeltaX;
+ float m_continuousDeltaY;
};
} // namespace WebCore
PlatformWheelEvent::PlatformWheelEvent(NSEvent* event)
: m_position(pointForEvent(event))
, m_globalPosition(globalPointForEvent(event))
+ , m_deltaX([event deltaX])
+ , m_deltaY([event deltaY])
, m_isAccepted(false)
, m_shiftKey([event modifierFlags] & NSShiftKeyMask)
, m_ctrlKey([event modifierFlags] & NSControlKeyMask)
, m_metaKey([event modifierFlags] & NSCommandKeyMask)
{
BOOL continuous;
- wkGetWheelEventDeltas(event, &m_deltaX, &m_deltaY, &continuous);
+ wkGetWheelEventDeltas(event, &m_continuousDeltaX, &m_continuousDeltaY, &continuous);
m_isContinuous = continuous;
}