mirror of
https://github.com/godotengine/godot.git
synced 2025-12-08 06:09:55 +00:00
Make BaseButton not emit press when container is scrolled [2.1]
This fixes the problem described in #13996 in a proper way.
This also adds "deadzone" property to ScrollContainer.
It can be usedon mobile, where taps are not as precise as mouse clicks.
Player couldslightly move their finger when tapping, in which case we still wantthe button to be pressed rather than the container to be scrolled.
(cherry picked from commit dcf5be9)
This commit is contained in:
parent
241ca9624e
commit
37c43154fe
5 changed files with 59 additions and 24 deletions
|
|
@ -225,7 +225,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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue