fix(commands): ADDSELECTED keeps CLAYER, adopts dimension style (#239)

Two follow-ups to ADDSELECTED:

- It no longer permanently changes the current layer/colour/linetype/
  lineweight. The template's properties are captured as the drawing
  defaults only while the launched draw command runs; a snapshot taken in
  cmd_add_selected is restored the moment that command ends (central hook
  in apply_cmd_result) or is interrupted by another command.
- Dimensions are supported: add_selected_verb maps each DimensionType to
  its DIM* command, and the template's dimension style is adopted as the
  current DIMSTYLE (restored afterwards). commit_entity_handle now stamps
  every new dimension with the current DIMSTYLE — the DIM commands left the
  default "Standard" on the entity, so a normal dimension also picks up
  the active style now.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Hakan SevenandClaude Opus 4.8 committed 2026-07-03 16:05:54 +03:00
1 parent f9b6834ad9
commit 5e4e7c1020
5 files changed
+145 -4

No files matched your search

+3
View File
@@ -66,6 +66,9 @@ impl OpenCADStudio {
if self.tabs[i].active_cmd.is_some() {
self.tabs[i].scene.clear_preview_wire();
self.tabs[i].active_cmd = None;
// Interrupting an ADDSELECTED draw with another command reverts its
// template-property override too (#239).
self.restore_add_selected_defaults();
}
// Starting any command leaves interactive PAN mode (the PAN arm below
// re-enables it).