Commit 3e61e14f authored by Lingzhu Xiang's avatar Lingzhu Xiang

Do not refresh if the zoom level does not change

parent 15838abf
......@@ -18,6 +18,7 @@
#include "print.h"
#include "page-widget.h"
#include "adjustment.h"
#include <math.h>
#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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment