Commit 48858c30 authored by diemer's avatar diemer

Fixed Bug 1829931: calculation of zoom level in Window_Zoom(), so we show more...

Fixed Bug 1829931: calculation of zoom level in Window_Zoom(), so we show more rather than less for a box-zoom.
parent 9039a0a5
......@@ -130,15 +130,16 @@ void WinEDA_DrawFrame::Window_Zoom( EDA_Rect& Rect )
/* Compute the best zoom */
Rect.Normalize();
size = DrawPanel->GetClientSize();
ii = Rect.GetSize().x / size.x;
jj = Rect.GetSize().y / size.y;
// Overestimate zoom level, i. e. show more than selected rather than less.
ii = static_cast<int>( ceil(1.0 * Rect.GetSize().x / size.x) );
jj = static_cast<int>( ceil(1.0 * Rect.GetSize().y / size.y) );
bestzoom = MAX( ii, jj );
if( bestzoom <= 0 )
bestzoom = 1;
GetScreen()->SetZoom( bestzoom );
GetScreen()->SetZoom( bestzoom );
GetScreen()->m_Curseur = Rect.Centre();
GetScreen()->m_Curseur = Rect.Centre();
Recadre_Trace( TRUE );
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment