Commit 1a8e211a authored by Abdo Roig-Maranges's avatar Abdo Roig-Maranges Committed by Sebastian Ramacher

properly scale and rotate rectangle

Signed-off-by: Sebastian Ramacher's avatarSebastian Ramacher <sebastian+dev@ramacher.at>
parent ad4f5f5f
......@@ -188,9 +188,13 @@ 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[page], 0);
pos_y += (rectangle->y1 - (double)cell_height/2) / (double)doc_height;
pos_x += (rectangle->x1 - (double)cell_width/2) / (double)doc_width;
/* Need to adjust rectangle to page scale and orientation */
zathura_page_t* doc_page = zathura_document_get_page(zathura->document, page);
zathura_rectangle_t* rect = girara_list_nth(rectangles[page], 0);
zathura_rectangle_t rectangle = recalc_rectangle(doc_page, *rect);
pos_y += (rectangle.y1 - (double)cell_height/2) / (double)doc_height;
pos_x += (rectangle.x1 - (double)cell_width/2) / (double)doc_width;
/* move to position */
zathura_jumplist_add(zathura);
......
......@@ -917,6 +917,7 @@ sc_search(girara_session_t* session, girara_argument_t* argument,
g_object_set(page_widget, "search-current", target_idx, NULL);
g_object_get(page_widget, "search-results", &results, NULL);
/* Need to adjust rectangle to page scale and orientation */
zathura_rectangle_t* rect = girara_list_nth(results, target_idx);
zathura_rectangle_t rectangle = recalc_rectangle(target_page, *rect);
......
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