Ensure TargetLineRenderable width and marker size don't get lost.

By making the constructor take non-optional parameters, this highlights some calls sites which were forgetting to set these values. These are now fixed.

Set the path debug to have a marker size of 2 for better visibility.
This commit is contained in:
RoosterDragon
2021-09-25 12:57:27 +01:00
committed by Paul Chote
parent 9d4d4bb924
commit 3a7aeb5324
3 changed files with 5 additions and 5 deletions

View File

@@ -22,7 +22,7 @@ namespace OpenRA.Graphics
readonly int width;
readonly int markerSize;
public TargetLineRenderable(IEnumerable<WPos> waypoints, Color color, int width = 1, int markerSize = 1)
public TargetLineRenderable(IEnumerable<WPos> waypoints, Color color, int width, int markerSize)
{
this.waypoints = waypoints;
this.color = color;
@@ -34,13 +34,13 @@ namespace OpenRA.Graphics
public int ZOffset => 0;
public bool IsDecoration => true;
public IRenderable WithZOffset(int newOffset) { return new TargetLineRenderable(waypoints, color); }
public IRenderable WithZOffset(int newOffset) { return this; }
public IRenderable OffsetBy(in WVec vec)
{
// Lambdas can't use 'in' variables, so capture a copy for later
var offset = vec;
return new TargetLineRenderable(waypoints.Select(w => w + offset), color);
return new TargetLineRenderable(waypoints.Select(w => w + offset), color, width, markerSize);
}
public IRenderable AsDecoration() { return this; }