File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed
Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -151,11 +151,13 @@ void BaseButton::_toggled(bool p_pressed) {
151151void BaseButton::on_action_event (Ref<InputEvent> p_event) {
152152 Ref<InputEventMouseButton> mouse_button = p_event;
153153
154- if (!status. pressed_down_with_focus && p_event->is_pressed () && (mouse_button.is_null () || status.hovering )) {
154+ if (p_event->is_pressed () && (mouse_button.is_null () || status.hovering )) {
155155 status.press_attempt = true ;
156156 status.pressing_inside = true ;
157- status.pressed_down_with_focus = true ;
158- emit_signal (SNAME (" button_down" ));
157+ if (!status.pressed_down_with_focus ) {
158+ status.pressed_down_with_focus = true ;
159+ emit_signal (SNAME (" button_down" ));
160+ }
159161 }
160162
161163 if (status.press_attempt && status.pressing_inside ) {
@@ -181,11 +183,13 @@ void BaseButton::on_action_event(Ref<InputEvent> p_event) {
181183 }
182184 }
183185
184- if (status. pressed_down_with_focus && !p_event->is_pressed ()) {
186+ if (!p_event->is_pressed ()) {
185187 status.press_attempt = false ;
186188 status.pressing_inside = false ;
187- status.pressed_down_with_focus = false ;
188- emit_signal (SNAME (" button_up" ));
189+ if (status.pressed_down_with_focus ) {
190+ status.pressed_down_with_focus = false ;
191+ emit_signal (SNAME (" button_up" ));
192+ }
189193 }
190194
191195 queue_redraw ();
You can’t perform that action at this time.
0 commit comments