From 242329b534af9cf04b423bf1e4fa7a7f8bac9030 Mon Sep 17 00:00:00 2001 From: Reto Schnyder Date: Thu, 5 Aug 2021 16:57:41 +0200 Subject: [PATCH] Fix links that target a location within a page Before, clicking on a link would always jump to the beginning of the linked-to page, even when the link targets a specific point within the page. --- zathura/links.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zathura/links.c b/zathura/links.c index b547782..93ceb20 100644 --- a/zathura/links.c +++ b/zathura/links.c @@ -172,14 +172,14 @@ link_goto_dest(zathura_t* zathura, const zathura_link_t* link) /* shift the position or set to auto */ if (link->target.destination_type == ZATHURA_LINK_DESTINATION_XYZ && link->target.left != -1 && link_hadjust == true) { - pos_x += shiftx / doc_width; + pos_x += shiftx * cell_width / doc_width; } else { pos_x = -1; /* -1 means automatic */ } if (link->target.destination_type == ZATHURA_LINK_DESTINATION_XYZ && link->target.top != -1) { - pos_y += shifty / doc_height; + pos_y += shifty * cell_height / doc_height; } else { pos_y = -1; /* -1 means automatic */ }