Complete UNION command behavior

This commit is contained in:
ramox81 committed 2026-09-07 11:27:03 +03:00
1 parent 143703d809
commit a59ea47990
11 files changed
+503 -75

No files matched your search

+35 -19
View File
@@ -2591,7 +2591,7 @@ impl OpenCADStudio {
&mut self,
entity: acadrust::EntityType,
) -> Option<Handle> {
self.commit_entity_handle_with_policies(entity, false, false)
self.commit_entity_handle_with_policies(entity, false, false, false)
}
pub(super) fn commit_entity_handle_with_dimension_policy(
@@ -2603,6 +2603,7 @@ impl OpenCADStudio {
entity,
preserve_dimension_layer_and_style,
false,
false,
)
}
@@ -2610,7 +2611,14 @@ impl OpenCADStudio {
&mut self,
entity: acadrust::EntityType,
) -> Option<Handle> {
self.commit_entity_handle_with_policies(entity, false, true)
self.commit_entity_handle_with_policies(entity, false, true, false)
}
pub(super) fn commit_entity_handle_preserve_style(
&mut self,
entity: acadrust::EntityType,
) -> Option<Handle> {
self.commit_entity_handle_with_policies(entity, false, true, true)
}
fn commit_entity_handle_with_policies(
@@ -2618,6 +2626,7 @@ impl OpenCADStudio {
mut entity: acadrust::EntityType,
preserve_dimension_layer_and_style: bool,
preserve_entity_layer: bool,
preserve_entity_style: bool,
) -> Option<Handle> {
let i = self.active_tab;
let tracks_dimension_chain = matches!(
@@ -2735,25 +2744,32 @@ impl OpenCADStudio {
}
}
crate::scene::view::dispatch::apply_color(&mut entity, self.ribbon.active_color);
crate::scene::view::dispatch::apply_common_prop(
&mut entity,
"linetype",
&self.ribbon.active_linetype.clone(),
);
crate::scene::view::dispatch::apply_line_weight(&mut entity, self.ribbon.active_lineweight);
// CELTSCALE (header.current_entity_linetype_scale): new entities
// pick up the document's saved per-entity linetype scale. The user
// can override per entity later via the properties panel.
let celtscale = self.tabs[i].scene.document.header.current_entity_linetype_scale;
if (celtscale - 1.0).abs() > 1e-9 && celtscale.abs() > 1e-9 {
entity.common_mut().linetype_scale = celtscale;
if !preserve_entity_style {
crate::scene::view::dispatch::apply_color(&mut entity, self.ribbon.active_color);
crate::scene::view::dispatch::apply_common_prop(
&mut entity,
"linetype",
&self.ribbon.active_linetype.clone(),
);
crate::scene::view::dispatch::apply_line_weight(
&mut entity,
self.ribbon.active_lineweight,
);
// CELTSCALE (header.current_entity_linetype_scale): new entities
// pick up the document's saved per-entity linetype scale. The user
// can override per entity later via the properties panel.
let celtscale = self.tabs[i].scene.document.header.current_entity_linetype_scale;
if (celtscale - 1.0).abs() > 1e-9 && celtscale.abs() > 1e-9 {
entity.common_mut().linetype_scale = celtscale;
}
}
crate::scene::creation_style::apply_current_creation_styles(
&self.tabs[i].scene.document,
&mut entity,
);
if !preserve_entity_style {
crate::scene::creation_style::apply_current_creation_styles(
&self.tabs[i].scene.document,
&mut entity,
);
}
if let (Some((layer, style_name)), acadrust::EntityType::Dimension(dimension)) =
(inherited_dimension, &mut entity)
{