Fix best-fit viewer bounds for angled pairs
This commit is contained in:
@@ -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();
|
||||
};
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user