Skip to content

Commit 3a7bece

Browse files
author
Chris Jakeman
committed
Corrected zig-zag red path lines in Dispatcher Tab
1 parent d7a1405 commit 3a7bece

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Source/RunActivity/Viewer3D/Debugging/DebugViewerForm.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1154,9 +1154,10 @@ public void DrawTrainPath(Train train, float subX, float subY, Pen pathPen, Grap
11541154
if (stepDistance + stepLength >= initialNodeOffset && stepDistance <= initialNodeOffset + DisplayDistance)
11551155
{
11561156
var currentLocation = currentPosition.WorldLocation;
1157-
scaledA.X = (previousLocation.TileX * 2048 + previousLocation.Location.X - subX) * xScale; scaledA.Y = pbCanvas.Height - (previousLocation.TileZ * 2048 + previousLocation.Location.Z - subY) * yScale;
1158-
scaledB.X = (currentLocation.TileX * 2048 + currentLocation.Location.X - subX) * xScale; scaledB.Y = pbCanvas.Height - (currentPosition.TileZ * 2048 + currentPosition.Location.Z - subY) * yScale;
1159-
g.DrawLine(pathPen, scaledA, scaledB);
1157+
scaledA.X = (float)((previousLocation.TileX * WorldLocation.TileSize + previousLocation.Location.X - subX) * xScale);
1158+
scaledA.Y = (float)(pbCanvas.Height - (previousLocation.TileZ * WorldLocation.TileSize + previousLocation.Location.Z - subY) * yScale);
1159+
scaledB.X = (float)((currentLocation.TileX * WorldLocation.TileSize + currentLocation.Location.X - subX) * xScale);
1160+
scaledB.Y = (float)(pbCanvas.Height - (currentPosition.TileZ * WorldLocation.TileSize + currentPosition.Location.Z - subY) * yScale); g.DrawLine(pathPen, scaledA, scaledB);
11601161
}
11611162
}
11621163
lastObjDistance = obj.Distance;

0 commit comments

Comments
 (0)