本文整理汇总了C++中PlatformWheelEvent::copyIgnoringVerticalDelta方法的典型用法代码示例。如果您正苦于以下问题:C++ PlatformWheelEvent::copyIgnoringVerticalDelta方法的具体用法?C++ PlatformWheelEvent::copyIgnoringVerticalDelta怎么用?C++ PlatformWheelEvent::copyIgnoringVerticalDelta使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PlatformWheelEvent
的用法示例。
在下文中一共展示了PlatformWheelEvent::copyIgnoringVerticalDelta方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: wheelEvent
void EventDispatcher::wheelEvent(uint64_t pageID, const WebWheelEvent& wheelEvent, bool canRubberBandAtLeft, bool canRubberBandAtRight, bool canRubberBandAtTop, bool canRubberBandAtBottom)
{
PlatformWheelEvent platformWheelEvent = platform(wheelEvent);
#if PLATFORM(COCOA)
switch (wheelEvent.phase()) {
case PlatformWheelEventPhaseBegan:
m_recentWheelEventDeltaTracker->beginTrackingDeltas();
break;
case PlatformWheelEventPhaseEnded:
m_recentWheelEventDeltaTracker->endTrackingDeltas();
break;
default:
break;
}
if (m_recentWheelEventDeltaTracker->isTrackingDeltas()) {
m_recentWheelEventDeltaTracker->recordWheelEventDelta(platformWheelEvent);
DominantScrollGestureDirection dominantDirection = DominantScrollGestureDirection::None;
dominantDirection = m_recentWheelEventDeltaTracker->dominantScrollGestureDirection();
// Workaround for scrolling issues <rdar://problem/14758615>.
if (dominantDirection == DominantScrollGestureDirection::Vertical && platformWheelEvent.deltaX())
platformWheelEvent = platformWheelEvent.copyIgnoringHorizontalDelta();
else if (dominantDirection == DominantScrollGestureDirection::Horizontal && platformWheelEvent.deltaY())
platformWheelEvent = platformWheelEvent.copyIgnoringVerticalDelta();
}
#endif
#if ENABLE(ASYNC_SCROLLING)
MutexLocker locker(m_scrollingTreesMutex);
if (ThreadedScrollingTree* scrollingTree = m_scrollingTrees.get(pageID)) {
// FIXME: It's pretty horrible that we're updating the back/forward state here.
// WebCore should always know the current state and know when it changes so the
// scrolling tree can be notified.
// We only need to do this at the beginning of the gesture.
if (platformWheelEvent.phase() == PlatformWheelEventPhaseBegan)
ScrollingThread::dispatch(bind(&ThreadedScrollingTree::setCanRubberBandState, scrollingTree, canRubberBandAtLeft, canRubberBandAtRight, canRubberBandAtTop, canRubberBandAtBottom));
ScrollingTree::EventResult result = scrollingTree->tryToHandleWheelEvent(platformWheelEvent);
if (result == ScrollingTree::DidHandleEvent || result == ScrollingTree::DidNotHandleEvent) {
sendDidReceiveEvent(pageID, wheelEvent, result == ScrollingTree::DidHandleEvent);
return;
}
}
#else
UNUSED_PARAM(canRubberBandAtLeft);
UNUSED_PARAM(canRubberBandAtRight);
UNUSED_PARAM(canRubberBandAtTop);
UNUSED_PARAM(canRubberBandAtBottom);
#endif
RunLoop::main().dispatch(bind(&EventDispatcher::dispatchWheelEvent, this, pageID, wheelEvent));
}