Skip to content

Commit 2c6eefd

Browse files
committed
fixed Point Calculation with Matrix
1 parent b84ef0d commit 2c6eefd

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/ImageSharp.Drawing/Shapes/EllipticalArcLineSegment.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ public EllipticalArcLineSegment(PointF center, float firstRadius, float secondRa
4545
this.secondRadius = secondRadius;
4646
this.rotation = rotation % 360;
4747
this.startAngle = startAngle % 360;
48+
this.transformation = transformation;
4849
this.sweepAngle = sweepAngle;
4950
if (sweepAngle > 360)
5051
{
@@ -53,7 +54,6 @@ public EllipticalArcLineSegment(PointF center, float firstRadius, float secondRa
5354

5455
this.linePoints = this.GetDrawingPoints();
5556
this.EndPoint = this.linePoints[this.linePoints.Length - 1];
56-
this.transformation = transformation;
5757
}
5858

5959
/// <summary>
@@ -136,7 +136,8 @@ private PointF CalculatePoint(float angle)
136136
{
137137
float x = (this.firstRadius * MathF.Sin(MathF.PI * angle / 180) * MathF.Cos(MathF.PI * this.rotation / 180)) - (this.secondRadius * MathF.Cos(MathF.PI * angle / 180) * MathF.Sin(MathF.PI * this.rotation / 180)) + this.center.X;
138138
float y = (this.firstRadius * MathF.Sin(MathF.PI * angle / 180) * MathF.Sin(MathF.PI * this.rotation / 180)) + (this.secondRadius * MathF.Cos(MathF.PI * angle / 180) * MathF.Cos(MathF.PI * this.rotation / 180)) + this.center.Y;
139-
return PointF.Transform(new PointF(x, y), this.transformation);
139+
var currPoint = new PointF(x, y);
140+
return PointF.Transform(currPoint, this.transformation);
140141
}
141142

142143
/// <summary>

0 commit comments

Comments
 (0)