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:
@ -56,10 +56,13 @@ class ScrollContainer : public Container {
|
||||
bool drag_touching;
|
||||
bool drag_touching_deaccel;
|
||||
bool click_handled;
|
||||
bool beyond_deadzone;
|
||||
|
||||
bool scroll_h;
|
||||
bool scroll_v;
|
||||
|
||||
int deadzone;
|
||||
|
||||
void _cancel_drag();
|
||||
|
||||
protected:
|
||||
@ -86,6 +89,9 @@ public:
|
||||
void set_enable_v_scroll(bool p_enable);
|
||||
bool is_v_scroll_enabled() const;
|
||||
|
||||
int get_deadzone() const;
|
||||
void set_deadzone(int p_deadzone);
|
||||
|
||||
virtual bool clips_input() const;
|
||||
|
||||
virtual String get_configuration_warning() const;
|
||||
|
||||
Reference in New Issue
Block a user