1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-18 14:21:41 +00:00

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.
This commit is contained in:
Ruslan Mustakov
2018-02-27 22:37:20 +07:00
parent 47676cfa98
commit dcf5be92a3
5 changed files with 60 additions and 24 deletions

View File

@@ -247,7 +247,7 @@ void BaseButton::_notification(int p_what) {
status.hovering = false;
update();
}
if (p_what == NOTIFICATION_DRAG_BEGIN) {
if (p_what == NOTIFICATION_DRAG_BEGIN || p_what == NOTIFICATION_SCROLL_BEGIN) {
if (status.press_attempt) {
status.press_attempt = false;