Fix PCBnew crash when show local ratsnest and selecting a footprint with no pads
From master, commit e3c3dae
This commit is contained in:
parent
2395c6fdaa
commit
542f713678
|
@ -1141,21 +1141,24 @@ static bool showLocalRatsnest( TOOL_MANAGER* aToolMgr, BOARD* aBoard, const VECT
|
||||||
{
|
{
|
||||||
for( auto item : selection )
|
for( auto item : selection )
|
||||||
{
|
{
|
||||||
if( auto pad = dyn_cast<D_PAD*>(item) )
|
if( D_PAD* pad = dyn_cast<D_PAD*>(item) )
|
||||||
{
|
{
|
||||||
pad->SetLocalRatsnestVisible( !pad->GetLocalRatsnestVisible() );
|
pad->SetLocalRatsnestVisible( !pad->GetLocalRatsnestVisible() );
|
||||||
}
|
}
|
||||||
else if( auto mod = dyn_cast<MODULE*>(item) )
|
else if( MODULE* mod = dyn_cast<MODULE*>(item) )
|
||||||
|
{
|
||||||
|
if( mod->PadsList() )
|
||||||
{
|
{
|
||||||
bool enable = !( *( mod->Pads().begin() ) )->GetLocalRatsnestVisible();
|
bool enable = !( *( mod->Pads().begin() ) )->GetLocalRatsnestVisible();
|
||||||
|
|
||||||
for( auto modpad : mod->Pads() )
|
for( D_PAD* modpad : mod->Pads() )
|
||||||
{
|
{
|
||||||
modpad->SetLocalRatsnestVisible( enable );
|
modpad->SetLocalRatsnestVisible( enable );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
aToolMgr->GetView()->MarkTargetDirty( KIGFX::TARGET_OVERLAY );
|
aToolMgr->GetView()->MarkTargetDirty( KIGFX::TARGET_OVERLAY );
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue