Added possibility to change zoom using toolbar in GAL.
This commit is contained in:
parent
d81a351c73
commit
180c72ef83
|
@ -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 );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue