diff --git a/src/SixLabors.Shapes/CubicBezierLineSegment.cs b/src/SixLabors.Shapes/CubicBezierLineSegment.cs index 2ba428d..0d34f31 100644 --- a/src/SixLabors.Shapes/CubicBezierLineSegment.cs +++ b/src/SixLabors.Shapes/CubicBezierLineSegment.cs @@ -64,7 +64,7 @@ namespace SixLabors.Shapes /// /// The end point. /// - public PointF EndPoint { get; private set; } + public PointF EndPoint { get; } /// /// Returns the current 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); } ///