mirror of
https://git.pwmt.org/pwmt/zathura.git
synced 2024-12-29 14:46:00 +01:00
properly scale and rotate rectangle
Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
This commit is contained in:
parent
ad4f5f5f79
commit
1a8e211a3b
2 changed files with 8 additions and 3 deletions
|
@ -188,9 +188,13 @@ highlight_rects(zathura_t* zathura, unsigned int page,
|
||||||
unsigned int doc_width = 0;
|
unsigned int doc_width = 0;
|
||||||
zathura_document_get_document_size(zathura->document, &doc_height, &doc_width);
|
zathura_document_get_document_size(zathura->document, &doc_height, &doc_width);
|
||||||
|
|
||||||
zathura_rectangle_t* rectangle = girara_list_nth(rectangles[page], 0);
|
/* Need to adjust rectangle to page scale and orientation */
|
||||||
pos_y += (rectangle->y1 - (double)cell_height/2) / (double)doc_height;
|
zathura_page_t* doc_page = zathura_document_get_page(zathura->document, page);
|
||||||
pos_x += (rectangle->x1 - (double)cell_width/2) / (double)doc_width;
|
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 */
|
/* move to position */
|
||||||
zathura_jumplist_add(zathura);
|
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_set(page_widget, "search-current", target_idx, NULL);
|
||||||
g_object_get(page_widget, "search-results", &results, 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* rect = girara_list_nth(results, target_idx);
|
||||||
zathura_rectangle_t rectangle = recalc_rectangle(target_page, *rect);
|
zathura_rectangle_t rectangle = recalc_rectangle(target_page, *rect);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue