forked from 1b-agent/opencadstudio-upstream
Merge remote-tracking branch 'origin/main' into merge-test/main-into-constraints
# Conflicts: # src/app/command_driver.rs # src/command.rs # src/ui/ribbon/mod.rs # src/ui/window/options.rs
This commit is contained in:
commit
ad718def3f
124 files changed
+9866
-692
No files matched your search
+49
-3
@@ -355,6 +355,37 @@ impl OpenCADStudio {
|
||||
}
|
||||
}
|
||||
|
||||
/// Write a header variable on the active drawing and mark it modified.
|
||||
pub(in crate::app) fn set_drawing_var(
|
||||
&mut self,
|
||||
write: impl FnOnce(&mut acadrust::document::HeaderVariables),
|
||||
) {
|
||||
let i = self.active_tab;
|
||||
if let Some(tab) = self.tabs.get_mut(i) {
|
||||
write(&mut tab.scene.document.header);
|
||||
tab.dirty = true;
|
||||
}
|
||||
}
|
||||
|
||||
/// Re-tessellate active-drawing solids after an ISOLINES change.
|
||||
pub(in crate::app) fn regenerate_meshes(&mut self) {
|
||||
let i = self.active_tab;
|
||||
if let Some(tab) = self.tabs.get_mut(i) {
|
||||
tab.scene.populate_meshes_from_document();
|
||||
}
|
||||
}
|
||||
|
||||
/// Rebuild text geometry in every open drawing.
|
||||
///
|
||||
/// `TEXTFILL` is a process-global, so a change to it invalidates the text
|
||||
/// in every tab. Doing only the active one leaves the others rendering the
|
||||
/// previous setting until some unrelated edit happens to rebuild them.
|
||||
pub(in crate::app) fn invalidate_text_everywhere(&mut self) {
|
||||
for tab in &mut self.tabs {
|
||||
tab.scene.invalidate_text_geometry_dependencies();
|
||||
}
|
||||
}
|
||||
|
||||
/// Snapshot the persisted UI preferences from live state.
|
||||
pub(in crate::app) fn current_settings(&self) -> crate::app::settings::UserSettings {
|
||||
crate::app::settings::UserSettings {
|
||||
@@ -365,6 +396,11 @@ impl OpenCADStudio {
|
||||
zoom_factor: self.zoom_factor,
|
||||
cursor_size: self.cursor_size,
|
||||
pick_box: self.pick_box,
|
||||
options_tab: self.options_tab,
|
||||
show_viewcube: self.show_viewcube,
|
||||
show_ucs_icon: self.show_ucs_icon,
|
||||
ucs_icon_at_origin: self.ucs_icon_at_origin,
|
||||
selection_cycling: self.selection_cycling,
|
||||
double_click_block_refedit: self.double_click_block_refedit,
|
||||
double_click_block_attedit: self.double_click_block_attedit,
|
||||
grip_object_limit: self.grip_object_limit,
|
||||
@@ -393,6 +429,7 @@ impl OpenCADStudio {
|
||||
texteditmode: self.texteditmode,
|
||||
quick_dimension_snap_priority: self.quick_dimension_snap_priority,
|
||||
dimension_continue_mode: self.dimension_continue_mode,
|
||||
delete_objects: self.delete_objects,
|
||||
textfill: crate::scene::text::sdf_atlas::textfill(),
|
||||
backup_on_save: self.backup_on_save,
|
||||
file_assoc_enabled: self.file_assoc_enabled,
|
||||
@@ -403,8 +440,6 @@ impl OpenCADStudio {
|
||||
pick_add: self.pick_add,
|
||||
pick_drag_rect: self.pick_drag_rect,
|
||||
quick_properties: self.quick_properties,
|
||||
bg_color: None,
|
||||
paper_bg_color: None,
|
||||
language: self.language,
|
||||
cliprompt_lines: crate::app::settings::clamp_clipromptlines(self.cliprompt_lines),
|
||||
commandline_fade_ms: crate::app::settings::clamp_commandline_fade_ms(
|
||||
@@ -424,6 +459,14 @@ impl OpenCADStudio {
|
||||
self.zoom_factor = s.zoom_factor.clamp(3, 100);
|
||||
self.cursor_size = s.cursor_size.clamp(1, 100);
|
||||
self.pick_box = s.pick_box.clamp(0, 50);
|
||||
self.options_tab = s.options_tab;
|
||||
// These four drive real features with commands and status-bar pills,
|
||||
// but they lived only on the app struct: turning the ViewCube off and
|
||||
// restarting brought it straight back.
|
||||
self.show_viewcube = s.show_viewcube;
|
||||
self.show_ucs_icon = s.show_ucs_icon;
|
||||
self.ucs_icon_at_origin = s.ucs_icon_at_origin;
|
||||
self.selection_cycling = s.selection_cycling;
|
||||
self.double_click_block_refedit = s.double_click_block_refedit;
|
||||
self.double_click_block_attedit = s.double_click_block_attedit;
|
||||
self.grip_object_limit = s.grip_object_limit.clamp(0, 32767);
|
||||
@@ -442,6 +485,9 @@ impl OpenCADStudio {
|
||||
} else {
|
||||
0.0
|
||||
};
|
||||
// The Options field edits a buffer rather than the value, so it has to
|
||||
// be reseeded whenever the value is restored from behind it.
|
||||
self.snap_angle_input = crate::app::settings::format_snap_angle(self.snap_angle_deg);
|
||||
// Ortho + running OSNAP are per-drawing (adopted from the header on
|
||||
// open / tab switch), not app-global, so they are not applied here.
|
||||
self.snapper.otrack_enabled = s.otrack;
|
||||
@@ -464,6 +510,7 @@ impl OpenCADStudio {
|
||||
self.texteditmode = s.texteditmode;
|
||||
self.quick_dimension_snap_priority = s.quick_dimension_snap_priority.min(1);
|
||||
self.dimension_continue_mode = s.dimension_continue_mode.clamp(0, 1);
|
||||
self.delete_objects = s.delete_objects.clamp(0, 3);
|
||||
crate::scene::text::sdf_atlas::set_textfill(s.textfill);
|
||||
self.backup_on_save = s.backup_on_save;
|
||||
self.file_assoc_enabled = s.file_assoc_enabled;
|
||||
@@ -475,7 +522,6 @@ impl OpenCADStudio {
|
||||
self.pick_add = s.pick_add;
|
||||
self.pick_drag_rect = s.pick_drag_rect;
|
||||
self.quick_properties = s.quick_properties;
|
||||
// Legacy settings.bg_color / paper_bg_color are superseded by model_space config.
|
||||
if crate::i18n::set_language(s.language).is_ok() {
|
||||
self.language = s.language;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user