зеркало из https://github.com/SixLabors/Shapes.git
Simplify transform loop in CubicBezierLineSegment
This commit is contained in:
Родитель
99c348c5e6
Коммит
707c66e429
|
@ -64,7 +64,7 @@ namespace SixLabors.Shapes
|
||||||
/// <value>
|
/// <value>
|
||||||
/// The end point.
|
/// The end point.
|
||||||
/// </value>
|
/// </value>
|
||||||
public PointF EndPoint { get; private set; }
|
public PointF EndPoint { get; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns the current <see cref="ILineSegment" /> a simple linear path.
|
/// Returns the current <see cref="ILineSegment" /> a simple linear path.
|
||||||
|
@ -90,14 +90,14 @@ namespace SixLabors.Shapes
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
var points = new PointF[this.controlPoints.Length];
|
var transformedPoints = new PointF[this.controlPoints.Length];
|
||||||
int i = 0;
|
|
||||||
foreach (PointF p in this.controlPoints)
|
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>
|
/// <summary>
|
||||||
|
|
Загрузка…
Ссылка в новой задаче