From ae0847cecbac76c7c7901ab76824a91c29b7329e Mon Sep 17 00:00:00 2001 From: Henrik Rydgard Date: Tue, 20 Aug 2013 15:30:47 +0200 Subject: [PATCH] Stop inertia-scrolling when switching away from a tab. --- ui/viewgroup.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ui/viewgroup.cpp b/ui/viewgroup.cpp index b3519ea33c..4d7dba3f2d 100644 --- a/ui/viewgroup.cpp +++ b/ui/viewgroup.cpp @@ -663,6 +663,9 @@ bool ScrollView::CanScroll() const { } void ScrollView::Update(const InputState &input_state) { + if (visibility_ != V_VISIBLE) { + inertia_ = 0.0f; + } ViewGroup::Update(input_state); gesture_.UpdateFrame(); if (scrollToTarget_) {