From 0e4a73604ba8ce6c8983bccdcd1c216945d1bd2f Mon Sep 17 00:00:00 2001 From: dmx Date: Sun, 14 Apr 2019 10:09:06 +0800 Subject: [PATCH] ScrollPane: dispatchEvent ScrollEnd event when no need to runTween --- libfairygui/Classes/ScrollPane.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libfairygui/Classes/ScrollPane.cpp b/libfairygui/Classes/ScrollPane.cpp index fc4c897..20778fc 100644 --- a/libfairygui/Classes/ScrollPane.cpp +++ b/libfairygui/Classes/ScrollPane.cpp @@ -1730,8 +1730,10 @@ void ScrollPane::onTouchEnd(EventContext * context) alignPosition(endPos, true); _tweenChange = endPos - _tweenStart; - if (_tweenChange.x == 0 && _tweenChange.y == 0) + if (_tweenChange.x == 0 && _tweenChange.y == 0) { + _owner->dispatchEvent(UIEventType::ScrollEnd); return; + } if (_pageMode || _snapToItem) { @@ -1779,4 +1781,4 @@ void ScrollPane::onRollOut(EventContext * context) showScrollBar(false); } -NS_FGUI_END \ No newline at end of file +NS_FGUI_END