Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: XML Documentation #14023

Merged
merged 1 commit into from
Jan 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 19 additions & 45 deletions src/Avalonia.Base/Media/StreamGeometryContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,22 +29,13 @@ public StreamGeometryContext(IStreamGeometryContextImpl impl)
/// Sets path's winding rule (default is EvenOdd). You should call this method before any calls to BeginFigure. If you wonder why, ask Direct2D guys about their design decisions.
/// </summary>
/// <param name="fillRule"></param>

public void SetFillRule(FillRule fillRule)
{
_impl.SetFillRule(fillRule);
}

/// <summary>
/// Draws an arc to the specified point.
/// </summary>
/// <param name="point">The destination point.</param>
/// <param name="size">The radii of an oval whose perimeter is used to draw the angle.</param>
/// <param name="rotationAngle">The rotation angle (in radians) of the oval that specifies the curve.</param>
/// <param name="isLargeArc">true to draw the arc greater than 180 degrees; otherwise, false.</param>
/// <param name="sweepDirection">
/// A value that indicates whether the arc is drawn in the Clockwise or Counterclockwise direction.
/// </param>

/// <inheritdoc/>
public void ArcTo(Point point, Size size, double rotationAngle, bool isLargeArc, SweepDirection sweepDirection)
{
_impl.ArcTo(point, size, rotationAngle, isLargeArc, sweepDirection);
Expand All @@ -54,8 +45,8 @@ public void ArcTo(Point point, Size size, double rotationAngle, bool isLargeArc,

/// <summary>
/// Draws an arc to the specified point using polylines, quadratic or cubic Bezier curves
/// Significantly more precise when drawing elliptic arcs with extreme width:height ratios.
/// </summary>
/// Significantly more precise when drawing elliptic arcs with extreme width:height ratios.
/// </summary>
/// <param name="point">The destination point.</param>
/// <param name="size">The radii of an oval whose perimeter is used to draw the angle.</param>
/// <param name="rotationAngle">The rotation angle (in radians) of the oval that specifies the curve.</param>
Expand All @@ -68,54 +59,37 @@ public void PreciseArcTo(Point point, Size size, double rotationAngle, bool isLa
PreciseEllipticArcHelper.ArcTo(this, _currentPoint, point, size, rotationAngle, isLargeArc, sweepDirection);
}

/// <summary>
/// Begins a new figure.
/// </summary>
/// <param name="startPoint">The starting point for the figure.</param>
/// <param name="isFilled">Whether the figure is filled.</param>

/// <inheritdoc/>
public void BeginFigure(Point startPoint, bool isFilled)
{
_impl.BeginFigure(startPoint, isFilled);
_currentPoint = startPoint;
}

/// <summary>
/// Draws a Bezier curve to the specified point.
/// </summary>
/// <param name="point1">The first control point used to specify the shape of the curve.</param>
/// <param name="point2">The second control point used to specify the shape of the curve.</param>
/// <param name="point3">The destination point for the end of the curve.</param>
public void CubicBezierTo(Point point1, Point point2, Point point3)
/// <inheritdoc/>
public void CubicBezierTo(Point controlPoint1, Point controlPoint2, Point endPoint)
{
_impl.CubicBezierTo(point1, point2, point3);
_currentPoint = point3;
_impl.CubicBezierTo(controlPoint1, controlPoint2, endPoint);
_currentPoint = endPoint;
}

/// <summary>
/// Draws a quadratic Bezier curve to the specified point
/// </summary>
/// <param name="control">The control point used to specify the shape of the curve.</param>
/// <param name="endPoint">The destination point for the end of the curve.</param>
public void QuadraticBezierTo(Point control, Point endPoint)
/// <inheritdoc/>
public void QuadraticBezierTo(Point controlPoint , Point endPoint)
{
_impl.QuadraticBezierTo(control, endPoint);
_impl.QuadraticBezierTo(controlPoint , endPoint);
_currentPoint = endPoint;
}

/// <summary>
/// Draws a line to the specified point.
/// </summary>
/// <param name="point">The destination point.</param>
public void LineTo(Point point)

/// <inheritdoc/>
public void LineTo(Point endPoint)
{
_impl.LineTo(point);
_currentPoint = point;
_impl.LineTo(endPoint);
_currentPoint = endPoint;
}

/// <summary>
/// Ends the figure started by <see cref="BeginFigure(Point, bool)"/>.
/// </summary>
/// <param name="isClosed">Whether the figure is closed.</param>
/// <inheritdoc/>
public void EndFigure(bool isClosed)
{
_impl.EndFigure(isClosed);
Expand Down
20 changes: 10 additions & 10 deletions src/Avalonia.Base/Platform/IGeometryContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,23 +30,23 @@ public interface IGeometryContext : IDisposable
/// <summary>
/// Draws a Bezier curve to the specified point.
/// </summary>
/// <param name="point1">The first control point used to specify the shape of the curve.</param>
/// <param name="point2">The second control point used to specify the shape of the curve.</param>
/// <param name="point3">The destination point for the end of the curve.</param>
void CubicBezierTo(Point point1, Point point2, Point point3);
/// <param name="controlPoint1">The first control point used to specify the shape of the curve.</param>
/// <param name="controlPoint2">The second control point used to specify the shape of the curve.</param>
/// <param name="endPoint">The destination point for the end of the curve.</param>
void CubicBezierTo(Point controlPoint1, Point controlPoint2, Point endPoint);

/// <summary>
/// Draws a quadratic Bezier curve to the specified point
/// </summary>
/// <param name="control">Control point</param>
/// <param name="controlPoint ">Control point</param>
/// <param name="endPoint">DestinationPoint</param>
void QuadraticBezierTo(Point control, Point endPoint);
void QuadraticBezierTo(Point controlPoint , Point endPoint);

/// <summary>
/// Draws a line to the specified point.
/// </summary>
/// <param name="point">The destination point.</param>
void LineTo(Point point);
/// <param name="endPoint">The destination point.</param>
void LineTo(Point endPoint);

/// <summary>
/// Ends the figure started by <see cref="BeginFigure(Point, bool)"/>.
Expand All @@ -55,9 +55,9 @@ public interface IGeometryContext : IDisposable
void EndFigure(bool isClosed);

/// <summary>
/// Sets the fill rule.
/// Sets path's winding rule (default is EvenOdd). You should call this method before any calls to BeginFigure.
/// </summary>
/// <param name="fillRule">The fill rule.</param>
/// <param name="fillRule"></param>
void SetFillRule(FillRule fillRule);
}
}
19 changes: 13 additions & 6 deletions src/Avalonia.Base/Platform/PathGeometryContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ public void Dispose()
_pathGeometry = null;
}

/// <inheritdoc/>
public void ArcTo(Point point, Size size, double rotationAngle, bool isLargeArc, SweepDirection sweepDirection)
{
var arcSegment = new ArcSegment
Expand All @@ -34,6 +35,7 @@ public void ArcTo(Point point, Size size, double rotationAngle, bool isLargeArc,
CurrentFigureSegments().Add(arcSegment);
}

/// <inheritdoc/>
public void BeginFigure(Point startPoint, bool isFilled)
{
ThrowIfDisposed();
Expand All @@ -44,30 +46,34 @@ public void BeginFigure(Point startPoint, bool isFilled)
_pathGeometry.Figures.Add(_currentFigure);
}

public void CubicBezierTo(Point point1, Point point2, Point point3)
/// <inheritdoc/>
public void CubicBezierTo(Point controlPoint1, Point controlPoint2, Point endPoint)
{
var bezierSegment = new BezierSegment { Point1 = point1, Point2 = point2, Point3 = point3 };
var bezierSegment = new BezierSegment { Point1 = controlPoint1, Point2 = controlPoint2, Point3 = endPoint };

CurrentFigureSegments().Add(bezierSegment);
}

public void QuadraticBezierTo(Point control, Point endPoint)
/// <inheritdoc/>
public void QuadraticBezierTo(Point controlPoint , Point endPoint)
{
var quadraticBezierSegment = new QuadraticBezierSegment { Point1 = control, Point2 = endPoint };
var quadraticBezierSegment = new QuadraticBezierSegment { Point1 = controlPoint , Point2 = endPoint };

CurrentFigureSegments().Add(quadraticBezierSegment);
}

public void LineTo(Point point)
/// <inheritdoc/>
public void LineTo(Point endPoint)
{
var lineSegment = new LineSegment
{
Point = point
Point = endPoint
};

CurrentFigureSegments().Add(lineSegment);
}

/// <inheritdoc/>
public void EndFigure(bool isClosed)
{
if (_currentFigure != null)
Expand All @@ -78,6 +84,7 @@ public void EndFigure(bool isClosed)
_currentFigure = null;
}

/// <inheritdoc/>
public void SetFillRule(FillRule fillRule)
{
ThrowIfDisposed();
Expand Down