forked from 1b-agent/opencadstudio-upstream
Fields: table cells keep stored values, UPDATEFIELD reaches blocks and tables, measured shading box
Table cell fields show their stored value; only formula cells evaluate live. UPDATEFIELD on a block reference also updates the fields of its block definition, and on a table the fields of its cells; a changed table cell text redraws the table. The FIELDDISPLAY box is placed from the text layout (MTEXT layout cells, TEXT / attribute pen advances) and spans 0.345 text heights below the baseline to 1.19 above it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
1c242eb489
commit
383eba14e5
8 files changed
+134
-95
No files matched your search
@@ -29,11 +29,23 @@ impl OpenCADStudio {
|
||||
self.tabs[i].active_cmd = Some(Box::new(cmd));
|
||||
return Some(Task::none());
|
||||
}
|
||||
// A block reference brings its attributes and the fields of its
|
||||
// block definition; a table, the texts of its cells.
|
||||
let document = &self.tabs[i].scene.document;
|
||||
let mut hosts = selected.clone();
|
||||
for handle in &selected {
|
||||
if let Some(codec::EntityType::Insert(insert)) = document.get_entity(*handle) {
|
||||
hosts.extend(insert.attributes.iter().map(|a| a.common.handle));
|
||||
let record = match document.get_entity(*handle) {
|
||||
Some(codec::EntityType::Insert(insert)) => {
|
||||
hosts.extend(insert.attributes.iter().map(|a| a.common.handle));
|
||||
document.block_records.iter().find(|r| r.name.eq_ignore_ascii_case(&insert.block_name))
|
||||
}
|
||||
Some(codec::EntityType::Table(table)) => table
|
||||
.block_record_handle
|
||||
.and_then(|h| document.block_records.iter().find(|r| r.handle == h)),
|
||||
_ => None,
|
||||
};
|
||||
if let Some(record) = record {
|
||||
hosts.extend(record.entity_handles.iter().copied());
|
||||
}
|
||||
}
|
||||
self.push_undo_snapshot(i, "UPDATEFIELD");
|
||||
|
||||
Reference in new issue
Block a user