Add accuracy parameter to SHAPE_POLY_SET::PointOnEdge.

This commit is contained in:
Alex Shvartzkop 2023-10-06 00:28:40 +03:00
parent 113208455d
commit 92ef40327d
2 changed files with 3 additions and 3 deletions

View File

@ -1128,7 +1128,7 @@ public:
* @param aP is the point to check.
* @return true if the point lies on the edge of any polygon.
*/
bool PointOnEdge( const VECTOR2I& aP ) const;
bool PointOnEdge( const VECTOR2I& aP, int aAccuracy = 0 ) const;
/**
* Check if the boundary of shape (this) lies closer to the shape \a aShape than \a aClearance,

View File

@ -2031,7 +2031,7 @@ const BOX2I SHAPE_POLY_SET::BBoxFromCaches() const
}
bool SHAPE_POLY_SET::PointOnEdge( const VECTOR2I& aP ) const
bool SHAPE_POLY_SET::PointOnEdge( const VECTOR2I& aP, int aAccuracy ) const
{
// Iterate through all the polygons in the set
for( const POLYGON& polygon : m_polys )
@ -2039,7 +2039,7 @@ bool SHAPE_POLY_SET::PointOnEdge( const VECTOR2I& aP ) const
// Iterate through all the line chains in the polygon
for( const SHAPE_LINE_CHAIN& lineChain : polygon )
{
if( lineChain.PointOnEdge( aP ) )
if( lineChain.PointOnEdge( aP, aAccuracy ) )
return true;
}
}