diff --git a/Common/Input/GestureDetector.cpp b/Common/Input/GestureDetector.cpp index cab29e1b1a..634f8b25d2 100644 --- a/Common/Input/GestureDetector.cpp +++ b/Common/Input/GestureDetector.cpp @@ -48,7 +48,7 @@ TouchInput GestureDetector::Update(const TouchInput &touch, const Bounds &bounds double timeDown = time_now_d() - p.downTime; if (!p.active && p.distanceY * timeDown > 3) { p.active |= GESTURE_DRAG_VERTICAL; - // Kill the drag + // Kill the drag. TODO: Only cancel the drag in one direction. TouchInput inp2 = touch; inp2.flags = TOUCH_UP | TOUCH_CANCEL; return inp2; @@ -63,7 +63,7 @@ TouchInput GestureDetector::Update(const TouchInput &touch, const Bounds &bounds double timeDown = time_now_d() - p.downTime; if (!p.active && p.distanceX * timeDown > 3) { p.active |= GESTURE_DRAG_HORIZONTAL; - // Kill the drag + // Kill the drag. TODO: Only cancel the drag in one direction. TouchInput inp2 = touch; inp2.flags = TOUCH_UP | TOUCH_CANCEL; return inp2; diff --git a/Common/UI/UIScreen.cpp b/Common/UI/UIScreen.cpp index a412df9abb..78f9231ea8 100644 --- a/Common/UI/UIScreen.cpp +++ b/Common/UI/UIScreen.cpp @@ -228,12 +228,15 @@ PopupScreen::PopupScreen(std::string title, std::string button1, std::string but void PopupScreen::touch(const TouchInput &touch) { if (!box_ || (touch.flags & TOUCH_DOWN) == 0) { + // Handle down-presses here. UIDialogScreen::touch(touch); + return; } // Extra bounds to avoid closing the dialog while trying to aim for something - // near the edge. - if (!box_->GetBounds().Expand(100.0f, 60.0f).Contains(touch.x, touch.y)) { + // near the edge. Now that we only close on actual down-events, we can shrink + // this border a bit. + if (!box_->GetBounds().Expand(30.0f, 30.0f).Contains(touch.x, touch.y)) { TriggerFinish(DR_CANCEL); }