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,8 +130,9 @@ void WinEDA_DrawFrame::Window_Zoom( EDA_Rect& Rect ) ...@@ -130,8 +130,9 @@ void WinEDA_DrawFrame::Window_Zoom( EDA_Rect& Rect )
/* Compute the best zoom */ /* Compute the best zoom */
Rect.Normalize(); Rect.Normalize();
size = DrawPanel->GetClientSize(); size = DrawPanel->GetClientSize();
ii = Rect.GetSize().x / size.x; // Overestimate zoom level, i. e. show more than selected rather than less.
jj = Rect.GetSize().y / size.y; 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 ); bestzoom = MAX( ii, jj );
if( bestzoom <= 0 ) if( bestzoom <= 0 )
bestzoom = 1; bestzoom = 1;
......
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