Simplify transform loop in CubicBezierLineSegment

This commit is contained in:
Jason Nelson 2018-08-24 09:39:16 -07:00
Родитель 99c348c5e6
Коммит 707c66e429
1 изменённых файлов: 6 добавлений и 6 удалений

Просмотреть файл

@ -64,7 +64,7 @@ namespace SixLabors.Shapes
/// <value>
/// The end point.
/// </value>
public PointF EndPoint { get; private set; }
public PointF EndPoint { get; }
/// <summary>
/// Returns the current <see cref="ILineSegment" /> a simple linear path.
@ -90,14 +90,14 @@ namespace SixLabors.Shapes
return this;
}
var points = new PointF[this.controlPoints.Length];
int i = 0;
foreach (PointF p in this.controlPoints)
var transformedPoints = new PointF[this.controlPoints.Length];
for (int i = 0; i < this.controlPoints.Length; i++)
{
points[i++] = PointF.Transform(p, matrix);
transformedPoints[i] = PointF.Transform(this.controlPoints[i], matrix);
}
return new CubicBezierLineSegment(points);
return new CubicBezierLineSegment(transformedPoints);
}
/// <summary>