Commit 48858c30 authored by diemer's avatar diemer
Browse files

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
Loading
Loading
Loading
Loading
+5 −4
Original line number Original line Diff line number Diff line
@@ -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;