From dcf5be92a3aede861909c08d06b114669bbe75e8 Mon Sep 17 00:00:00 2001 From: Ruslan Mustakov Date: Tue, 27 Feb 2018 22:37:20 +0700 Subject: Make BaseButton not emit press when container is scrolled This fixes the problem described in #13996 in a proper way. This also adds "deadzone" property to ScrollContainer. It can be used on mobile, where taps are not as precise as mouse clicks. Player could slightly move their finger when tapping, in which case we still want the button to be pressed rather than the container to be scrolled. --- scene/gui/control.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'scene/gui/control.cpp') diff --git a/scene/gui/control.cpp b/scene/gui/control.cpp index a5883863c..d1244bebf 100644 --- a/scene/gui/control.cpp +++ b/scene/gui/control.cpp @@ -2886,6 +2886,8 @@ void Control::_bind_methods() { BIND_CONSTANT(NOTIFICATION_FOCUS_EXIT); BIND_CONSTANT(NOTIFICATION_THEME_CHANGED); BIND_CONSTANT(NOTIFICATION_MODAL_CLOSE); + BIND_CONSTANT(NOTIFICATION_SCROLL_BEGIN); + BIND_CONSTANT(NOTIFICATION_SCROLL_END); BIND_ENUM_CONSTANT(CURSOR_ARROW); BIND_ENUM_CONSTANT(CURSOR_IBEAM); -- cgit v1.2.3-70-g09d2