Zoom context menu: minor enhancement (gal mode).
This commit is contained in:
parent
72a1052bb9
commit
8cc3912b6c
|
@ -73,5 +73,9 @@ void ZOOM_MENU::update()
|
||||||
(int) screen->m_ZoomList.size() );
|
(int) screen->m_ZoomList.size() );
|
||||||
|
|
||||||
for( int i = 0; i < maxZoomIds; ++i )
|
for( int i = 0; i < maxZoomIds; ++i )
|
||||||
Check( ID_POPUP_ZOOM_LEVEL_START+1 + i, std::fabs( zoomList[i] - zoom ) < 1e-6 );
|
{
|
||||||
|
// Search for a value near the current zoom setting:
|
||||||
|
double rel_error = std::fabs( zoomList[i] - zoom )/zoom;
|
||||||
|
Check( ID_POPUP_ZOOM_LEVEL_START+1 + i, rel_error < 0.1 );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue