forked from 1b-agent/opencadstudio-upstream
Merge pull request #1293: Fix constraint indicator visibility
This commit is contained in:
commit
1a7aad8e04
5 files changed
+129
-32
No files matched your search
@@ -1722,10 +1722,15 @@ impl OpenCADStudio {
|
||||
let mut touched = Vec::new();
|
||||
for (kind, refs) in inferred {
|
||||
touched.extend(refs.iter().map(|reference| reference.entity));
|
||||
self.tabs[i]
|
||||
let id = self.tabs[i]
|
||||
.scene
|
||||
.parametric_constraint_set_mut(scope)
|
||||
.add(kind, refs, None);
|
||||
self.tabs[i].scene.note_parametric_constraint_applied(
|
||||
scope,
|
||||
id,
|
||||
self.constraint_bar_display,
|
||||
);
|
||||
}
|
||||
touched.sort_unstable_by_key(|handle| handle.value());
|
||||
touched.dedup();
|
||||
@@ -3117,11 +3122,16 @@ impl OpenCADStudio {
|
||||
.scene
|
||||
.record_undo_parametric_constraints_before(scope, constraints_before);
|
||||
let retain_size = self.constraint_solve_mode && driving_param.is_none();
|
||||
self.tabs[i].scene.parametric_constraint_set_mut(scope).add(
|
||||
let id = self.tabs[i].scene.parametric_constraint_set_mut(scope).add(
|
||||
kind,
|
||||
refs,
|
||||
driving_param,
|
||||
);
|
||||
self.tabs[i].scene.note_parametric_constraint_applied(
|
||||
scope,
|
||||
id,
|
||||
self.constraint_bar_display,
|
||||
);
|
||||
let changes: Vec<(Handle, crate::scene::ChangeKind)> = touched
|
||||
.into_iter()
|
||||
.map(|h| (h, crate::scene::ChangeKind::Modified))
|
||||
@@ -3222,10 +3232,15 @@ impl OpenCADStudio {
|
||||
self.tabs[i]
|
||||
.scene
|
||||
.record_undo_parametric_constraints_before(scope, constraints_before);
|
||||
self.tabs[i]
|
||||
let id = self.tabs[i]
|
||||
.scene
|
||||
.parametric_constraint_set_mut(scope)
|
||||
.add(kind, refs, None);
|
||||
self.tabs[i].scene.note_parametric_constraint_applied(
|
||||
scope,
|
||||
id,
|
||||
self.constraint_bar_display,
|
||||
);
|
||||
let changes: Vec<_> = touched
|
||||
.iter()
|
||||
.copied()
|
||||
@@ -3281,10 +3296,15 @@ impl OpenCADStudio {
|
||||
.scene
|
||||
.record_undo_parametric_constraints_before(scope, constraints_before);
|
||||
for refs in inferred {
|
||||
self.tabs[i]
|
||||
let id = self.tabs[i]
|
||||
.scene
|
||||
.parametric_constraint_set_mut(scope)
|
||||
.add(ConstraintKind::Coincident, refs, None);
|
||||
self.tabs[i].scene.note_parametric_constraint_applied(
|
||||
scope,
|
||||
id,
|
||||
self.constraint_bar_display,
|
||||
);
|
||||
}
|
||||
let changes: Vec<_> = handles
|
||||
.iter()
|
||||
|
||||
@@ -1165,10 +1165,15 @@ impl OpenCADStudio {
|
||||
.record_undo_parametric_constraints_before(scope, before);
|
||||
let count = inferred.len();
|
||||
for (kind, refs) in inferred {
|
||||
self.tabs[i]
|
||||
let id = self.tabs[i]
|
||||
.scene
|
||||
.parametric_constraint_set_mut(scope)
|
||||
.add(kind, refs, None);
|
||||
self.tabs[i].scene.note_parametric_constraint_applied(
|
||||
scope,
|
||||
id,
|
||||
self.constraint_bar_display,
|
||||
);
|
||||
}
|
||||
let changes: Vec<_> = handles
|
||||
.iter()
|
||||
@@ -1281,11 +1286,16 @@ impl OpenCADStudio {
|
||||
.scene
|
||||
.record_undo_parametric_constraints_before(scope, before);
|
||||
for (_, kind, refs, value) in conversions {
|
||||
self.tabs[i].scene.parametric_constraint_set_mut(scope).add(
|
||||
let id = self.tabs[i].scene.parametric_constraint_set_mut(scope).add(
|
||||
kind,
|
||||
refs,
|
||||
Some(value),
|
||||
);
|
||||
self.tabs[i].scene.note_parametric_constraint_applied(
|
||||
scope,
|
||||
id,
|
||||
self.constraint_bar_display,
|
||||
);
|
||||
}
|
||||
self.tabs[i].scene.erase_entities(&dimensions);
|
||||
let changes: Vec<_> = touched
|
||||
|
||||
@@ -6371,11 +6371,13 @@ mod selection_preview_tests {
|
||||
Vector3::new(-1.0, 0.0, 0.0),
|
||||
Vector3::new(1.0, 0.0, 0.0),
|
||||
)));
|
||||
app.tabs[i].scene.parametric_constraint_set_mut(ParametricScope::ModelSpace).add(
|
||||
ConstraintKind::Horizontal,
|
||||
vec![ParametricRef::whole(handle)],
|
||||
None,
|
||||
);
|
||||
app.constraint_bar_display = 3;
|
||||
let _ = app.apply_cmd_result(crate::command::CmdResult::AddParametricConstraint {
|
||||
kind: ConstraintKind::Horizontal,
|
||||
refs: vec![ParametricRef::whole(handle)],
|
||||
driving_param: None,
|
||||
label: "Horizontal constraint",
|
||||
});
|
||||
let anchor = app.tabs[i].scene.constraint_glyph_placements_screen(
|
||||
ParametricScope::ModelSpace,
|
||||
(800.0, 600.0),
|
||||
|
||||
Reference in new issue
Block a user