From e46c2dbf748934e6fd09b5fbe66ac0a8665313fd Mon Sep 17 00:00:00 2001 From: Markar Date: Tue, 7 Aug 2018 12:28:58 +0200 Subject: [PATCH] Fix bucket fill behaviour when selecting multiple tiles --- editor/plugins/tile_map_editor_plugin.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/editor/plugins/tile_map_editor_plugin.cpp b/editor/plugins/tile_map_editor_plugin.cpp index 101dc3037f0..3d14db7d0e3 100644 --- a/editor/plugins/tile_map_editor_plugin.cpp +++ b/editor/plugins/tile_map_editor_plugin.cpp @@ -533,10 +533,9 @@ PoolVector TileMapEditor::_bucket_fill(const Point2i &p_start, bool era return PoolVector(); } - for (int i = ids.size() - 1; i >= 0; i--) { - if (ids[i] == prev_id) { - return PoolVector(); - } + if (ids.size() == 1 && ids[0] == prev_id) { + // Same ID, nothing to change + return PoolVector(); } Rect2i r = node->get_used_rect();