CADSTAR Sch: Clear symbol of all elements before overwriting with new one
Fixes https://gitlab.com/kicad/code/kicad/-/issues/11378
(cherry picked from commit 85f6ff48e7
)
This commit is contained in:
parent
6818eff90e
commit
250942264b
|
@ -1308,6 +1308,13 @@ void CADSTAR_SCH_ARCHIVE_LOADER::loadSymDefIntoLibrary( const SYMDEF_ID& aSymdef
|
|||
SYMDEF_SCM symbol = Library.SymbolDefinitions.at( aSymdefID );
|
||||
int gateNumber = getKiCadUnitNumberFromGate( aGateID );
|
||||
|
||||
// Ensure there are no items on this unit (e.g. if we already previously loaded the symbol from
|
||||
// the part definition)
|
||||
std::vector<LIB_ITEM*> drawItems = aSymbol->GetUnitDrawItems( gateNumber, 0 );
|
||||
|
||||
for( LIB_ITEM* item : drawItems )
|
||||
aSymbol->RemoveDrawItem( item );
|
||||
|
||||
for( std::pair<FIGURE_ID, FIGURE> figPair : symbol.Figures )
|
||||
{
|
||||
FIGURE fig = figPair.second;
|
||||
|
|
Loading…
Reference in New Issue