浏览代码

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 年之前
父节点
当前提交
0b5c4216c8
共有 1 个文件被更改,包括 3 次插入1 次删除
  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;
 	rect_cache = r_total;
 
 
-	item_rect_changed();
+	item_rect_changed(changed);
 
 
 	rect_cache_dirty = false;
 	rect_cache_dirty = false;
 #endif
 #endif