Commit 279dea2d1260957281a327729a23c90961c851d7 Parent: c23d30fcc80c917a73b0ff50b0abbc8726bb16ef Author: mcol <mcol@posteo.net> Date: 2021-02-03 22:56:44 +0000 Committer: mcol <mcol@posteo.net> Committed: 2021-02-03 22:56:44 +0000 hit precise zoom min and max values
src/action.c Modified
@@ -174,11 +174,12 @@ /* Passed value (data) is the percentage step (+ve or -ve) */ struct desk *desk = wimp.current_desk; double f = 1 + (*(double*)data / 100); - if ( - (f > 1 && desk->zoom >= wimp.zoom_max) || - (f < 1 && desk->zoom <= wimp.zoom_min) - ) { - return; + + double next_zoom = desk->zoom * f; + if (next_zoom < wimp.zoom_min) { + f = wimp.zoom_min / desk->zoom; + } else if (next_zoom > wimp.zoom_max) { + f = wimp.zoom_max / desk->zoom; } unfullscreen(); desk->zoom *= f;