Fixes the regression where the viewport is way too large after an optimal zoom operation (cf. #660 (closed)).