forked from 1b-agent/opencadstudio-upstream
Add per-constraint delete; fix named-parameter reference bugs
Constraint delete: a Properties-panel row delete button, viewport
click-to-select on a constraint glyph pill with Delete-key support, and a
right-click "Delete Constraint" menu item — all routed through one
undoable Scene::selected_constraint-aware path.
Fixes two named-parameter bugs found while testing that feature:
- DIMCONSTRAINT: a parameter named like a mode-switch keyword ("r", "d",
"a", "x", "y") could never be referenced, since the keyword check ran
before the parameter-name check.
- PARAMETERS modal Apply rebuilt Scene::named_parameters but never
refreshed the Properties panel, leaving renamed/deleted rows stale
until an unrelated refresh (e.g. a selection change) happened to occur.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
753df67ee4
commit
59ae38ae1a
14 files changed
+370
-77
No files matched your search
@@ -1627,6 +1627,13 @@ pub struct Scene {
|
||||
/// Currently selected entity handles.
|
||||
pub selected: HashSet<Handle>,
|
||||
selected_order: Vec<Handle>,
|
||||
/// The sketch-constraint glyph pill currently selected in the viewport
|
||||
/// (click-to-select — see `sketch_constraints::constraint_glyph_hit`),
|
||||
/// independent of `selected`'s entity handles. Cleared whenever entity
|
||||
/// selection changes so the two stay mutually exclusive; validated
|
||||
/// against the current scope's constraint set at use, since switching
|
||||
/// sketch scope can leave a stale id behind.
|
||||
pub selected_constraint: Option<crate::scene::sketch_constraints::ConstraintId>,
|
||||
/// Session-only ISOLATEOBJECTS / HIDEOBJECTS state. Never written to DWG/DXF.
|
||||
pub object_isolation: ObjectIsolationState,
|
||||
/// Entity handles temporarily removed from the base render while an
|
||||
@@ -2171,6 +2178,7 @@ impl Scene {
|
||||
lighting_cache: RefCell::new(HashMap::default()),
|
||||
selected: HashSet::default(),
|
||||
selected_order: Vec::new(),
|
||||
selected_constraint: None,
|
||||
object_isolation: ObjectIsolationState::default(),
|
||||
preview_hidden: HashSet::default(),
|
||||
command_preview_hidden: HashSet::default(),
|
||||
|
||||
Reference in new issue
Block a user