From e1ef359e8015d455d96f81e4b71286d0f7e5c12d Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Tue, 14 Mar 2017 22:03:09 -0700 Subject: [PATCH] Remove unused drag capture state tracking. --- ext/native/ui/viewgroup.cpp | 20 ++------------------ ext/native/ui/viewgroup.h | 4 ---- 2 files changed, 2 insertions(+), 22 deletions(-) diff --git a/ext/native/ui/viewgroup.cpp b/ext/native/ui/viewgroup.cpp index 3b7f2a61db..583a4fbadb 100644 --- a/ext/native/ui/viewgroup.cpp +++ b/ext/native/ui/viewgroup.cpp @@ -21,22 +21,6 @@ static std::mutex focusLock; static std::vector focusMoves; extern bool focusForced; -// TODO: Seems like this drag stuff is no longer used. -#define MAX_POINTERS 10 -bool dragCaptured[MAX_POINTERS]; - -void CaptureDrag(int id) { - dragCaptured[id] = true; -} - -void ReleaseDrag(int id) { - dragCaptured[id] = false; -} - -bool IsDragCaptured(int id) { - return dragCaptured[id]; -} - void ApplyGravity(const Bounds outer, const Margins &margins, float w, float h, int gravity, Bounds &inner) { inner.w = w; inner.h = h; @@ -753,13 +737,13 @@ void ScrollView::Touch(const TouchInput &input) { if (input.flags & TOUCH_UP) { float info[4]; - if (!IsDragCaptured(input.id) && gesture_.GetGestureInfo(gesture, info)) { + if (gesture_.GetGestureInfo(gesture, info)) { inertia_ = info[1]; } } TouchInput input2; - if (CanScroll() && !IsDragCaptured(input.id)) { + if (CanScroll()) { input2 = gesture_.Update(input, bounds_); float info[4]; if (gesture_.GetGestureInfo(gesture, info) && !(input.flags & TOUCH_DOWN)) { diff --git a/ext/native/ui/viewgroup.h b/ext/native/ui/viewgroup.h index 386400a99e..5d6429bcea 100644 --- a/ext/native/ui/viewgroup.h +++ b/ext/native/ui/viewgroup.h @@ -414,8 +414,4 @@ bool KeyEvent(const KeyInput &key, ViewGroup *root); bool TouchEvent(const TouchInput &touch, ViewGroup *root); bool AxisEvent(const AxisInput &axis, ViewGroup *root); -void CaptureDrag(int id); -void ReleaseDrag(int id); -bool IsDragCaptured(int id); - } // namespace UI