feat(solid history): Ctrl+click picks a composite's solid; show history draws them

Ctrl+click on a composite selects it with the solid under the cursor as
the one its palette and grips edit: the solid whose own surface passes
through the picked point. With its history shown, a composite draws the
edges of the solids its booleans joined, each where it sits.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
Hakan SevenandClaude Opus 5.5 committed 2026-10-07 12:51:32 +03:00
1 parent 43bd5aa427
commit 33640e050d
4 files changed
+163 -1

No files matched your search

+31 -1
View File
@@ -656,7 +656,7 @@ impl OpenCADStudio {
}
}
fn grip_edit_for_hit(
pub(in crate::app) fn grip_edit_for_hit(
&mut self,
i: usize,
handle: Handle,
@@ -3738,6 +3738,36 @@ impl OpenCADStudio {
}
}
// Ctrl+click on a composite solid picks the solid of it under the
// cursor — the one the Properties palette and grips then edit.
if self.ctrl_down
&& self.tabs[i].active_cmd.is_none()
&& self.tabs[i].scene.current_layout == "Model"
{
let (view_rot, eye) = {
let cam = self.tabs[i].scene.camera.borrow();
(cam.view_proj_rte(bounds), cam.eye())
};
let hit = self.tabs[i].scene.solid_click_hit_point(p, view_rot, eye, bounds);
if let Some((handle, _)) = hit.filter(|(handle, point)| {
crate::scene::model::solid_history::select_operand_at(
&self.tabs[i].scene.document,
*handle,
*point,
)
}) {
self.tabs[i]
.scene
.selection
.borrow_mut()
.clear_left_selection_gesture();
self.tabs[i].scene.deselect_all();
self.tabs[i].scene.select_entity(handle, false);
self.refresh_properties();
return Task::none();
}
}
// A command step that takes a point or a pick commits on the press,
// so the cursor moving before the button comes up cannot move it.
// Selection steps and drag-fence picks still wait for the release.