Remove cloned items from groups

When destroying, the group must be null and there's no group purpose in
the DRC checks
This commit is contained in:
Seth Hillbrand 2022-11-28 09:09:12 -08:00
parent ef6348606a
commit d232ade752
2 changed files with 7 additions and 0 deletions

View File

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

View File

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