Fix some issues with zooming.

Don't process zoom both in Legacy code and Modern code; one of
them will decide the zoom has already changed and do odd things.

Make sure the view is updated after zooming, otherwise you have
to move the mouse over the canvas before seeing the new zoom.
This commit is contained in:
Jeff Young 2018-08-09 00:44:45 +01:00
parent e932eed738
commit 38464827fc
1 changed files with 10 additions and 15 deletions

View File

@ -524,28 +524,23 @@ void EDA_DRAW_FRAME::OnSelectZoom( wxCommandEvent& event )
if( id < 0 || !( id < (int)m_zoomSelectBox->GetCount() ) )
return;
if( id == 0 ) // Auto zoom (Fit in Page)
if( IsGalCanvasActive() )
{
m_toolManager->RunAction( "common.Control.zoomPreset", true, id );
UpdateStatusBar();
m_galCanvas->Refresh();
}
else if( id == 0 ) // Auto zoom (Fit in Page)
{
Zoom_Automatique( true );
m_canvas->Refresh();
}
else
{
double selectedZoom = GetScreen()->m_ZoomList[id-1];
if( GetScreen()->GetZoom() == selectedZoom )
return;
GetScreen()->SetZoom( selectedZoom );
RedrawScreen( GetScrollCenterPosition(), false );
}
// Notify GAL
TOOL_MANAGER* mgr = GetToolManager();
if( mgr && IsGalCanvasActive() )
{
mgr->RunAction( "common.Control.zoomPreset", true, id );
UpdateStatusBar();
if( GetScreen()->SetZoom( selectedZoom ) )
RedrawScreen( GetScrollCenterPosition(), false );
}
}