Merge pull request #1184 from Ramox81/codex/hatchedit-command-parity

This commit is contained in:
Hakan Seven committed 2026-09-11 15:14:43 +03:00
commit 753fa17b68
24 files changed
+926 -132

No files matched your search

+11 -1
View File
@@ -1387,6 +1387,7 @@ impl OpenCADStudio {
crate::entities::names::dxf_name(e).to_string(),
c.layer.clone(),
c.color,
c.transparency,
c.linetype.clone(),
c.linetype_scale,
c.line_weight,
@@ -1398,7 +1399,7 @@ impl OpenCADStudio {
},
)
});
let Some((verb, kind, layer, color, linetype, lt_scale, lw, template_dimstyle)) = info
let Some((verb, kind, layer, color, transparency, linetype, lt_scale, lw, template_dimstyle)) = info
else {
self.command_line
.push_error(crate::t!("ADDSELECTED: selected object not found.").as_ref());
@@ -1422,6 +1423,7 @@ impl OpenCADStudio {
layer_name: self.tabs[i].scene.document.header.current_layer_name.clone(),
layer_handle: self.tabs[i].scene.document.header.current_layer_handle,
color: self.tabs[i].scene.document.header.current_entity_color,
transparency: self.tabs[i].scene.document.current_entity_transparency(),
linetype_name: self.tabs[i].scene.document.header.current_linetype_name.clone(),
linetype_handle: self.tabs[i].scene.document.header.current_linetype_handle,
line_weight: self.tabs[i].scene.document.header.current_line_weight,
@@ -1436,6 +1438,11 @@ impl OpenCADStudio {
ribbon_lineweight: self.ribbon.active_lineweight,
};
self.add_selected_restore = Some(restore);
if !self.tabs[i].scene.document.set_current_entity_transparency(transparency) {
self.add_selected_restore = None;
self.command_line.push_error("ADDSELECTED: template transparency cannot be adopted.");
return Task::none();
}
// Adopt the template's general properties as the current defaults. The
// entity-creation path stamps new objects from the tab's active layer
@@ -1518,6 +1525,9 @@ impl OpenCADStudio {
h.current_dimstyle_name = r.dimstyle_name;
h.current_dimstyle_handle = r.dimstyle_handle;
}
if !self.tabs[i].scene.document.set_current_entity_transparency(r.transparency) {
self.command_line.push_error("ADDSELECTED: current transparency could not be restored.");
}
self.tabs[i].active_layer = r.tab_active_layer;
self.tabs[i].layers.current_layer = r.tab_layers_current;
self.ribbon.active_layer = r.ribbon_layer;