forked from 1b-agent/opencadstudio-upstream
fix(select): click the front-most solid across top-level and block bodies
Clicking a block whose body is a solid tried top-level solid meshes first and block-internal ones only as a fallback, so a stray solid behind the block always won and the block couldn't be picked. Merge both into one depth-sorted hit-test (solid_click_hit) keyed by the solid's own handle or the parent INSERT, so the front-most body wins regardless of kind. Co-Authored-By: Claude Opus 4.8 <[email protected]>
This commit is contained in:
1 parent
d1395e8f3d
commit
cd10aa0363
2 files changed
+48
-3
No files matched your search
+5
-3
@@ -3880,8 +3880,10 @@ impl OpenCADStudio {
|
||||
})
|
||||
.or_else(|| {
|
||||
// 3D solids: click anywhere on the shaded
|
||||
// body, not just the thin projected edges.
|
||||
self.tabs[i].scene.mesh_click_hit(p, vp_mat, bounds)
|
||||
// body — top-level solids and block-internal
|
||||
// ones together, front-most wins (a block in
|
||||
// front of a solid resolves to the block).
|
||||
self.tabs[i].scene.solid_click_hit(p, vp_mat, bounds)
|
||||
});
|
||||
// Selection filter: drop a pick whose type is excluded.
|
||||
let hit =
|
||||
@@ -4376,7 +4378,7 @@ impl OpenCADStudio {
|
||||
bounds,
|
||||
)
|
||||
})
|
||||
.or_else(|| self.tabs[i].scene.mesh_click_hit(p, view_proj, bounds));
|
||||
.or_else(|| self.tabs[i].scene.solid_click_hit(p, view_proj, bounds));
|
||||
self.tabs[i].scene.set_hover_highlight(hovered);
|
||||
self.hover_dwell = None;
|
||||
Task::none()
|
||||
|
||||
Reference in new issue
Block a user