forked from 1b-agent/opencadstudio-upstream
Merge pull request #1630 from ramox81/codex/table-edit-overrides
Tables: cell overrides and field backgrounds when drawn from table data. # Conflicts: # Cargo.lock # Cargo.toml
This commit is contained in:
commit
95d5eb73d9
4 files changed
+133
-39
No files matched your search
@@ -78,11 +78,7 @@ fn oriented_text_corners(
|
||||
]
|
||||
}
|
||||
|
||||
/// FIELDDISPLAY box extent around a line of field text, in text heights:
|
||||
/// from a third of the height below the baseline to 1.19 heights above it
|
||||
/// (the reference's box, measured at 2.5 and 10 unit text).
|
||||
const FIELD_BOX_BELOW: f64 = 0.345;
|
||||
const FIELD_BOX_ABOVE: f64 = 1.19;
|
||||
use crate::entities::field::{BOX_ABOVE as FIELD_BOX_ABOVE, BOX_BELOW as FIELD_BOX_BELOW};
|
||||
|
||||
/// FIELDDISPLAY boxes: each field's shown text, one box per line it spans,
|
||||
/// placed from the text layout itself, in the text's own (rotated) frame —
|
||||
|
||||
@@ -3695,6 +3695,20 @@ impl Scene {
|
||||
}
|
||||
}
|
||||
}
|
||||
// An edited table lets go of its block; rebuild it from the cells so
|
||||
// the drawing shows and saves the cell texts and grid it now holds.
|
||||
let mut rebuilt_table_block = false;
|
||||
for (handle, kind) in &changes {
|
||||
if !matches!(kind, ChangeKind::Removed)
|
||||
&& matches!(self.document.get_entity(*handle), Some(EntityType::Table(t)) if t.block_record_handle.is_none())
|
||||
{
|
||||
rebuilt_table_block |= self.document.refresh_table_block(*handle);
|
||||
rebuilt_table_block |= !crate::entities::field::refresh_table_formulas(&mut self.document, *handle).is_empty();
|
||||
}
|
||||
}
|
||||
if rebuilt_table_block {
|
||||
self.block_epoch = GEOMETRY_EPOCH.fetch_add(1, Ordering::Relaxed);
|
||||
}
|
||||
if !changes.is_empty() {
|
||||
self.refresh_dependency_index_for_changes(&changes);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user