forked from 1b-agent/opencadstudio-upstream
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 <[email protected]>
This commit is contained in:
1 parent
8355e5a278
commit
f93d7cf9d2
1 file changed
+8
-1
+8
-1
@@ -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,
|
||||
|
||||
Reference in new issue
Block a user