Do not refresh if the zoom level does not change

This commit is contained in:
Lingzhu Xiang 2014-10-26 08:17:47 -04:00
parent 15838abf56
commit 3e61e14fe3

View file

@ -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);