Fix zoom to selection in bug in gal canvas.

This commit is contained in:
Wayne Stambaugh 2018-03-25 16:12:56 -04:00
parent a763435b59
commit c8c5b5da07
3 changed files with 6 additions and 3 deletions

View File

@ -47,7 +47,10 @@ void ZOOM_TOOL::Reset( RESET_REASON aReason )
int ZOOM_TOOL::Main( const TOOL_EVENT& aEvent )
{
// This method is called both when the zoom tool is activated (on) or deactivated (off)
bool zoom_tool_is_on = m_frame->GetToolToggled( ID_ZOOM_SELECTION );
wxMenuBar* menu = m_frame->GetMenuBar();
bool zoom_tool_is_on = m_frame->GetToolToggled( ID_ZOOM_SELECTION ) ||
( menu && menu->IsChecked( ID_ZOOM_SELECTION ) );
if( !zoom_tool_is_on ) // This is a tool deselection: do nothing
return 0;

View File

@ -238,7 +238,7 @@ void FOOTPRINT_EDIT_FRAME::ReCreateMenuBar()
text = AddHotkeyName( _( "Zoom to Selection" ), m_hotkeysDescrList, HK_ZOOM_SELECTION );
AddMenuItem( viewMenu, ID_ZOOM_SELECTION, text, KiBitmap( zoom_area_xpm ) );
AddMenuItem( viewMenu, ID_ZOOM_SELECTION, text, KiBitmap( zoom_area_xpm ), wxITEM_CHECK );
text = AddHotkeyName( _( "&Redraw" ), m_hotkeysDescrList, HK_ZOOM_REDRAW );
AddMenuItem( viewMenu, ID_ZOOM_REDRAW, text,

View File

@ -643,7 +643,7 @@ void prepareViewMenu( wxMenu* aParentMenu, bool aUseGal )
text = AddHotkeyName( _( "Zoom to Selection" ), g_Pcbnew_Editor_Hotkeys_Descr,
HK_ZOOM_SELECTION );
AddMenuItem( aParentMenu, ID_ZOOM_SELECTION, text, KiBitmap( zoom_area_xpm ) );
AddMenuItem( aParentMenu, ID_ZOOM_SELECTION, text, KiBitmap( zoom_area_xpm ), wxITEM_CHECK );
text = AddHotkeyName( _( "&Redraw" ), g_Pcbnew_Editor_Hotkeys_Descr, HK_ZOOM_REDRAW );
AddMenuItem( aParentMenu, ID_ZOOM_REDRAW, text,