Fix best-fit viewer bounds for angled pairs

This commit is contained in:
2026-05-18 22:17:47 -04:00
parent 27f0685058
commit da77cc9270
4 changed files with 143 additions and 3 deletions
+4 -2
View File
@@ -45,6 +45,7 @@ namespace OpenNest.Forms
public BestFitResult SelectedResult { get; private set; }
public Drawing SelectedDrawing => activeDrawing;
public List<Part> SelectedParts { get; private set; }
public BestFitViewerForm(DrawingCollection drawings, Plate plate, Units units = Units.Inches)
{
@@ -318,12 +319,12 @@ namespace OpenNest.Forms
var cell = new BestFitCell(colorScheme);
cell.PartColor = partColor;
cell.Dock = DockStyle.Fill;
var parts = result.BuildCanonicalParts();
cell.Plate.Size = new Geometry.Size(
result.BoundingHeight,
result.BoundingWidth);
var parts = result.BuildParts(drawing);
foreach (var part in parts)
cell.Plate.Parts.Add(part);
@@ -332,6 +333,7 @@ namespace OpenNest.Forms
cell.DoubleClick += (sender, e) =>
{
SelectedResult = result;
SelectedParts = result.BuildSourceParts(drawing);
DialogResult = DialogResult.OK;
Close();
};
+2 -1
View File
@@ -686,7 +686,8 @@ namespace OpenNest.Forms
{
if (form.ShowDialog(this) == DialogResult.OK && form.SelectedResult != null)
{
var parts = form.SelectedResult.BuildParts(form.SelectedDrawing);
var parts = form.SelectedParts
?? form.SelectedResult.BuildSourceParts(form.SelectedDrawing);
activeForm.PlateView.SetAction(typeof(ActionClone), parts);
}
}