Skip to content

Commit 5444072

Browse files
committed
added all AddEllipticalArc Methods with Integer based Parameters
1 parent 5e6ee64 commit 5444072

1 file changed

Lines changed: 41 additions & 1 deletion

File tree

src/ImageSharp.Drawing/Shapes/PathBuilder.cs

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,17 @@ public PathBuilder AddBezier(PointF startPoint, PointF controlPoint1, PointF con
212212
/// <summary>
213213
/// Adds an elliptical arc to the current figure
214214
/// </summary>
215-
/// <param name="center"> The center point of the ellips from which the arc is taken.</param>
215+
/// <param name="rect"> A <see cref="Rectangle"/> that represents the rectangular bounds of the ellipse from which the arc is taken.</param>
216+
/// <param name="rotation">The rotation of (<paramref name="rect"/>, measured in degrees anticlockwise.</param>
217+
/// <param name="startAngle">The Start angle of the ellipsis, measured in degrees anticlockwise from the Y-axis.</param>
218+
/// <param name="sweepAngle"> The angle between (<paramref name="startAngle"/> and the end of the arc. </param>
219+
/// <returns>The <see cref="PathBuilder"/></returns>
220+
public PathBuilder AddEllipticalArc(Rectangle rect, int rotation, int startAngle, int sweepAngle) => this.AddEllipticalArc((float)(rect.Right + rect.Left) / 2, (float)(rect.Bottom + rect.Top) / 2, (float)rect.Width / 2, (float)rect.Height / 2, rotation, startAngle, sweepAngle);
221+
222+
/// <summary>
223+
/// Adds an elliptical arc to the current figure
224+
/// </summary>
225+
/// <param name="center"> The center <see cref="PointF"/> of the ellips from which the arc is taken.</param>
216226
/// <param name="radiusX">X radius of the ellipsis.</param>
217227
/// <param name="radiusY">Y radius of the ellipsis.</param>
218228
/// <param name="rotation">The rotation of (<paramref name="radiusX"/> to the X-axis and (<paramref name="radiusY"/> to the Y-axis, measured in degrees anticlockwise.</param>
@@ -221,6 +231,36 @@ public PathBuilder AddBezier(PointF startPoint, PointF controlPoint1, PointF con
221231
/// <returns>The <see cref="PathBuilder"/></returns>
222232
public PathBuilder AddEllipticalArc(PointF center, float radiusX, float radiusY, float rotation, float startAngle, float sweepAngle) => this.AddEllipticalArc(center.X, center.Y, radiusX, radiusY, rotation, startAngle, sweepAngle);
223233

234+
/// <summary>
235+
/// Adds an elliptical arc to the current figure
236+
/// </summary>
237+
/// <param name="center"> The center <see cref="Point"/> of the ellips from which the arc is taken.</param>
238+
/// <param name="radiusX">X radius of the ellipsis.</param>
239+
/// <param name="radiusY">Y radius of the ellipsis.</param>
240+
/// <param name="rotation">The rotation of (<paramref name="radiusX"/> to the X-axis and (<paramref name="radiusY"/> to the Y-axis, measured in degrees anticlockwise.</param>
241+
/// <param name="startAngle">The Start angle of the ellipsis, measured in degrees anticlockwise from the Y-axis.</param>
242+
/// <param name="sweepAngle"> The angle between (<paramref name="startAngle"/> and the end of the arc. </param>
243+
/// <returns>The <see cref="PathBuilder"/></returns>
244+
public PathBuilder AddEllipticalArc(Point center, int radiusX, int radiusY, int rotation, int startAngle, int sweepAngle) => this.AddEllipticalArc(center.X, center.Y, radiusX, radiusY, rotation, startAngle, sweepAngle);
245+
246+
/// <summary>
247+
/// Adds an elliptical arc to the current figure
248+
/// </summary>
249+
/// <param name="x"> The x-coordinate of the center point of the ellips from which the arc is taken.</param>
250+
/// <param name="y"> The y-coordinate of the center point of the ellips from which the arc is taken.</param>
251+
/// <param name="radiusX">X radius of the ellipsis.</param>
252+
/// <param name="radiusY">Y radius of the ellipsis.</param>
253+
/// <param name="rotation">The rotation of (<paramref name="radiusX"/> to the X-axis and (<paramref name="radiusY"/> to the Y-axis, measured in degrees anticlockwise.</param>
254+
/// <param name="startAngle">The Start angle of the ellipsis, measured in degrees anticlockwise from the Y-axis.</param>
255+
/// <param name="sweepAngle"> The angle between (<paramref name="startAngle"/> and the end of the arc. </param>
256+
/// <returns>The <see cref="PathBuilder"/></returns>
257+
public PathBuilder AddEllipticalArc(int x, int y, int radiusX, int radiusY, int rotation, int startAngle, int sweepAngle)
258+
{
259+
this.currentFigure.AddSegment(new EllipticalArcLineSegment(x, y, radiusX, radiusY, rotation, startAngle, sweepAngle, this.currentTransform));
260+
261+
return this;
262+
}
263+
224264
/// <summary>
225265
/// Adds an elliptical arc to the current figure
226266
/// </summary>

0 commit comments

Comments
 (0)