Skip to content

Commit de5b04f

Browse files
committed
remove IPath.Contains and simplify InnerPath
1 parent 90e727c commit de5b04f

6 files changed

Lines changed: 1 addition & 583 deletions

File tree

src/ImageSharp.Drawing/Shapes/ComplexPolygon.cs

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -101,21 +101,6 @@ public ComplexPolygon(params IPath[] paths)
101101
/// <inheritdoc/>
102102
public RectangleF Bounds { get; }
103103

104-
/// <inheritdoc/>
105-
public bool Contains(PointF point)
106-
{
107-
bool inside = false;
108-
foreach (IPath shape in this.Paths)
109-
{
110-
if (shape.Contains(point))
111-
{
112-
inside ^= true; // flip the inside flag
113-
}
114-
}
115-
116-
return inside;
117-
}
118-
119104
/// <inheritdoc/>
120105
public IPath Transform(Matrix3x2 matrix)
121106
{

src/ImageSharp.Drawing/Shapes/EllipsePolygon.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,6 @@ public IEnumerable<ISimplePath> Flatten()
9090
yield return this;
9191
}
9292

93-
/// <inheritdoc/>
94-
public bool Contains(PointF point) => this.innerPath.PointInPolygon(point);
95-
9693
/// <inheritdoc />
9794
// TODO switch this out to a calculated algorithm
9895
SegmentInfo IPathInternals.PointAlongPath(float distance)

src/ImageSharp.Drawing/Shapes/IPath.cs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,6 @@ public interface IPath
2727
/// <returns>Returns the current <see cref="IPath" /> as simple linear path.</returns>
2828
IEnumerable<ISimplePath> Flatten();
2929

30-
/// <summary>
31-
/// Determines whether the <see cref="IPath"/> contains the specified point.
32-
/// </summary>
33-
/// <param name="point">The point.</param>
34-
/// <returns>
35-
/// <see langword="true"/> if the <see cref="IPath"/> contains the specified point; otherwise, <see langword="false"/>.
36-
/// </returns>
37-
bool Contains(PointF point);
38-
3930
/// <summary>
4031
/// Transforms the path using the specified matrix.
4132
/// </summary>

0 commit comments

Comments
 (0)