diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2020-06-18 09:55:03 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-18 09:55:03 +0200 |
commit | a8fce16b2f675825b0f82889e2d5aca0c59b205c (patch) | |
tree | 939225e468d59c33a6ea5b6f45d4bb948ed489c1 /editor/plugins | |
parent | 47eb607cc36cb24354ea61ff399657bf920fdb94 (diff) | |
parent | 7850d0316f1100eb0f6b4229fb76784ea20a3e75 (diff) |
Merge pull request #39626 from bojidar-bg/x-tileset-editor-crash
Fix a random crash in the TileSet editor
Diffstat (limited to 'editor/plugins')
-rw-r--r-- | editor/plugins/tile_set_editor_plugin.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/editor/plugins/tile_set_editor_plugin.cpp b/editor/plugins/tile_set_editor_plugin.cpp index b3d4b391d3..07bf5b53cd 100644 --- a/editor/plugins/tile_set_editor_plugin.cpp +++ b/editor/plugins/tile_set_editor_plugin.cpp @@ -492,12 +492,14 @@ TileSetEditor::TileSetEditor(EditorNode *p_editor) { tools[SHAPE_NEW_RECTANGLE]->set_toggle_mode(true); tools[SHAPE_NEW_RECTANGLE]->set_button_group(tg); tools[SHAPE_NEW_RECTANGLE]->set_tooltip(TTR("Create a new rectangle.")); + tools[SHAPE_NEW_RECTANGLE]->connect("pressed", callable_mp(this, &TileSetEditor::_on_tool_clicked), varray(SHAPE_NEW_RECTANGLE)); tools[SHAPE_NEW_POLYGON] = memnew(ToolButton); toolbar->add_child(tools[SHAPE_NEW_POLYGON]); tools[SHAPE_NEW_POLYGON]->set_toggle_mode(true); tools[SHAPE_NEW_POLYGON]->set_button_group(tg); tools[SHAPE_NEW_POLYGON]->set_tooltip(TTR("Create a new polygon.")); + tools[SHAPE_NEW_POLYGON]->connect("pressed", callable_mp(this, &TileSetEditor::_on_tool_clicked), varray(SHAPE_NEW_POLYGON)); separator_shape_toggle = memnew(VSeparator); toolbar->add_child(separator_shape_toggle); @@ -1908,7 +1910,7 @@ void TileSetEditor::_on_tool_clicked(int p_tool) { } } } - } else if (p_tool == TOOL_SELECT) { + } else if (p_tool == TOOL_SELECT || p_tool == SHAPE_NEW_POLYGON || p_tool == SHAPE_NEW_RECTANGLE) { if (creating_shape) { // Cancel Creation creating_shape = false; |