forked from 1b-agent/opencadstudio-upstream
fix(select): highlight a block's solid body on hover/selection
The instanced block solid meshes kept the inner solid's handle as their name, but the highlight tint matches the mesh name against the hovered / selected handle — which for a block is the parent INSERT. So hovering or selecting a block whose body is a solid never tinted it. Tag the instanced meshes with the parent INSERT handle so the orange hover / blue selection tint applies. Co-Authored-By: Claude Opus 4.8 <[email protected]>
This commit is contained in:
1 parent
cd10aa0363
commit
65b8e85751
1 file changed
+10
@@ -2094,7 +2094,17 @@ impl Scene {
|
||||
if !self.mesh_entity_visible(ins.common.handle) {
|
||||
continue;
|
||||
}
|
||||
let start = out.len();
|
||||
self.expand_block_meshes(&ins.block_name, &ins.get_transform(), 0, woff, &mut out);
|
||||
// Tag the instanced meshes with the parent INSERT handle so the
|
||||
// hover / selection highlight (keyed on the mesh name) tints the
|
||||
// block, not the inner solid's own handle which nothing selects.
|
||||
let name = ins.common.handle.value().to_string();
|
||||
for set in &mut out[start..] {
|
||||
for m in &mut set.lods {
|
||||
m.name = name.clone();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
out
|
||||
|
||||
Reference in new issue
Block a user