Handle FP polygons in DRC check

Iterator points are relative to the footprint

Fixes https://gitlab.com/kicad/code/kicad/-/issues/16266
This commit is contained in:
Seth Hillbrand 2023-12-05 16:07:01 -08:00
parent 59c638c64c
commit df64a6c583
1 changed files with 8 additions and 0 deletions

View File

@ -218,6 +218,14 @@ bool DRC_TEST_PROVIDER_EDGE_CLEARANCE::Run()
for( size_t ii = 0; ii < poly.GetSegmentCount(); ++ii )
{
SEG seg = poly.CSegment( ii );
// The polygon iterator returns coordinates relative to the parent
if( FOOTPRINT* fp = shape->GetParentFootprint() )
{
seg.A += fp->GetPosition();
seg.B += fp->GetPosition();
}
edges.emplace_back( static_cast<PCB_SHAPE*>( shape->Clone() ) );
edges.back()->SetShape( SHAPE_T::SEGMENT );
edges.back()->SetStart( seg.A );