🐛 Clear cache canvas on zoom. Teep textures-only invalidation on pan

This commit is contained in:
Alejandro Alonso 2026-03-25 14:39:46 +01:00 committed by Alonso Torres
parent 3c2430b16c
commit efd6b95ff6

View File

@ -2802,10 +2802,14 @@ impl RenderState {
self.rebuild_tile_index(tree);
// Invalidate the tile texture cache so all tiles are re-rendered, but
// preserve the cache canvas so render_from_cache can still show a scaled
// preview of old content while new tiles load progressively.
self.surfaces.invalidate_tile_cache();
// Zoom changes world tile size: a partial cache update would mix scales in the
// mosaic and glitch. Same zoom as last finished render (typical pan): drop only
// tile textures and keep the cache canvas for render_from_cache.
if self.zoom_changed() {
self.surfaces.remove_cached_tiles(self.background_color);
} else {
self.surfaces.invalidate_tile_cache();
}
performance::end_measure!("rebuild_tiles_shallow");
}