fix: correct Size width/length axis mapping throughout codebase
The Size fix (d4222db) changed Size.Width to Y axis and Size.Length to
X axis but only updated DrawPlate/LayoutViewGL. BoundingBox, WorkArea,
rotations, DXF export, and engine code still used the old Width=X
convention, causing the fill engine to get a swapped work area (60x120
instead of 120x60) and parts to fill in the wrong direction.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -205,7 +205,7 @@ namespace OpenNest.Controls
|
||||
|
||||
public virtual void ZoomToArea(Box box, bool redraw = true)
|
||||
{
|
||||
ZoomToArea(box.X, box.Y, box.Length, box.Width, redraw);
|
||||
ZoomToArea(box.X, box.Y, box.Width, box.Length, redraw);
|
||||
}
|
||||
|
||||
public virtual void ZoomToArea(double x, double y, double width, double height, bool redraw = true)
|
||||
|
||||
@@ -435,24 +435,24 @@ namespace OpenNest.Controls
|
||||
break;
|
||||
|
||||
case 2:
|
||||
plateRect.Location = PointWorldToGraph(-Plate.Size.Width, 0);
|
||||
plateRect.Location = PointWorldToGraph(-Plate.Size.Length, 0);
|
||||
edgeSpacingRect.Location = PointWorldToGraph(
|
||||
Plate.EdgeSpacing.Left - Plate.Size.Width,
|
||||
Plate.EdgeSpacing.Left - Plate.Size.Length,
|
||||
Plate.EdgeSpacing.Bottom);
|
||||
break;
|
||||
|
||||
case 3:
|
||||
plateRect.Location = PointWorldToGraph(-Plate.Size.Width, -Plate.Size.Length);
|
||||
plateRect.Location = PointWorldToGraph(-Plate.Size.Length, -Plate.Size.Width);
|
||||
edgeSpacingRect.Location = PointWorldToGraph(
|
||||
Plate.EdgeSpacing.Left - Plate.Size.Width,
|
||||
Plate.EdgeSpacing.Bottom - Plate.Size.Length);
|
||||
Plate.EdgeSpacing.Left - Plate.Size.Length,
|
||||
Plate.EdgeSpacing.Bottom - Plate.Size.Width);
|
||||
break;
|
||||
|
||||
case 4:
|
||||
plateRect.Location = PointWorldToGraph(0, -Plate.Size.Length);
|
||||
plateRect.Location = PointWorldToGraph(0, -Plate.Size.Width);
|
||||
edgeSpacingRect.Location = PointWorldToGraph(
|
||||
Plate.EdgeSpacing.Left,
|
||||
Plate.EdgeSpacing.Bottom - Plate.Size.Length);
|
||||
Plate.EdgeSpacing.Bottom - Plate.Size.Width);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
@@ -77,7 +77,7 @@ namespace OpenNest.Forms
|
||||
var sw = Stopwatch.StartNew();
|
||||
|
||||
var all = BestFitCache.GetOrCompute(
|
||||
drawing, plate.Size.Width, plate.Size.Length, plate.PartSpacing);
|
||||
drawing, plate.Size.Length, plate.Size.Width, plate.PartSpacing);
|
||||
|
||||
computeSeconds = sw.ElapsedMilliseconds / 1000.0;
|
||||
totalResults = all.Count;
|
||||
|
||||
Reference in New Issue
Block a user