From 3e61e14fe31352d75cf6fd7491291d6eb6af47ce Mon Sep 17 00:00:00 2001 From: Lingzhu Xiang Date: Sun, 26 Oct 2014 08:17:47 -0400 Subject: [PATCH] Do not refresh if the zoom level does not change --- shortcuts.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/shortcuts.c b/shortcuts.c index 33d5b64..706b497 100644 --- a/shortcuts.c +++ b/shortcuts.c @@ -18,6 +18,7 @@ #include "print.h" #include "page-widget.h" #include "adjustment.h" +#include #ifndef MIN #define MIN(a,b) (((a)<(b))?(a):(b)) @@ -1404,6 +1405,10 @@ sc_zoom(girara_session_t* session, girara_argument_t* argument, girara_event_t* zathura_document_set_scale(zathura->document, zoom_max); } + const double new_zoom = zathura_document_get_scale(zathura->document); + if (fabs(new_zoom - old_zoom) <= DBL_EPSILON) + return false; + render_all(zathura); refresh_view(zathura);