diff options
| author | Tomasz Chabora <kobewi4e@gmail.com> | 2019-08-21 15:34:06 +0200 |
|---|---|---|
| committer | Tomasz Chabora <kobewi4e@gmail.com> | 2019-08-21 20:56:15 +0200 |
| commit | 9520d9706aa2ea985e3542f77adea623fa408f14 (patch) | |
| tree | 2557e61f51f0d75366fb6db4f4116c70dda5883c /editor/plugins/tile_map_editor_plugin.cpp | |
| parent | 48eaf14030f315a915cece0d33c190c28561ca01 (diff) | |
| download | redot-engine-9520d9706aa2ea985e3542f77adea623fa408f14.tar.gz | |
Edit TileMap only with TOOL_SELECT
Diffstat (limited to 'editor/plugins/tile_map_editor_plugin.cpp')
| -rw-r--r-- | editor/plugins/tile_map_editor_plugin.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/editor/plugins/tile_map_editor_plugin.cpp b/editor/plugins/tile_map_editor_plugin.cpp index b4cce9745e..26fae96025 100644 --- a/editor/plugins/tile_map_editor_plugin.cpp +++ b/editor/plugins/tile_map_editor_plugin.cpp @@ -972,7 +972,7 @@ static inline Vector<Point2i> line(int x0, int x1, int y0, int y1) { bool TileMapEditor::forward_gui_input(const Ref<InputEvent> &p_event) { - if (!node || !node->get_tileset().is_valid() || !node->is_visible_in_tree()) + if (!node || !node->get_tileset().is_valid() || !node->is_visible_in_tree() || CanvasItemEditor::get_singleton()->get_current_tool() != CanvasItemEditor::TOOL_SELECT) return false; Transform2D xform = CanvasItemEditor::get_singleton()->get_canvas_transform() * node->get_global_transform(); @@ -1533,7 +1533,7 @@ bool TileMapEditor::forward_gui_input(const Ref<InputEvent> &p_event) { void TileMapEditor::forward_canvas_draw_over_viewport(Control *p_overlay) { - if (!node) + if (!node || CanvasItemEditor::get_singleton()->get_current_tool() != CanvasItemEditor::TOOL_SELECT) return; Transform2D cell_xf = node->get_cell_transform(); @@ -2136,6 +2136,7 @@ void TileMapEditorPlugin::make_visible(bool p_visible) { tile_map_editor->show(); tile_map_editor->get_toolbar()->show(); tile_map_editor->get_toolbar_right()->show(); + CanvasItemEditor::get_singleton()->set_current_tool(CanvasItemEditor::TOOL_SELECT); //Change to TOOL_SELECT when TileMap node is selected, to prevent accidental movement. } else { tile_map_editor->hide(); |
