mirror of
https://git.pwmt.org/pwmt/zathura.git
synced 2024-11-11 00:43:45 +01:00
Debug output for sc_zoom
Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
This commit is contained in:
parent
bcdc7aba05
commit
9b5dceac17
@ -1375,19 +1375,25 @@ sc_zoom(girara_session_t* session, girara_argument_t* argument, girara_event_t*
|
|||||||
|
|
||||||
/* specify new zoom value */
|
/* specify new zoom value */
|
||||||
if (argument->n == ZOOM_IN) {
|
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);
|
zathura_document_set_scale(zathura->document, old_zoom * zoom_step);
|
||||||
} else if (argument->n == ZOOM_OUT) {
|
} 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);
|
zathura_document_set_scale(zathura->document, old_zoom / zoom_step);
|
||||||
} else if (argument->n == ZOOM_SPECIFIC) {
|
} else if (argument->n == ZOOM_SPECIFIC) {
|
||||||
if (t == 0) {
|
if (t == 0) {
|
||||||
|
girara_debug("Setting zoom to 1.");
|
||||||
zathura_document_set_scale(zathura->document, 1.0);
|
zathura_document_set_scale(zathura->document, 1.0);
|
||||||
} else {
|
} else {
|
||||||
|
girara_debug("Setting zoom to %f.", t / 100.0);
|
||||||
zathura_document_set_scale(zathura->document, t / 100.0);
|
zathura_document_set_scale(zathura->document, t / 100.0);
|
||||||
}
|
}
|
||||||
} else if (argument->n == ZOOM_SMOOTH) {
|
} else if (argument->n == ZOOM_SMOOTH) {
|
||||||
const double dy = (event != NULL) ? event->y : 1.0;
|
const double dy = (event != NULL) ? event->y : 1.0;
|
||||||
zathura_document_set_scale(zathura->document, old_zoom + zoom_step * dy);
|
girara_debug("Increasing zoom by %f.", zoom_step * dy - 1.0);
|
||||||
|
zathura_document_set_scale(zathura->document, old_zoom + zoom_step * dy);
|
||||||
} else {
|
} else {
|
||||||
|
girara_debug("Setting zoom to 1.");
|
||||||
zathura_document_set_scale(zathura->document, 1.0);
|
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);
|
const double new_zoom = zathura_document_get_scale(zathura->document);
|
||||||
if (fabs(new_zoom - old_zoom) <= DBL_EPSILON) {
|
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;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
girara_debug("Re-rendering with new zoom level %f.", new_zoom);
|
||||||
render_all(zathura);
|
render_all(zathura);
|
||||||
refresh_view(zathura);
|
refresh_view(zathura);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user