Fix error in contour check
Correct mistake in bool() that prevented checking correct contour for end of vertex list.
This commit is contained in:
parent
8cc3c6f159
commit
2a00fc962b
|
@ -165,9 +165,11 @@ class SHAPE_POLY_SET : public SHAPE
|
||||||
|
|
||||||
operator bool() const
|
operator bool() const
|
||||||
{
|
{
|
||||||
return ( ( m_currentPolygon < m_lastPolygon ) ||
|
return ( ( m_currentPolygon < m_lastPolygon ) || ( IsLastPolygon() &&
|
||||||
( m_currentPolygon == m_lastPolygon &&
|
( m_currentContour < static_cast<int>( m_poly->CPolygon( m_currentPolygon ).size() ) ||
|
||||||
m_currentVertex < m_poly->CPolygon( m_currentPolygon )[0].PointCount() ) );
|
( IsEndContour() && m_currentVertex < m_poly->CPolygon( m_currentPolygon )[m_currentContour].PointCount() )
|
||||||
|
)
|
||||||
|
) );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -176,7 +176,8 @@ BOOST_AUTO_TEST_CASE( CollideVertex )
|
||||||
// Check that the set collides with the colliding points
|
// Check that the set collides with the colliding points
|
||||||
for( const VECTOR2I& point : common.holeyPoints )
|
for( const VECTOR2I& point : common.holeyPoints )
|
||||||
{
|
{
|
||||||
BOOST_CHECK( common.holeyPolySet.CollideVertex( point, cornerHit, 0 ) );
|
BOOST_CHECK_MESSAGE( common.holeyPolySet.CollideVertex( point, cornerHit, 0 ), " Point "
|
||||||
|
<< point.x << ", " << point.y << " does not collide with holeyPolySet polygon" );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue