diff options
author | Vladislav Slobodenyuk <toastergithubmail@gmail.com> | 2022-12-09 22:20:08 +0900 |
---|---|---|
committer | Vladislav Slobodenyuk <toastergithubmail@gmail.com> | 2022-12-09 22:20:31 +0900 |
commit | 0b5c4216c86a838e96a158c71a3f2015d47217e8 (patch) | |
tree | 9ce743aedf5ac3cfa3ea4b625068e8f55215d854 /scene | |
parent | c6e40e1c01200052450df10d9126f8ea7f57de30 (diff) |
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
Diffstat (limited to 'scene')
-rw-r--r-- | scene/2d/tile_map.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/scene/2d/tile_map.cpp b/scene/2d/tile_map.cpp index 4d4ea2b26d..ced77b26ee 100644 --- a/scene/2d/tile_map.cpp +++ b/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 |