Added possibility to change zoom using toolbar in GAL.

This commit is contained in:
Maciej Sumiński 2013-07-07 19:30:44 +02:00
parent d81a351c73
commit 180c72ef83
1 changed files with 15 additions and 1 deletions

View File

@ -426,7 +426,21 @@ void EDA_DRAW_FRAME::OnSelectZoom( wxCommandEvent& event )
return; return;
GetScreen()->SetZoom( selectedZoom ); GetScreen()->SetZoom( selectedZoom );
RedrawScreen( GetScreen()->GetScrollCenterPosition(), false );
if( m_galCanvasActive )
{
// Apply computed view settings to GAL
KiGfx::VIEW* view = m_galCanvas->GetView();
KiGfx::GAL* gal = m_galCanvas->GetGAL();
double zoomFactor = gal->GetWorldScale() / gal->GetZoomFactor();
double zoom = 1.0 / ( zoomFactor * GetZoom() );
view->SetScale( zoom );
m_galCanvas->Refresh();
}
else
RedrawScreen( GetScreen()->GetScrollCenterPosition(), false );
} }
} }