Use != 0 instead of > 0 when checking bit mask.
This commit is contained in:
parent
753b2bd010
commit
f515e72348
@ -60,7 +60,7 @@ void BaseButton::_gui_input(Ref<InputEvent> p_event) {
|
||||
Ref<InputEventMouseButton> mouse_button = p_event;
|
||||
bool ui_accept = p_event->is_action("ui_accept") && !p_event->is_echo();
|
||||
|
||||
bool button_masked = mouse_button.is_valid() && ((1 << (mouse_button->get_button_index() - 1)) & button_mask) > 0;
|
||||
bool button_masked = mouse_button.is_valid() && ((1 << (mouse_button->get_button_index() - 1)) & button_mask) != 0;
|
||||
if (button_masked || ui_accept) {
|
||||
on_action_event(p_event);
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user