From 0720525feaa4488b27aa4d7e8594a1f28067f9fd Mon Sep 17 00:00:00 2001 From: Lukas K Date: Fri, 11 Oct 2019 00:46:14 +0200 Subject: [PATCH] fix smooth zooming calculations --- zathura/shortcuts.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zathura/shortcuts.c b/zathura/shortcuts.c index 23be273..d2dba1e 100644 --- a/zathura/shortcuts.c +++ b/zathura/shortcuts.c @@ -1395,8 +1395,8 @@ sc_zoom(girara_session_t* session, girara_argument_t* argument, girara_event_t* } } else if (argument->n == ZOOM_SMOOTH) { const double dy = (event != NULL) ? event->y : 1.0; - girara_debug("Increasing zoom by %0.2f.", zoom_step * dy - 1.0); - zathura_document_set_zoom(zathura->document, old_zoom + zoom_step * dy); + girara_debug("Increasing zoom by %0.2f.", pow(zoom_step, -dy) - 1.0); + zathura_document_set_zoom(zathura->document, old_zoom * pow(zoom_step, -dy)); } else { girara_debug("Setting zoom to 1."); zathura_document_set_zoom(zathura->document, 1.0);