Feat: PASTEORIG command — paste clipboard at original coordinates

Pastes clipboard entities without translating to a pick point.
Useful for pasting between drawings at exact original positions.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Hakan Seven 2026-04-03 09:27:21 +03:00
commit a9aedb4c7c

View file

@ -336,6 +336,23 @@ impl H7CAD {
} }
} }
// PASTEORIG — paste at original coordinates (no move to pick point)
"PASTEORIG" => {
if self.clipboard.is_empty() {
self.command_line.push_error("PASTEORIG: clipboard is empty.");
} else {
let count = self.clipboard.len();
self.push_undo_snapshot(i, "PASTEORIG");
for entity in &self.clipboard {
self.tabs[i].scene.add_entity(entity.clone());
}
self.tabs[i].dirty = true;
self.command_line.push_output(&format!(
"PASTEORIG: {} object(s) pasted at original coordinates.", count
));
}
}
"BLOCK" => { "BLOCK" => {
let handles: Vec<_> = self.tabs[i] let handles: Vec<_> = self.tabs[i]
.scene.selected_entities().into_iter().map(|(h, _)| h).collect(); .scene.selected_entities().into_iter().map(|(h, _)| h).collect();