diff options
author | Michael Alexsander Silva Dias <michaelalexsander@protonmail.com> | 2019-04-02 11:45:18 -0300 |
---|---|---|
committer | Michael Alexsander Silva Dias <michaelalexsander@protonmail.com> | 2019-04-05 21:32:48 -0300 |
commit | 9501900e1bd44b9aa2feb32b636c9bc9283a8363 (patch) | |
tree | 01caa2773d6500d1e6570f0d0757fb3130b4c89a /editor | |
parent | 7ca9863079c2c033e5dd550e0ab989c8593352cc (diff) |
Fix crash when using the Tileset Editor when the given shape has no points
Diffstat (limited to 'editor')
-rw-r--r-- | editor/plugins/tile_set_editor_plugin.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/editor/plugins/tile_set_editor_plugin.cpp b/editor/plugins/tile_set_editor_plugin.cpp index 8fc080c819..54e6e5b154 100644 --- a/editor/plugins/tile_set_editor_plugin.cpp +++ b/editor/plugins/tile_set_editor_plugin.cpp @@ -2417,11 +2417,11 @@ void TileSetEditor::draw_polygon_shapes() { colors.push_back(c_bg); } } - if (polygon.size() == 0) + + if (polygon.size() < 3) continue; - if (polygon.size() > 2) { - workspace->draw_polygon(polygon, colors); - } + + workspace->draw_polygon(polygon, colors); if (coord == edited_shape_coord || tileset->tile_get_tile_mode(get_current_tile()) == TileSet::SINGLE_TILE) { if (!creating_shape) { |