feat: allow re-selecting parts with existing lead-ins and use magenta preview

Remove LeadInsLocked guard so parts can be re-selected for lead-in
re-placement. Change preview color from yellow to magenta for better
visibility against the cyan contour highlight.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-31 17:37:31 -04:00
parent c1f1c829dc
commit 5a9a06a6a0

View File

@@ -224,12 +224,12 @@ namespace OpenNest.Actions
var pt1 = plateView.PointWorldToGraph(worldPierce);
var pt2 = plateView.PointWorldToGraph(worldSnap);
using var previewPen = new Pen(Color.Yellow, 2.0f / plateView.ViewScale);
using var previewPen = new Pen(Color.Magenta, 2.0f / plateView.ViewScale);
g.DrawLine(previewPen, pt1, pt2);
// Draw a small circle at the pierce point
var radius = 3.0f / plateView.ViewScale;
g.FillEllipse(Brushes.Yellow, pt1.X - radius, pt1.Y - radius, radius * 2, radius * 2);
g.FillEllipse(Brushes.Magenta, pt1.X - radius, pt1.Y - radius, radius * 2, radius * 2);
// Draw a small circle at the contour start point
g.FillEllipse(Brushes.Lime, pt2.X - radius, pt2.Y - radius, radius * 2, radius * 2);
@@ -249,10 +249,6 @@ namespace OpenNest.Actions
if (part.BaseDrawing.IsCutOff)
return;
// If part already has locked lead-ins, don't allow re-placement
if (part.LeadInsLocked)
return;
selectedLayoutPart = layoutPart;
selectedPart = part;