Cancel placement of via if user cancels layer selection.
Fixes https://gitlab.com/kicad/code/kicad/issues/7578
This commit is contained in:
parent
59b81462ab
commit
45b2bce698
|
@ -761,6 +761,9 @@ int ROUTER_TOOL::handleLayerSwitch( const TOOL_EVENT& aEvent, bool aForceVia )
|
|||
}
|
||||
}
|
||||
|
||||
if( targetLayer == UNDEFINED_LAYER )
|
||||
return 0;
|
||||
|
||||
// fixme: P&S supports more than one fixed layer pair. Update the dialog?
|
||||
sizes.ClearLayerPairs();
|
||||
|
||||
|
|
|
@ -222,8 +222,7 @@ void PCB_ONE_LAYER_SELECTOR::OnRightGridCellClick( wxGridEvent& event )
|
|||
}
|
||||
|
||||
|
||||
PCB_LAYER_ID PCB_BASE_FRAME::SelectOneLayer( PCB_LAYER_ID aDefaultLayer,
|
||||
LSET aNotAllowedLayersMask,
|
||||
PCB_LAYER_ID PCB_BASE_FRAME::SelectOneLayer( PCB_LAYER_ID aDefaultLayer, LSET aNotAllowedLayersMask,
|
||||
wxPoint aDlgPosition )
|
||||
{
|
||||
PCB_ONE_LAYER_SELECTOR dlg( this, GetBoard(), aDefaultLayer, aNotAllowedLayersMask );
|
||||
|
@ -236,10 +235,10 @@ PCB_LAYER_ID PCB_BASE_FRAME::SelectOneLayer( PCB_LAYER_ID aDefaultLayer,
|
|||
dlg.SetPosition( aDlgPosition );
|
||||
}
|
||||
|
||||
dlg.ShowModal();
|
||||
|
||||
PCB_LAYER_ID layer = ToLAYER_ID( dlg.GetLayerSelection() );
|
||||
return layer;
|
||||
if( dlg.ShowModal() != wxID_CANCEL )
|
||||
return ToLAYER_ID( dlg.GetLayerSelection() );
|
||||
else
|
||||
return UNDEFINED_LAYER;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue