Stop drag actions in the TileMapLayer and GridMap editors when focus is lost
This commit is contained in:
parent
778cf54dab
commit
bbacc674b8
2 changed files with 10 additions and 2 deletions
|
|
@ -3742,6 +3742,14 @@ void TileMapLayerEditor::_notification(int p_what) {
|
|||
toggle_highlight_selected_layer_button->set_pressed_no_signal(EDITOR_GET("editors/tiles_editor/highlight_selected_layer"));
|
||||
}
|
||||
} break;
|
||||
|
||||
case NOTIFICATION_APPLICATION_FOCUS_OUT: {
|
||||
// Simulate mouse released event to stop drawing when editor focus exits.
|
||||
Ref<InputEventMouseButton> release;
|
||||
release.instantiate();
|
||||
release->set_button_index(MouseButton::LEFT);
|
||||
forward_canvas_gui_input(release);
|
||||
} break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1334,8 +1334,8 @@ void GridMapEditor::_notification(int p_what) {
|
|||
} break;
|
||||
|
||||
case NOTIFICATION_APPLICATION_FOCUS_OUT: {
|
||||
if (input_action == INPUT_PAINT) {
|
||||
// Simulate mouse released event to stop drawing when editor focus exists.
|
||||
if (input_action == INPUT_PAINT || input_action == INPUT_ERASE || input_action == INPUT_SELECT) {
|
||||
// Simulate mouse released event to stop drawing when editor focus exits.
|
||||
Ref<InputEventMouseButton> release;
|
||||
release.instantiate();
|
||||
release->set_button_index(MouseButton::LEFT);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue