Remove existing footprint when force-reloading
Needs to clear the existing footprint in ReloadFootprint prior to loading the new one. Fixes https://gitlab.com/kicad/code/kicad/-/issues/15040
This commit is contained in:
parent
2a940a5f70
commit
f3122184df
|
@ -539,6 +539,8 @@ void FOOTPRINT_EDIT_FRAME::restoreLastFootprint()
|
||||||
|
|
||||||
void FOOTPRINT_EDIT_FRAME::ReloadFootprint( FOOTPRINT* aFootprint )
|
void FOOTPRINT_EDIT_FRAME::ReloadFootprint( FOOTPRINT* aFootprint )
|
||||||
{
|
{
|
||||||
|
GetBoard()->DeleteAllFootprints();
|
||||||
|
|
||||||
m_originalFootprintCopy.reset( static_cast<FOOTPRINT*>( aFootprint->Clone() ) );
|
m_originalFootprintCopy.reset( static_cast<FOOTPRINT*>( aFootprint->Clone() ) );
|
||||||
m_originalFootprintCopy->SetParent( nullptr );
|
m_originalFootprintCopy->SetParent( nullptr );
|
||||||
|
|
||||||
|
|
|
@ -1248,7 +1248,14 @@ void PCB_BASE_FRAME::OnFpChangeDebounceTimer( wxTimerEvent& aEvent )
|
||||||
FOOTPRINT* newfp = tbl->FootprintLoad( nickname, fpname );
|
FOOTPRINT* newfp = tbl->FootprintLoad( nickname, fpname );
|
||||||
|
|
||||||
if( newfp )
|
if( newfp )
|
||||||
|
{
|
||||||
ReloadFootprint( newfp );
|
ReloadFootprint( newfp );
|
||||||
|
|
||||||
|
newfp->ClearAllNets();
|
||||||
|
GetCanvas()->UpdateColors();
|
||||||
|
GetCanvas()->DisplayBoard( GetBoard() );
|
||||||
|
m_toolManager->ResetTools( TOOL_BASE::MODEL_RELOAD );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch( const IO_ERROR& ioe )
|
catch( const IO_ERROR& ioe )
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue