Ver código fonte

Fix TileMap drawing itself twice on creation

Adds a check before calling `item_rect_changed()` in
`_recompute_rect_cache()` of `scene/2d/tile_map.cpp`. Makes sure
TileMap is only redrawn if the rect is actually changed.
Fixes #69754
Vladislav Slobodenyuk 2 anos atrás
pai
commit
0b5c4216c8
1 arquivos alterados com 3 adições e 1 exclusões
  1. 3 1
      scene/2d/tile_map.cpp

+ 3 - 1
scene/2d/tile_map.cpp

@@ -995,9 +995,11 @@ void TileMap::_recompute_rect_cache() {
 		}
 	}
 
+	bool changed = rect_cache != r_total;
+
 	rect_cache = r_total;
 
-	item_rect_changed();
+	item_rect_changed(changed);
 
 	rect_cache_dirty = false;
 #endif