Commit 9b5dceac authored by Sebastian Ramacher's avatar Sebastian Ramacher

Debug output for sc_zoom

Signed-off-by: Sebastian Ramacher's avatarSebastian Ramacher <sebastian+dev@ramacher.at>
parent bcdc7aba
......@@ -1375,19 +1375,25 @@ sc_zoom(girara_session_t* session, girara_argument_t* argument, girara_event_t*
/* specify new zoom value */
if (argument->n == ZOOM_IN) {
girara_debug("Increasing zoom by %f.", zoom_step - 1.0);
zathura_document_set_scale(zathura->document, old_zoom * zoom_step);
} else if (argument->n == ZOOM_OUT) {
girara_debug("Decreasing zoom by %f.", zoom_step - 1.0);
zathura_document_set_scale(zathura->document, old_zoom / zoom_step);
} else if (argument->n == ZOOM_SPECIFIC) {
if (t == 0) {
girara_debug("Setting zoom to 1.");
zathura_document_set_scale(zathura->document, 1.0);
} else {
girara_debug("Setting zoom to %f.", t / 100.0);
zathura_document_set_scale(zathura->document, t / 100.0);
}
} else if (argument->n == ZOOM_SMOOTH) {
const double dy = (event != NULL) ? event->y : 1.0;
girara_debug("Increasing zoom by %f.", zoom_step * dy - 1.0);
zathura_document_set_scale(zathura->document, old_zoom + zoom_step * dy);
} else {
girara_debug("Setting zoom to 1.");
zathura_document_set_scale(zathura->document, 1.0);
}
......@@ -1397,9 +1403,11 @@ sc_zoom(girara_session_t* session, girara_argument_t* argument, girara_event_t*
const double new_zoom = zathura_document_get_scale(zathura->document);
if (fabs(new_zoom - old_zoom) <= DBL_EPSILON) {
girara_debug("New and old zoom level are too close: %f vs. %f, diff = %f", new_zoom, old_zoom, fabs(new_zoom - old_zoom));
return false;
}
girara_debug("Re-rendering with new zoom level %f.", new_zoom);
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