fix(scene): skip pixel-size LOD in paper space

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 <[email protected]>
This commit is contained in:
HakanandClaude Opus 4.7 committed 2026-05-15 09:45:48 +03:00
1 parent f738a20457
commit 6cc2323905
1 file changed
+10
+10
View File
@@ -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<f32> {
if self.current_layout != "Model" {
return None;
}
let v = self.last_world_per_pixel.get();
if v > 0.0 && v.is_finite() {
Some(v)