Remove dummy items from group before they are deleted

Board items should not be in a group when they are deleted, but these
are dummy ones, so their group membership doesn't matter.

Fixes KICAD-7P0
Fixes KICAD-6VX
Fixes KICAD-7KK
Fixes KICAD-6VH
This commit is contained in:
Ian McInerney 2024-02-16 11:26:28 +00:00
parent 206a631135
commit d3befd8bb8
4 changed files with 13 additions and 0 deletions

View File

@ -316,6 +316,10 @@ DIALOG_PAD_PROPERTIES::~DIALOG_PAD_PROPERTIES()
m_page = m_notebook->GetSelection();
// Remove the preview pad from the group of the actual pad before deletion
if( m_previewPad )
m_previewPad->SetParentGroup( nullptr );
delete m_previewPad;
delete m_axisOrigin;
}

View File

@ -638,6 +638,7 @@ bool FOOTPRINT::FootprintNeedsUpdate( const FOOTPRINT* aLibFP, REPORTER* aReport
// already normalized graphic items in model footprint from library, so we need to normalize
// graphic items in the footprint to test (*this). So normalize them using a copy of this
FOOTPRINT dummy( *this );
dummy.SetParentGroup( nullptr );
dummy.SetParent( nullptr );
for( BOARD_ITEM* item : dummy.GraphicalItems() )

View File

@ -526,6 +526,8 @@ void PlotStandardLayer( BOARD* aBoard, PLOTTER* aPlotter, LSET aLayerMask,
// inflate/deflate a custom shape is a bit complex.
// so build a similar pad shape, and inflate/deflate the polygonal shape
PAD dummy( *pad );
dummy.SetParentGroup( nullptr );
SHAPE_POLY_SET shape;
pad->MergePrimitivesAsPolygon( &shape );

View File

@ -1944,6 +1944,9 @@ void ZONE_FILLER::buildThermalSpokes( const ZONE* aZone, PCB_LAYER_ID aLayer,
spokeIter->Rotate( pad->GetOrientation() + pad->GetThermalSpokeAngle() );
spokeIter->Move( pad->ShapePos() );
}
// Remove group membership from dummy item before deleting
dummy_pad.SetParentGroup( nullptr );
}
// And lastly, even when we have to resort to trig, we can use it only in a post-process
// after the rotated-bounding-box trick from above.
@ -1991,6 +1994,9 @@ void ZONE_FILLER::buildThermalSpokes( const ZONE* aZone, PCB_LAYER_ID aLayer,
spokeIter->SetPoint( 3, end );
spokeIter->SetPoint( 4, end_p );
}
// Remove group membership from dummy item before deleting
dummy_pad.SetParentGroup( nullptr );
}
}