Commit Graph
3 Commits
Author SHA1 Message Date
aj c00ae58ac0 feat(desktop): share the place tool for cut and copied parts
Port the WinForms Clone Parts action as the toolkit-neutral PlaceTool:
copies of the sources follow the pointer by their lower-left corner (a
move to the same screen point is ignored, keeping arrow-key nudges), and
each left click places another copy as one Add Part/Add Parts step.
Shift settles toward the quadrant corner on geometry, Ctrl alone on
bounding boxes, reading the placement order at each click. Copied
common-line groups are joined again among the copies and cut-offs are
rebuilt. Delete removes the sources plus selected plate parts in one
Delete step, recorded (and cut-offs rebuilt) only when any were on the
plate. Settling runs before the step opens, so a failure there leaves
nothing to roll back; the copy does not follow the pointer while edits
are locked, as WinForms raises no mouse move then.

PlateClipboard.Copy/Cut start the tool with the selected parts; Cut then
removes the sources as one Cut step without rebuilding cut-offs, as
WinForms does.

While placing, PlateEdits nudges, steps, pushes and rotates the previews
instead of the selection. Unlike WinForms, which records an empty undo
step there, these edits open no undo step, and they never rebuild
cut-offs since the previews are not on the plate.
2026-11-17 16:11:14 -05:00
aj 203945dabf feat(desktop): share part delete, nudge, push, rotate and drag-move edits
PlateEdits ports the WinForms plate view's edits of the selection, with
its undo labels and coalescing: Delete (parts and cut-offs, cut-offs
regenerated once when the plate has any), Nudge by the offset increment
or one repeat step, Push to contact, Rotate about the selection's
centre keeping its lower-left corner (a quarter turn, or by wheel
notches at 10 degrees or a tenth of that), repeated nudges and wheel
turns undoing as one step.

The Select tool drags the selection as one Move step. Cut-offs
regenerate when a drag actually moved parts (WinForms also does it on a
plain click, adding an extra undo step); the regeneration runs before
the step completes, so a failure rolls the drag back, and a view that
loses the pointer mid-drag ends the move as a release would, keeping
the selection.

A plate tool host now has to supply its undo wiring, the nest's cut-off
settings and an edits lock (WinForms EditsLocked): while locked no edit
runs and no press selects or starts a move.
2026-11-14 20:26:01 -05:00
ajandClaude Opus 5.5 313b5f57d6 feat(desktop): add a toolkit-neutral plate tool and selection model
PlateToolManager keeps one active tool with the WinForms action rules
(Escape cancels, then returns to Select, then resumes the ended tool) and
status text. SelectTool selects by click, Ctrl+click and window
(contains/intersect), takes common-line groups together and picks
cut-offs by their strokes. PlateHitTester hit-tests the shared display
geometry; PlateSelection reads and sets by part index.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 19:30:47 -05:00