summaryrefslogtreecommitdiff
path: root/editor/plugins
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2019-04-06 20:51:38 +0200
committerGitHub <noreply@github.com>2019-04-06 20:51:38 +0200
commitf1dc158ebd23dd3fa8dedf785bdbebff80f10be5 (patch)
treeb4b562a8b8555cba0149aff26dd058029ec779b1 /editor/plugins
parentc20c2870a7f8c0f0eafb93393309bada322147ba (diff)
parentc7cfe5330c5903f23f020633ebe433f1f485dd87 (diff)
Merge pull request #27602 from YeldhamDev/tileset_emptypoly_crash_fix
Fix crash when using the Tileset Editor when the given shape has no points
Diffstat (limited to 'editor/plugins')
-rw-r--r--editor/plugins/tile_set_editor_plugin.cpp8
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) {