Handle cancel when selecting copper layer.
Also changes the algorithm to ask only once, rather than one per non-copper-layer object. Fixes https://gitlab.com/kicad/code/kicad/issues/8767
This commit is contained in:
parent
353dc95f06
commit
e02bb80bf3
|
@ -552,8 +552,8 @@ int CONVERT_TOOL::PolyToLines( const TOOL_EVENT& aEvent )
|
||||||
|
|
||||||
BOARD_COMMIT commit( m_frame );
|
BOARD_COMMIT commit( m_frame );
|
||||||
FOOTPRINT_EDIT_FRAME* fpEditor = dynamic_cast<FOOTPRINT_EDIT_FRAME*>( m_frame );
|
FOOTPRINT_EDIT_FRAME* fpEditor = dynamic_cast<FOOTPRINT_EDIT_FRAME*>( m_frame );
|
||||||
|
|
||||||
FOOTPRINT* footprint = nullptr;
|
FOOTPRINT* footprint = nullptr;
|
||||||
|
PCB_LAYER_ID copperLayer = UNSELECTED_LAYER;
|
||||||
|
|
||||||
if( fpEditor )
|
if( fpEditor )
|
||||||
footprint = fpEditor->GetBoard()->GetFirstFootprint();
|
footprint = fpEditor->GetBoard()->GetFirstFootprint();
|
||||||
|
@ -597,7 +597,15 @@ int CONVERT_TOOL::PolyToLines( const TOOL_EVENT& aEvent )
|
||||||
BOARD_ITEM_CONTAINER* parent = frame->GetModel();
|
BOARD_ITEM_CONTAINER* parent = frame->GetModel();
|
||||||
|
|
||||||
if( !IsCopperLayer( layer ) )
|
if( !IsCopperLayer( layer ) )
|
||||||
layer = frame->SelectOneLayer( F_Cu, LSET::AllNonCuMask() );
|
{
|
||||||
|
if( copperLayer == UNSELECTED_LAYER )
|
||||||
|
copperLayer = frame->SelectOneLayer( F_Cu, LSET::AllNonCuMask() );
|
||||||
|
|
||||||
|
if( copperLayer == UNDEFINED_LAYER ) // User cancelled
|
||||||
|
continue;
|
||||||
|
|
||||||
|
layer = copperLayer;
|
||||||
|
}
|
||||||
|
|
||||||
// I am really unsure converting a polygon to "tracks" (i.e. segments on
|
// I am really unsure converting a polygon to "tracks" (i.e. segments on
|
||||||
// copper layers) make sense for footprints, but anyway this code exists
|
// copper layers) make sense for footprints, but anyway this code exists
|
||||||
|
|
Loading…
Reference in New Issue