forked from 1b-agent/opencadstudio-upstream
Add bounding-box object alignment (ALIGNLEFT/TOP/etc.), ported from Mac2CAM
Six one-shot alignment commands for the current selection — ALIGNLEFT/ALIGNHCENTER/ALIGNRIGHT/ALIGNTOP/ALIGNVCENTER/ALIGNBOTTOM — distinct from the existing point-picking ALIGN/ALIGN3D command: each nudges every selected object (or complete group, via new Scene::selected_object_units) so its bounding-box edge/center lines up with the extreme edge/center already present in the selection, closer to a word processor's "align objects" than AutoCAD's 3-point ALIGN. Wired as plain one-click Tool entries in the Modify extension panel, next to the existing ALIGN entry, matching that panel's flat-list convention (no point prompts, so no dropdown submenu needed). Co-Authored-By: Claude Sonnet 5 <[email protected]>
This commit is contained in:
1 parent
59ae38ae1a
commit
0f739b459d
10 files changed
+329
No files matched your search
@@ -304,6 +304,14 @@ impl AlignCommand {
|
||||
}
|
||||
|
||||
inventory::submit!(crate::command::CommandRegistration { names: &["ALIGN"] }); // AlignCommand
|
||||
// ALIGNLEFT/ALIGNHCENTER/ALIGNRIGHT/ALIGNTOP/ALIGNVCENTER/ALIGNBOTTOM: one-shot
|
||||
// bounding-box alignment, dispatched directly (no CadCommand of their own) by
|
||||
// `OpenCADStudio::align_selected_bounds` in `src/app/commands/inquiry.rs`.
|
||||
inventory::submit!(crate::command::CommandRegistration {
|
||||
names: &[
|
||||
"ALIGNLEFT", "ALIGNHCENTER", "ALIGNRIGHT", "ALIGNTOP", "ALIGNVCENTER", "ALIGNBOTTOM",
|
||||
],
|
||||
});
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
|
||||
Reference in new issue
Block a user