From f93d7cf9d2b2797684c546643f7a8daa7e0e668b Mon Sep 17 00:00:00 2001 From: Hakan Seven Date: Wed, 20 May 2026 06:09:56 +0300 Subject: [PATCH] fix(scene): bake selection colour into lod_stub_wire The stub wires emitted at low LOD carried wire.selected = true but stored the entity's own colour, so the actual on-screen pixel kept the entity hue. Selecting an object and then zooming past the LOD boundary made the highlight vanish even though the entity was still in the selection set. Swap to WireModel::SELECTED at construction time, matching what tessellate.rs does for full-LOD wires. Follow-up to #19. Co-Authored-By: Claude Opus 4.7 --- src/scene/mod.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/scene/mod.rs b/src/scene/mod.rs index ce550875b..72dc02111 100644 --- a/src/scene/mod.rs +++ b/src/scene/mod.rs @@ -5246,12 +5246,19 @@ fn lod_stub_wire( let [ax, ay, bx, by] = aabb; let cx = (ax + bx) * 0.5; let cy = (ay + by) * 0.5; + // Mirror what tessellate.rs does for the non-stub paths: bake the + // selection-highlight colour into the wire so a re-tessellate triggered + // by a zoom-induced LOD change keeps the entity highlighted. Without + // this swap the wire's `selected` flag is true but its colour stays at + // the entity's own hue, so the user sees the highlight vanish at the + // LOD boundary. #19. + let stored_color = if selected { WireModel::SELECTED } else { color }; WireModel { name, // Diagonal: projects to 1-5 px at the LOD threshold so the entity // shows as a tiny mark. points: vec![[ax, ay, 0.0], [bx, by, 0.0]], - color, + color: stored_color, selected, aci, pattern_length: 0.0,