Browse Source

Remove cloned items from groups

When destroying, the group must be null and there's no group purpose in
the DRC checks
7.0
Seth Hillbrand 3 years ago
parent
commit
d232ade752
  1. 6
      pcbnew/drc/drc_test_provider_edge_clearance.cpp
  2. 1
      pcbnew/drc/drc_test_provider_library_parity.cpp

6
pcbnew/drc/drc_test_provider_edge_clearance.cpp

@ -188,18 +188,22 @@ bool DRC_TEST_PROVIDER_EDGE_CLEARANCE::Run()
edges.back()->SetShape( SHAPE_T::SEGMENT );
edges.back()->SetEndX( shape->GetStartX() );
edges.back()->SetStroke( stroke );
edges.back()->SetParentGroup( nullptr );
edges.emplace_back( static_cast<PCB_SHAPE*>( shape->Clone() ) );
edges.back()->SetShape( SHAPE_T::SEGMENT );
edges.back()->SetEndY( shape->GetStartY() );
edges.back()->SetStroke( stroke );
edges.back()->SetParentGroup( nullptr );
edges.emplace_back( static_cast<PCB_SHAPE*>( shape->Clone() ) );
edges.back()->SetShape( SHAPE_T::SEGMENT );
edges.back()->SetStartX( shape->GetEndX() );
edges.back()->SetStroke( stroke );
edges.back()->SetParentGroup( nullptr );
edges.emplace_back( static_cast<PCB_SHAPE*>( shape->Clone() ) );
edges.back()->SetShape( SHAPE_T::SEGMENT );
edges.back()->SetStartY( shape->GetEndY() );
edges.back()->SetStroke( stroke );
edges.back()->SetParentGroup( nullptr );
}
else if( shape->GetShape() == SHAPE_T::POLY && !shape->IsFilled() )
{
@ -215,12 +219,14 @@ bool DRC_TEST_PROVIDER_EDGE_CLEARANCE::Run()
edges.back()->SetStart( seg.A );
edges.back()->SetEnd( seg.B );
edges.back()->SetStroke( stroke );
edges.back()->SetParentGroup( nullptr );
}
}
else
{
edges.emplace_back( static_cast<PCB_SHAPE*>( shape->Clone() ) );
edges.back()->SetStroke( stroke );
edges.back()->SetParentGroup( nullptr );
}
return true;

1
pcbnew/drc/drc_test_provider_library_parity.cpp

@ -354,6 +354,7 @@ bool FOOTPRINT::FootprintNeedsUpdate( const FOOTPRINT* aLibFootprint )
{
std::unique_ptr<FOOTPRINT> temp( static_cast<FOOTPRINT*>( Clone() ) );
temp->Flip( {0,0}, false );
temp->SetParentGroup( nullptr );
return temp->FootprintNeedsUpdate( aLibFootprint );
}

Loading…
Cancel
Save