Browse Source

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.
pull/13/head
Jeff Young 7 years ago
parent
commit
38464827fc
  1. 25
      common/draw_frame.cpp

25
common/draw_frame.cpp

@ -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 );
}
}

Loading…
Cancel
Save