summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkar <markar24@gmail.com>2018-08-07 12:28:58 +0200
committerRémi Verschelde <rverschelde@gmail.com>2018-08-17 01:55:21 +0200
commite46c2dbf748934e6fd09b5fbe66ac0a8665313fd (patch)
tree0c8e5524a4c51e157990ff0e4f81f3d801a5b8ec
parent6936cbc24e7d675c685b43bd86fabc9d572fa178 (diff)
Fix bucket fill behaviour when selecting multiple tiles
-rw-r--r--editor/plugins/tile_map_editor_plugin.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/editor/plugins/tile_map_editor_plugin.cpp b/editor/plugins/tile_map_editor_plugin.cpp
index 101dc3037f..3d14db7d0e 100644
--- a/editor/plugins/tile_map_editor_plugin.cpp
+++ b/editor/plugins/tile_map_editor_plugin.cpp
@@ -533,10 +533,9 @@ PoolVector<Vector2> TileMapEditor::_bucket_fill(const Point2i &p_start, bool era
return PoolVector<Vector2>();
}
- for (int i = ids.size() - 1; i >= 0; i--) {
- if (ids[i] == prev_id) {
- return PoolVector<Vector2>();
- }
+ if (ids.size() == 1 && ids[0] == prev_id) {
+ // Same ID, nothing to change
+ return PoolVector<Vector2>();
}
Rect2i r = node->get_used_rect();