File tree 1 file changed +10
-6
lines changed
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) {
151
151
void BaseButton::on_action_event (Ref<InputEvent> p_event) {
152
152
Ref<InputEventMouseButton> mouse_button = p_event;
153
153
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 )) {
155
155
status.press_attempt = true ;
156
156
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
+ }
159
161
}
160
162
161
163
if (status.press_attempt && status.pressing_inside ) {
@@ -181,11 +183,13 @@ void BaseButton::on_action_event(Ref<InputEvent> p_event) {
181
183
}
182
184
}
183
185
184
- if (status. pressed_down_with_focus && !p_event->is_pressed ()) {
186
+ if (!p_event->is_pressed ()) {
185
187
status.press_attempt = false ;
186
188
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
+ }
189
193
}
190
194
191
195
queue_redraw ();
You can’t perform that action at this time.
0 commit comments