From ad4f5f5f793bb88786f69ef2531bf850dd57f4c8 Mon Sep 17 00:00:00 2001 From: Abdo Roig-Maranges Date: Fri, 17 Jan 2014 13:09:10 +0100 Subject: [PATCH] fix rectangles subindex. Need page not 0 Signed-off-by: Sebastian Ramacher --- dbus-interface.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dbus-interface.c b/dbus-interface.c index 1d0c13f..c0bf62c 100644 --- a/dbus-interface.c +++ b/dbus-interface.c @@ -168,7 +168,7 @@ highlight_rects(zathura_t* zathura, unsigned int page, document_draw_search_results(zathura, true); - if (rectangles[0] == NULL || girara_list_size(rectangles[0]) == 0) { + if (rectangles[page] == NULL || girara_list_size(rectangles[page]) == 0) { page_set(zathura, page); return; } @@ -188,7 +188,7 @@ highlight_rects(zathura_t* zathura, unsigned int page, unsigned int doc_width = 0; zathura_document_get_document_size(zathura->document, &doc_height, &doc_width); - zathura_rectangle_t* rectangle = girara_list_nth(rectangles[0], 0); + zathura_rectangle_t* rectangle = girara_list_nth(rectangles[page], 0); pos_y += (rectangle->y1 - (double)cell_height/2) / (double)doc_height; pos_x += (rectangle->x1 - (double)cell_width/2) / (double)doc_width;