mirror of
https://github.com/ajisaacs/OpenNest.git
synced 2026-11-29 18:11:35 -05:00
fix: preserve ActionClone across plate switches
SetPlate unconditionally reset the action to ActionSelect, clearing the clone pattern when switching plates. Add SurvivesPlateChange virtual property to Action base class so actions can opt in to persisting across plate changes. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
40b40ca4ba
commit
fd778e2fd2
3 files changed
+6
-1
No files matched your search
@@ -11,6 +11,8 @@ namespace OpenNest.Actions
|
||||
this.plateView = plateView;
|
||||
}
|
||||
|
||||
public virtual bool SurvivesPlateChange => false;
|
||||
|
||||
public abstract void DisconnectEvents();
|
||||
|
||||
public abstract void CancelAction();
|
||||
|
||||
@@ -98,6 +98,8 @@ namespace OpenNest.Actions
|
||||
plateView.Invalidate();
|
||||
}
|
||||
|
||||
public override bool SurvivesPlateChange => true;
|
||||
|
||||
public override void DisconnectEvents()
|
||||
{
|
||||
plateView.KeyDown -= plateView_KeyDown;
|
||||
|
||||
@@ -127,7 +127,8 @@ namespace OpenNest.Controls
|
||||
foreach (var part in plate.Parts)
|
||||
parts.Add(LayoutPart.Create(part, this));
|
||||
|
||||
SetAction(typeof(ActionSelect));
|
||||
if (currentAction == null || !currentAction.SurvivesPlateChange)
|
||||
SetAction(typeof(ActionSelect));
|
||||
}
|
||||
|
||||
public string Status
|
||||
|
||||
Reference in new issue
Block a user