Skip to content

Commit c6f1ed2

Browse files
committed
added Test for EllipticalArcLineSegment
1 parent 03e430f commit c6f1ed2

2 files changed

Lines changed: 29 additions & 3 deletions

File tree

src/ImageSharp.Drawing/Shapes/EllipticalArcLineSegment.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ public sealed class EllipticalArcLineSegment : ILineSegment
2929
/// <param name="center"> The center point of the ellipsis that the arc is a part of</param>
3030
/// <param name="firstRadius">First radius of the ellipsis</param>
3131
/// <param name="secondRadius">Second radius of the ellipsis</param>
32-
/// <param name="rotation">The rotation of First radius to the X-Axis</param>
33-
/// <param name="startAngle">The Start angle of the ellipsis</param>
34-
/// <param name="sweepAngle"> The sweeping angle of the arc</param>
32+
/// <param name="rotation">The rotation of First radius to the X-Axis in degree</param>
33+
/// <param name="startAngle">The Start angle of the ellipsis in degree </param>
34+
/// <param name="sweepAngle"> The sweeping angle of the arc in degree</param>
3535
/// <param name="transformation">The TRanformation matrix, that should be used on the arc</param>
3636
public EllipticalArcLineSegment(PointF center, float firstRadius, float secondRadius, float rotation, float startAngle, float sweepAngle, Matrix3x2 transformation)
3737
{
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// Copyright (c) Six Labors.
2+
// Licensed under the Apache License, Version 2.0.
3+
4+
using System;
5+
using System.Collections.Generic;
6+
using System.Numerics;
7+
using System.Text;
8+
using Xunit;
9+
10+
namespace SixLabors.ImageSharp.Drawing.Tests
11+
{
12+
public class EllipticalArcLineSegmentTest
13+
{
14+
[Fact]
15+
public void ContainsStartandEnd()
16+
{
17+
var segment = new EllipticalArcLineSegment(new PointF(10, 10), 10, 20, 0, 0, 90, Matrix3x2.Identity);
18+
IReadOnlyList<PointF> points = segment.Flatten().ToArray();
19+
Assert.Equal((double)points[0].X, 10, 5);
20+
Assert.Equal((double)points[0].Y, 30, 5);
21+
Assert.Equal((double)segment.EndPoint.X, 20, 5);
22+
Assert.Equal((double)segment.EndPoint.Y, 10, 5);
23+
24+
}
25+
}
26+
}

0 commit comments

Comments
 (0)