forked from 1b-agent/opencadstudio-upstream
fix(blocks): unify block-backed content
Route pictures, table cells, leader content, symbols, and arrows through one dependency and transform graph.\n\nRefs #864
This commit is contained in:
1 parent
3a5591e036
commit
19629d1246
12 files changed
+902
-557
No files matched your search
+12
-6
@@ -963,16 +963,22 @@ pub(crate) fn block_cell_inserts(
|
||||
insert.set_x_scale(scale);
|
||||
insert.set_y_scale(scale);
|
||||
insert.set_z_scale(scale);
|
||||
let transform = insert.get_transform();
|
||||
let local_anchor = if has_block_bounds {
|
||||
(block_min + block_max) * 0.5
|
||||
} else {
|
||||
record.base_point
|
||||
crate::scene::render_graph::block_base_point(document, &record.name)
|
||||
};
|
||||
let transformed_base = transform.apply(local_anchor);
|
||||
let transformed_zero = transform.apply(Vector3::ZERO);
|
||||
let transformed_anchor = crate::scene::render_graph::insert_transform(
|
||||
document,
|
||||
&insert,
|
||||
)
|
||||
.apply(local_anchor);
|
||||
insert.insert_point = insert.insert_point
|
||||
- (transformed_base - transformed_zero);
|
||||
+ Vector3::new(
|
||||
position.x as f64 - transformed_anchor.x,
|
||||
position.y as f64 - transformed_anchor.y,
|
||||
position.z as f64 - transformed_anchor.z,
|
||||
);
|
||||
let attribute_definitions: Vec<_> = record
|
||||
.entity_handles
|
||||
.iter()
|
||||
@@ -1001,7 +1007,7 @@ pub(crate) fn block_cell_inserts(
|
||||
AttributeEntity::from_definition(definition, Some(attribute.value.clone()));
|
||||
acadrust::Entity::apply_transform(
|
||||
&mut entity,
|
||||
&insert.get_transform(),
|
||||
&crate::scene::render_graph::insert_transform(document, &insert),
|
||||
);
|
||||
entity.common.handle = table.common.handle;
|
||||
insert.attributes.push(entity);
|
||||
|
||||
Reference in new issue
Block a user