pcbnew Check for valid nodes before drawing ratsnest
We can invalidate a node by rotating. Make sure that our endpoints for the ratsnest are valid before attempting to draw. Fixes: lp:1775727 * https://bugs.launchpad.net/kicad/+bug/1775727
This commit is contained in:
parent
fb9ccd855d
commit
c5c52c3dfd
|
@ -115,6 +115,9 @@ void PCB_BASE_FRAME::DrawGeneralRatsnest( wxDC* aDC, int aNetcode )
|
|||
auto sn = edge.GetSourceNode();
|
||||
auto dn = edge.GetTargetNode();
|
||||
|
||||
if( !sn->Valid() || !dn->Valid() )
|
||||
continue;
|
||||
|
||||
bool enable = !sn->GetNoLine() && !dn->GetNoLine();
|
||||
bool show = sn->Parent()->GetLocalRatsnestVisible()
|
||||
|| dn->Parent()->GetLocalRatsnestVisible();
|
||||
|
|
|
@ -109,6 +109,9 @@ void RATSNEST_VIEWITEM::ViewDraw( int aLayer, KIGFX::VIEW* aView ) const
|
|||
const VECTOR2I source( sourceNode->Pos() );
|
||||
const VECTOR2I target( targetNode->Pos() );
|
||||
|
||||
if( !sourceNode->Valid() || !targetNode->Valid() )
|
||||
continue;
|
||||
|
||||
bool enable = !sourceNode->GetNoLine() && !targetNode->GetNoLine();
|
||||
bool show = sourceNode->Parent()->GetLocalRatsnestVisible() || targetNode->Parent()->GetLocalRatsnestVisible();
|
||||
|
||||
|
|
Loading…
Reference in New Issue