Skip to content

Commit 03e430f

Browse files
committed
added test for AddEllipticalArc
1 parent c90e14d commit 03e430f

2 files changed

Lines changed: 15 additions & 5 deletions

File tree

src/ImageSharp.Drawing/Shapes/PathBuilder.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -205,14 +205,14 @@ public PathBuilder AddBezier(PointF startPoint, PointF controlPoint1, PointF con
205205
/// <param name="center">center point of the arc</param>
206206
/// <param name="firstRadius">first radius</param>
207207
/// <param name="secondRadius">second radius</param>
208-
/// <param name="rotation">rotation of the first radius to the x Axis</param>
209-
/// <param name="startAngle">starting angle of arc</param>
210-
/// <param name="sweepAngle">sweeping angel of the arc</param>
208+
/// <param name="rotation">rotation of the first radius to the x Axis in degree</param>
209+
/// <param name="startAngle">starting angle of arc in degree</param>
210+
/// <param name="sweepAngle">sweeping angel of the arc in degree</param>
211211
/// <returns>The <see cref="PathBuilder"/></returns>
212212
public PathBuilder AddEllipticalArc(PointF center, float firstRadius, float secondRadius, float rotation, float startAngle, float sweepAngle)
213213
{
214-
EllipticalArcLineSegment arc = new EllipticalArcLineSegment(center, firstRadius, secondRadius, rotation, startAngle, sweepAngle, this.currentTransform);
215-
this.currentFigure.AddSegment(arc);
214+
this.currentFigure.AddSegment(new EllipticalArcLineSegment(center, firstRadius, secondRadius, rotation, startAngle, sweepAngle, this.currentTransform));
215+
216216
return this;
217217
}
218218

tests/ImageSharp.Drawing.Tests/Shapes/PathBuilderTests.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,16 @@ public void AddBezier()
3232
Assert.IsType<Path>(builder.Build());
3333
}
3434

35+
[Fact]
36+
public void AddEllipticArc()
37+
{
38+
var builder = new PathBuilder();
39+
40+
builder.AddEllipticalArc(new PointF(10, 10), 10, 10, 0, 0, 360);
41+
42+
Assert.IsType<Path>(builder.Build());
43+
}
44+
3545
[Fact]
3646
public void DrawLinesOpenFigure()
3747
{

0 commit comments

Comments
 (0)