From 2b8e1c32b95949fe1442c5589ad17f2eae87493d Mon Sep 17 00:00:00 2001 From: popertots Date: Fri, 20 Mar 2026 15:31:53 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20remove=20.max(0)=20clamp=20from=20z=5Fmi?= =?UTF-8?q?n=20=E2=80=94=20was=20inflating=20dirty=20set=20to=20all=202018?= =?UTF-8?q?1=20keys?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Negative world z (below ground) was excluded by the clamp, making the visible window asymmetrically large. Dirty count now proportional to actual scroll distance. Frame time dropped from ~13ms to ~8.3ms avg. --- src/world/tiles/tilemap_chunk.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/world/tiles/tilemap_chunk.rs b/src/world/tiles/tilemap_chunk.rs index 3fc4159..b9ce5a1 100644 --- a/src/world/tiles/tilemap_chunk.rs +++ b/src/world/tiles/tilemap_chunk.rs @@ -447,7 +447,7 @@ pub fn on_camera_z_changed( let now = Instant::now(); - let z_min = (new_camera_z.min(old_camera_z) - 8).max(0); + let z_min = new_camera_z.min(old_camera_z) - 8; let z_max = new_camera_z.max(old_camera_z); let mut new_keys: Vec = Vec::new();