Merge pull request #26722 from MarianoGnu/fix_24238

TileSetEditor: Don't draw invalid occlusion shapes. Fixes #24238
This commit is contained in:
Rémi Verschelde 2019-03-06 20:58:05 +01:00 committed by GitHub
commit 2f2fa8db69
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2460,10 +2460,12 @@ void TileSetEditor::draw_polygon_shapes() {
workspace->draw_polygon(polygon, colors);
if (!creating_shape) {
for (int j = 0; j < polygon.size() - 1; j++) {
workspace->draw_line(polygon[j], polygon[j + 1], c_border, 1, true);
if (polygon.size() > 1) {
for (int j = 0; j < polygon.size() - 1; j++) {
workspace->draw_line(polygon[j], polygon[j + 1], c_border, 1, true);
}
workspace->draw_line(polygon[polygon.size() - 1], polygon[0], c_border, 1, true);
}
workspace->draw_line(polygon[polygon.size() - 1], polygon[0], c_border, 1, true);
}
if (shape == edited_occlusion_shape) {
draw_handles = true;