fix: restore SelectedParts after plate switch in ActionClone

SetPlate clears SelectedParts, which broke bounds drawing and rotation
for surviving actions. Add OnPlateChanged hook so ActionClone can
re-populate SelectedParts after a plate switch.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-07 10:11:22 -05:00
parent fd778e2fd2
commit 0b2100a661
3 changed files with 10 additions and 0 deletions

View File

@@ -13,6 +13,8 @@ namespace OpenNest.Actions
public virtual bool SurvivesPlateChange => false;
public virtual void OnPlateChanged() { }
public abstract void DisconnectEvents();
public abstract void CancelAction();

View File

@@ -100,6 +100,12 @@ namespace OpenNest.Actions
public override bool SurvivesPlateChange => true;
public override void OnPlateChanged()
{
plateView.SelectedParts.Clear();
plateView.SelectedParts.AddRange(parts);
}
public override void DisconnectEvents()
{
plateView.KeyDown -= plateView_KeyDown;

View File

@@ -129,6 +129,8 @@ namespace OpenNest.Controls
if (currentAction == null || !currentAction.SurvivesPlateChange)
SetAction(typeof(ActionSelect));
else
currentAction.OnPlateChanged();
}
public string Status