Exit pad edit mode before closing footprint editor.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16766
This commit is contained in:
parent
f4e123f57e
commit
cc058a7927
|
@ -808,6 +808,11 @@ bool FOOTPRINT_EDIT_FRAME::canCloseWindow( wxCloseEvent& aEvent )
|
|||
}
|
||||
}
|
||||
|
||||
PAD_TOOL* padTool = m_toolManager->GetTool<PAD_TOOL>();
|
||||
|
||||
if( padTool->InPadEditMode() )
|
||||
padTool->ExitPadEditMode();
|
||||
|
||||
// Save footprint tree column widths
|
||||
m_adapter->SaveSettings();
|
||||
|
||||
|
|
|
@ -690,10 +690,7 @@ int PAD_TOOL::EditPad( const TOOL_EVENT& aEvent )
|
|||
}
|
||||
|
||||
if( m_editPad == niluuid )
|
||||
{
|
||||
settings->m_PadEditModePad = nullptr;
|
||||
exitPadEditMode();
|
||||
}
|
||||
ExitPadEditMode();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -728,7 +725,7 @@ int PAD_TOOL::OnUndoRedo( const TOOL_EVENT& aEvent )
|
|||
if( flaggedPad )
|
||||
enterPadEditMode();
|
||||
else
|
||||
exitPadEditMode();
|
||||
ExitPadEditMode();
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
@ -771,10 +768,14 @@ void PAD_TOOL::enterPadEditMode()
|
|||
}
|
||||
|
||||
|
||||
void PAD_TOOL::exitPadEditMode()
|
||||
void PAD_TOOL::ExitPadEditMode()
|
||||
{
|
||||
KIGFX::PCB_PAINTER* painter = static_cast<KIGFX::PCB_PAINTER*>( view()->GetPainter() );
|
||||
PCB_RENDER_SETTINGS* settings = painter->GetSettings();
|
||||
PCB_DISPLAY_OPTIONS opts = frame()->GetDisplayOptions();
|
||||
|
||||
settings->m_PadEditModePad = nullptr;
|
||||
|
||||
if( m_previousHighContrastMode != opts.m_ContrastModeDisplay )
|
||||
{
|
||||
opts.m_ContrastModeDisplay = m_previousHighContrastMode;
|
||||
|
|
|
@ -63,6 +63,7 @@ public:
|
|||
int OnUndoRedo( const TOOL_EVENT& aEvent );
|
||||
|
||||
bool InPadEditMode() { return m_editPad != niluuid; }
|
||||
void ExitPadEditMode();
|
||||
|
||||
wxString GetLastPadNumber() const { return m_lastPadNumber; }
|
||||
void SetLastPadNumber( const wxString& aPadNumber ) { m_lastPadNumber = aPadNumber; }
|
||||
|
@ -91,7 +92,6 @@ private:
|
|||
void explodePad( PAD* aPad, PCB_LAYER_ID* aLayer );
|
||||
|
||||
void enterPadEditMode();
|
||||
void exitPadEditMode();
|
||||
|
||||
private:
|
||||
wxString m_lastPadNumber;
|
||||
|
|
Loading…
Reference in New Issue