Don't set FreeVia when we can't find a net.
Fixes https://gitlab.com/kicad/code/kicad/issues/12421
This commit is contained in:
parent
19d8dcad8b
commit
ce9adeaf51
|
@ -3002,18 +3002,28 @@ int DRAWING_TOOL::DrawVia( const TOOL_EVENT& aEvent )
|
||||||
PAD* pad = findPad( via );
|
PAD* pad = findPad( via );
|
||||||
|
|
||||||
if( track )
|
if( track )
|
||||||
|
{
|
||||||
via->SetNetCode( track->GetNetCode() );
|
via->SetNetCode( track->GetNetCode() );
|
||||||
|
via->SetIsFree( false );
|
||||||
|
}
|
||||||
else if( pad )
|
else if( pad )
|
||||||
|
{
|
||||||
via->SetNetCode( pad->GetNetCode() );
|
via->SetNetCode( pad->GetNetCode() );
|
||||||
|
via->SetIsFree( false );
|
||||||
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
via->SetNetCode( findStitchedZoneNet( via ) );
|
via->SetNetCode( findStitchedZoneNet( via ) );
|
||||||
|
via->SetIsFree( via->GetNetCode() > 0 );
|
||||||
|
}
|
||||||
|
|
||||||
if( !m_allowDRCViolations && checkDRCViolation( via ) )
|
if( checkDRCViolation( via ) )
|
||||||
{
|
{
|
||||||
m_frame->ShowInfoBarError( _( "Via location violates DRC." ), true,
|
m_frame->ShowInfoBarError( _( "Via location violates DRC." ), true,
|
||||||
WX_INFOBAR::MESSAGE_TYPE::DRC_VIOLATION );
|
WX_INFOBAR::MESSAGE_TYPE::DRC_VIOLATION );
|
||||||
via->SetNetCode( 0 );
|
|
||||||
return false;
|
if( !m_allowDRCViolations )
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -3021,12 +3031,6 @@ int DRAWING_TOOL::DrawVia( const TOOL_EVENT& aEvent )
|
||||||
infobar->Dismiss();
|
infobar->Dismiss();
|
||||||
}
|
}
|
||||||
|
|
||||||
if( !track && !pad )
|
|
||||||
{
|
|
||||||
via->SetNetCode( findStitchedZoneNet( via ) );
|
|
||||||
via->SetIsFree();
|
|
||||||
}
|
|
||||||
|
|
||||||
aCommit.Add( via );
|
aCommit.Add( via );
|
||||||
|
|
||||||
if( track )
|
if( track )
|
||||||
|
|
Loading…
Reference in New Issue