Преглед на файлове

Fix GridMap still drawing when Alt+Tabbing

(cherry picked from commit 9fbef6f7db4ed8fc1d3767ffb4d856401b5bd339)
kobewi преди 4 години
родител
ревизия
dac54b6db3
променени са 1 файла, в които са добавени 10 реда и са изтрити 0 реда
  1. 10 0
      modules/gridmap/grid_map_editor_plugin.cpp

+ 10 - 0
modules/gridmap/grid_map_editor_plugin.cpp

@@ -1098,6 +1098,16 @@ void GridMapEditor::_notification(int p_what) {
 			options->set_icon(get_icon("GridMap", "EditorIcons"));
 			search_box->set_right_icon(get_icon("Search", "EditorIcons"));
 		} break;
+
+		case NOTIFICATION_WM_FOCUS_OUT: {
+			if (input_action == INPUT_PAINT) {
+				// Simulate mouse released event to stop drawing when editor focus exists.
+				Ref<InputEventMouseButton> release;
+				release.instance();
+				release->set_button_index(BUTTON_LEFT);
+				forward_spatial_input_event(nullptr, release);
+			}
+		} break;
 	}
 }