pcbnew: Edgecuts polygons only hit edges
Only allow hittest for edgecuts polygons on their edges as we do not display the fill for this layer. Fixes: lp:1806782 * https://bugs.launchpad.net/kicad/+bug/1806782
This commit is contained in:
parent
4f5771f79f
commit
b8309e2a70
|
@ -639,13 +639,19 @@ bool DRAWSEGMENT::HitTest( const wxPoint& aPosition ) const
|
|||
return true;
|
||||
break;
|
||||
|
||||
case S_POLYGON: // not yet handled
|
||||
case S_POLYGON:
|
||||
{
|
||||
#define MAX_DIST_IN_MM 0.25
|
||||
int distmax = std::max( m_Width, Millimeter2iu( MAX_DIST_IN_MM ) );
|
||||
|
||||
if( m_Poly.Collide( VECTOR2I( aPosition ), distmax ) )
|
||||
return true;
|
||||
if( m_Layer == Edge_Cuts )
|
||||
{
|
||||
SHAPE_POLY_SET::VERTEX_INDEX i;
|
||||
auto poly = m_Poly; //todo: Fix CollideEdge to be const
|
||||
return poly.CollideEdge(VECTOR2I( aPosition ), i, distmax );
|
||||
}
|
||||
else
|
||||
return m_Poly.Collide( VECTOR2I( aPosition ), distmax );
|
||||
}
|
||||
break;
|
||||
|
||||
|
|
Loading…
Reference in New Issue