refactor: update PlateRenderer for SelectionManager cut-off list
PlateRenderer now checks Selection.SelectedCutOffs.Contains() instead of comparing against a single SelectedCutOff property. Remove temporary SelectedCutOff shim from PlateView and unused Designer assignment. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -168,7 +168,7 @@ namespace OpenNest.Controls
|
|||||||
if (program == null || program.Codes.Count == 0)
|
if (program == null || program.Codes.Count == 0)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
var activePen = cutoff == view.SelectedCutOff ? selectedPen : pen;
|
var activePen = view.Selection.SelectedCutOffs.Contains(cutoff) ? selectedPen : pen;
|
||||||
|
|
||||||
for (var i = 0; i < program.Codes.Count - 1; i += 2)
|
for (var i = 0; i < program.Codes.Count - 1; i += 2)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -179,18 +179,6 @@ namespace OpenNest.Controls
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Temporary — removed in Task 5
|
|
||||||
public CutOff SelectedCutOff
|
|
||||||
{
|
|
||||||
get => selection.SelectedCutOffs.Count > 0 ? selection.SelectedCutOffs[0] : null;
|
|
||||||
set
|
|
||||||
{
|
|
||||||
selection.SelectedCutOffs.Clear();
|
|
||||||
if (value != null)
|
|
||||||
selection.SelectedCutOffs.Add(value);
|
|
||||||
Invalidate();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public double RotateIncrementAngle { get; set; }
|
public double RotateIncrementAngle { get; set; }
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -427,7 +427,7 @@ namespace OpenNest.Forms
|
|||||||
plate1.Quantity = 0;
|
plate1.Quantity = 0;
|
||||||
previewPlateView.Plate = plate1;
|
previewPlateView.Plate = plate1;
|
||||||
previewPlateView.RotateIncrementAngle = 10D;
|
previewPlateView.RotateIncrementAngle = 10D;
|
||||||
previewPlateView.SelectedCutOff = null;
|
|
||||||
previewPlateView.ShowBendLines = false;
|
previewPlateView.ShowBendLines = false;
|
||||||
previewPlateView.Size = new System.Drawing.Size(356, 341);
|
previewPlateView.Size = new System.Drawing.Size(356, 341);
|
||||||
previewPlateView.Status = "Select";
|
previewPlateView.Status = "Select";
|
||||||
|
|||||||
Reference in New Issue
Block a user