Fix selection tool behavior in footprint viewer

The footprint viewer isn't an edit frame, so we need to access the
settings through the base frame type instead. Also, double click makes
no sense in the footprint viewer, and just leads to weird results
sometimes.

Fixes Sentry KICAD-7A2
This commit is contained in:
Ian McInerney 2024-02-05 12:39:50 +00:00
parent 3178bbfba0
commit 7ea1568802
2 changed files with 13 additions and 1 deletions

View File

@ -354,6 +354,13 @@ int PCB_SELECTION_TOOL::Main( const TOOL_EVENT& aEvent )
{ {
m_disambiguateTimer.Stop(); m_disambiguateTimer.Stop();
// Double clicks make no sense in the footprint viewer
if( frame && frame->IsType( FRAME_FOOTPRINT_VIEWER ) )
{
evt->SetPassEvent();
continue;
}
// Double click? Display the properties window // Double click? Display the properties window
m_frame->FocusOnItem( nullptr ); m_frame->FocusOnItem( nullptr );

View File

@ -232,7 +232,12 @@ protected:
return getViewControls(); return getViewControls();
} }
PCB_BASE_EDIT_FRAME* frame() const PCB_BASE_FRAME* frame() const
{
return getEditFrame<PCB_BASE_FRAME>();
}
PCB_BASE_EDIT_FRAME* editFrame() const
{ {
return getEditFrame<PCB_BASE_EDIT_FRAME>(); return getEditFrame<PCB_BASE_EDIT_FRAME>();
} }