fix: draw rapid move to hole center before sub-program lead-in

The rapid from the previous feature to the hole center is implied by
the SubProgramCall offset but wasn't being drawn. Now DrawRapids
renders this traverse before recursing into the sub-program.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-09 17:46:44 -04:00
parent 92461deb98
commit 5c918a0978

View File

@@ -433,7 +433,15 @@ namespace OpenNest.Controls
if (program != null)
{
var savedPos = pos;
pos = new Vector(savedPos.X + subpgm.Offset.X, savedPos.Y + subpgm.Offset.Y);
var holePos = new Vector(savedPos.X + subpgm.Offset.X, savedPos.Y + subpgm.Offset.Y);
// Draw rapid from current position to hole center
if (!(skipFirstRapid && !firstRapidSkipped))
DrawLine(g, pos, holePos, view.ColorScheme.RapidPen);
else
firstRapidSkipped = true;
pos = holePos;
DrawRapids(g, program, ref pos);
pos = savedPos;
}