Update link evaluation

This commit is contained in:
Moritz Lipp 2012-10-31 07:29:17 +01:00
parent f69bfcb5c1
commit 11bf7ba2c8

10
links.c
View file

@ -121,8 +121,7 @@ zathura_link_evaluate(zathura_t* zathura, zathura_link_t* link)
switch (link->type) {
case ZATHURA_LINK_GOTO_DEST:
switch (link->target.destination_type) {
case ZATHURA_LINK_DESTINATION_XYZ: {
if (link->target.destination_type != ZATHURA_LINK_DESTINATION_UNKNOWN) {
if (link->target.scale != 0) {
zathura_document_set_scale(zathura->document, link->target.scale);
}
@ -140,6 +139,7 @@ zathura_link_evaluate(zathura_t* zathura, zathura_link_t* link)
page_offset_t offset;
page_calculate_offset(zathura, page, &offset);
if (link->target.destination_type == ZATHURA_LINK_DESTINATION_XYZ) {
if (link->target.left != -1) {
offset.x += link->target.left * zathura_document_get_scale(zathura->document);
}
@ -147,14 +147,10 @@ zathura_link_evaluate(zathura_t* zathura, zathura_link_t* link)
if (link->target.top != -1) {
offset.y += link->target.top * zathura_document_get_scale(zathura->document);
}
}
position_set_delayed(zathura, offset.x, offset.y);
statusbar_page_number_update(zathura);
}
break;
default:
break;
}
break;
case ZATHURA_LINK_GOTO_REMOTE: