Implement testCopperDrawItem() for POLYGON draw items.

Fixes https://gitlab.com/kicad/code/kicad/issues/4549
This commit is contained in:
Jeff Young 2020-05-26 23:46:34 +01:00
parent d99febba6c
commit e61185775f
1 changed files with 13 additions and 0 deletions

View File

@ -988,7 +988,17 @@ void DRC::testCopperDrawItem( BOARD_COMMIT& aCommit, BOARD_ITEM* aItem )
break;
}
case S_POLYGON:
{
SHAPE_LINE_CHAIN l = drawItem->GetPolyShape().Outline( 0 );
for( int i = 0; i < l.SegmentCount(); i++ )
itemShape.push_back( l.Segment( i ) );
}
break;
default:
wxFAIL_MSG( "unknown shape type" );
break;
}
}
@ -1011,6 +1021,9 @@ void DRC::testCopperDrawItem( BOARD_COMMIT& aCommit, BOARD_ITEM* aItem )
SHAPE_RECT rect_area( bbox.GetX(), bbox.GetY(), bbox.GetWidth(), bbox.GetHeight() );
if( itemShape.empty() )
return;
// Test tracks and vias
for( auto track : m_pcb->Tracks() )
{