Align BOX properties and history controls

This commit is contained in:
ramox81 committed 2026-08-28 16:36:46 +03:00
1 parent e7eb487cd8
commit 27f648d2bb
4 files changed
+307 -13

No files matched your search

+45
View File
@@ -773,6 +773,7 @@ impl Scene {
handle: Handle,
operation: acadrust::objects::SolidHistoryOperation,
) -> bool {
let box_primitive = matches!(operation, acadrust::objects::SolidHistoryOperation::Box(_));
let Some(graph) = self.document.create_solid_history(handle, operation) else {
return false;
};
@@ -780,9 +781,36 @@ impl Scene {
for node in graph.nodes {
self.record_undo_object_before(node, None);
}
if box_primitive {
let _ = crate::scene::model::solid_history::apply_history_choice(
&mut self.document,
handle,
crate::scene::model::solid_history::PROP_HISTORY,
"None",
);
}
self.sync_solid_reference_point(handle);
true
}
fn sync_solid_reference_point(&mut self, handle: Handle) {
let reference = self
.document
.solid_history_operation(handle)
.and_then(crate::scene::model::solid_history::reference_point);
let Some(reference) = reference else {
return;
};
let Some(EntityType::Solid3D(entity)) = self.document.get_entity_mut(handle) else {
return;
};
entity.point_of_reference = acadrust::types::Vector3::new(
reference.x,
reference.y,
reference.z,
);
}
fn copy_solid_history(&mut self, source: Handle, target: Handle) -> bool {
let Some(graph) = self.document.copy_solid_history(source, target) else {
return false;
@@ -822,6 +850,7 @@ impl Scene {
return false;
};
entity.set_sat_document(&document);
self.sync_solid_reference_point(handle);
self.register_solid_model(handle, body);
true
}
@@ -840,6 +869,7 @@ impl Scene {
return false;
};
entity.set_sat_document(&document);
self.sync_solid_reference_point(handle);
self.register_solid_model(handle, body);
true
}
@@ -894,6 +924,21 @@ impl Scene {
self.rebuild_solid_history(handle, operation)
}
pub fn apply_solid_history_choice(
&mut self,
handle: Handle,
field: &str,
value: &str,
) -> bool {
self.record_solid_history_before(handle);
crate::scene::model::solid_history::apply_history_choice(
&mut self.document,
handle,
field,
value,
)
}
fn apply_solid_history_grip(
&mut self,
handle: Handle,