forked from 1b-agent/opencadstudio-upstream
Merge pull request #1627 from ramox81/codex/plotdate-refresh
Fields: evaluation events, UPDATEFIELD, FIELDEVAL, per-field shading and PlotDate redraw. # Conflicts: # Cargo.lock # src/entities/field.rs
This commit is contained in:
commit
711799371a
14 files changed
+533
-36
No files matched your search
+10
-3
@@ -2163,6 +2163,14 @@ impl OpenCADStudio {
|
||||
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
pub(in crate::app) fn prepare_native_save(&mut self, i: usize) {
|
||||
// A save is a field evaluation event (FIELDEVAL bit 2).
|
||||
self.tabs[i].scene.update_fields(2, None);
|
||||
self.prepare_snapshot_save(i);
|
||||
}
|
||||
|
||||
/// Bring the drawing state the file stores up to date, without the save
|
||||
/// event an autosave does not raise.
|
||||
pub(in crate::app) fn prepare_snapshot_save(&mut self, i: usize) {
|
||||
self.sync_view_state_for_save(i);
|
||||
sync_annotation_scale_header(&mut self.tabs[i].scene);
|
||||
self.stamp_header_sysvars(i);
|
||||
@@ -3297,7 +3305,7 @@ impl OpenCADStudio {
|
||||
if !self.tabs[i].dirty || self.active_save_jobs.contains_key(&self.tabs[i].id) {
|
||||
continue;
|
||||
}
|
||||
self.prepare_native_save(i);
|
||||
self.prepare_snapshot_save(i);
|
||||
let version = self.tabs[i].scene.document.version;
|
||||
let target = self.autosave_target(i);
|
||||
tasks.push(self.queue_native_save(
|
||||
@@ -3800,8 +3808,7 @@ impl OpenCADStudio {
|
||||
let i = self.active_tab;
|
||||
let hosts = crate::entities::field::stamp_plot_fields(&mut self.tabs[i].scene.document);
|
||||
if !hosts.is_empty() {
|
||||
let changes: Vec<_> = hosts.into_iter().map(|h| (h, crate::scene::ChangeKind::Modified)).collect();
|
||||
self.tabs[i].scene.bump_entities(&changes);
|
||||
self.tabs[i].scene.bump_text_hosts(&hosts);
|
||||
self.tabs[i].dirty = true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user