From 6cc2323905c0670cc9400725c5be9e4d66f0b2bf Mon Sep 17 00:00:00 2001 From: Hakan Date: Fri, 15 May 2026 09:45:48 +0300 Subject: [PATCH] fix(scene): skip pixel-size LOD in paper space MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PaperCanvas (Iced 2-D canvas) never feeds set_render_pixel_scale, so last_world_per_pixel held either zero or a stale model-world value. Paper-space entity AABBs (mm) tested against model-scale wpp all projected below the 5 px threshold and got culled — leaving only Viewports and Inserts (which bypass the cull). world_per_pixel() now returns None in paper space, mirroring view_world_aabb()'s existing skip with the same reasoning: the paper canvas is small enough that LOD culling buys nothing. Co-Authored-By: Claude Opus 4.7 --- src/scene/mod.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/scene/mod.rs b/src/scene/mod.rs index 2fb380810..4f237a5d0 100644 --- a/src/scene/mod.rs +++ b/src/scene/mod.rs @@ -385,7 +385,17 @@ impl Scene { /// World units per screen pixel at the current viewport size. Returns /// `None` until the first render captures real bounds. + /// + /// Also returns `None` in paper space: `set_render_pixel_scale` is only + /// fed by the shader pipeline (`build_primitive`), and the paper layout + /// renders through `PaperCanvas` (an Iced 2-D canvas) which never touches + /// it. Whatever value is cached would be a stale model-world wpp and, + /// applied to mm-sheet entity AABBs, would cull every paper-space + /// annotation. Matches the same skip already in `view_world_aabb`. pub(super) fn world_per_pixel(&self) -> Option { + if self.current_layout != "Model" { + return None; + } let v = self.last_world_per_pixel.get(); if v > 0.0 && v.is_finite() { Some(v)