fix: let DrawRapids track actual tool position through sub-programs

Don't restore pos after SubProgramCall expansion in DrawRapids — the
machine moves from hole to hole sequentially, so rapids should connect
from the previous hole's end to the next hole's center.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-09 18:26:39 -04:00
parent 5c918a0978
commit a6c2235647

View File

@@ -432,8 +432,7 @@ namespace OpenNest.Controls
if (program != null)
{
var savedPos = pos;
var holePos = new Vector(savedPos.X + subpgm.Offset.X, savedPos.Y + subpgm.Offset.Y);
var holePos = new Vector(pos.X + subpgm.Offset.X, pos.Y + subpgm.Offset.Y);
// Draw rapid from current position to hole center
if (!(skipFirstRapid && !firstRapidSkipped))
@@ -443,7 +442,8 @@ namespace OpenNest.Controls
pos = holePos;
DrawRapids(g, program, ref pos);
pos = savedPos;
// Don't restore pos — let it advance so the next hole's
// rapid starts from where this one ended.
}
}
else