Merge remote-tracking branch 'origin/main' into plugin/host-model-api

This commit is contained in:
Felix Riestra committed 2026-09-21 22:20:09 +02:00
commit b1e6d2a349
42 files changed
+4134 -356

No files matched your search

+16
View File
@@ -2188,6 +2188,9 @@ pub(super) fn on_tab_close(&mut self, idx: usize) -> Task<Message> {
field: &'static str,
value: String,
) -> Task<Message> {
if matches!(field, "dyn_constraint_form" | "dyn_constraint_reference") {
return self.on_dynamic_dimension_choice(field, &value);
}
let i = self.active_tab;
let handles = self.property_target_handles(i);
@@ -3259,6 +3262,19 @@ pub(super) fn on_tab_close(&mut self, idx: usize) -> Task<Message> {
}
pub(super) fn on_prop_geom_commit(&mut self, field: &'static str) -> Task<Message> {
use crate::ui::window::named_parameters::ParamField;
// A dynamic dimension's Name/Expression rows edit its parameter.
let dynamic_field = match field {
"dyn_constraint_name" => Some(ParamField::Name),
"dyn_constraint_expression" => Some(ParamField::Formula),
_ => None,
};
if let Some(param_field) = dynamic_field {
return self.on_dynamic_dimension_field_commit(field, param_field);
}
if field == "dyn_constraint_description" {
return self.on_dynamic_dimension_description_commit(field);
}
let i = self.active_tab;
self.tabs[i].properties.active_field = None;
let handles = self.property_target_handles(i);
+3 -3
View File
@@ -1466,7 +1466,7 @@ impl OpenCADStudio {
self.prepare_native_save(i);
let version = self.tabs[i].scene.document.version;
let snapshot = self.tabs[i].scene.document.clone();
let snapshot = self.tabs[i].scene.document_for_save();
crate::io::save_owned_as_version_atomic(
snapshot,
&path,
@@ -1895,7 +1895,7 @@ impl OpenCADStudio {
path: std::path::PathBuf,
) -> Task<Message> {
let i = self.active_tab;
let document = self.tabs[i].scene.document.clone();
let document = self.tabs[i].scene.document_for_save();
let handles: Vec<_> = self.tabs[i].scene.selected.iter().copied().collect();
let worker_name = block_name.clone();
let worker_path = path.clone();
@@ -2300,7 +2300,7 @@ impl OpenCADStudio {
crate::ui::wrap_bar::dropdown_bounds(crate::app::view::VIEWPORT_CAPTURE_BOUNDS_ID)
});
let clone_started = iced::time::Instant::now();
let mut snapshot = self.tabs[i].scene.document.clone();
let mut snapshot = self.tabs[i].scene.document_for_save();
// Save-As across folders: rebase relative reference paths onto the
// new base dir inside the snapshot only (live strings are untouched).
if purpose == crate::app::SavePurpose::SaveAs {
+11
View File
@@ -785,6 +785,8 @@ impl OpenCADStudio {
pub(super) fn on_tick(&mut self, t: Instant) -> Task<Message> {
let i = self.active_tab;
self.tabs[i].scene.update(t - self.start);
// Dynamic dimensions keep their screen size across zoom bands.
self.tabs[i].scene.refresh_dynamic_dimension_scales(false);
// If the camera moved since we last synced, write it back to
// the document and mark the file dirty.
@@ -5058,6 +5060,15 @@ properties={:.1}ms picked={}",
{
return Task::none();
}
// A constraint dimension edits its parameter from the
// command line, standing in for the reference's in-place
// value editor.
if let Some(prompt) = self.dynamic_dimension_value_command(i, handle) {
use crate::command::CadCommand;
self.command_line.push_info(&prompt.prompt());
self.tabs[i].active_cmd = Some(Box::new(prompt));
return Task::none();
}
// Any text-bearing entity opens its in-place editor
// (plain box or rich MText editor, per type). A
// Leader resolves to the entity it annotates.