mirror of
https://git.pwmt.org/pwmt/zathura.git
synced 2024-12-28 06:46:00 +01:00
CS
Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
This commit is contained in:
parent
e99be0fcce
commit
f10d847a95
3 changed files with 14 additions and 7 deletions
|
@ -119,8 +119,9 @@ cmd_bookmark_open(girara_session_t* session, girara_list_t* argument_list)
|
|||
|
||||
zathura_jumplist_add(zathura);
|
||||
page_set(zathura, bookmark->page - 1);
|
||||
if (bookmark->x != DBL_MIN && bookmark->y != DBL_MIN)
|
||||
if (bookmark->x != DBL_MIN && bookmark->y != DBL_MIN) {
|
||||
position_set(zathura, bookmark->x, bookmark->y);
|
||||
}
|
||||
zathura_jumplist_add(zathura);
|
||||
|
||||
return true;
|
||||
|
|
9
links.c
9
links.c
|
@ -143,16 +143,19 @@ zathura_link_evaluate(zathura_t* zathura, zathura_link_t* link)
|
|||
|
||||
/* compute the position with the page aligned to the top and left
|
||||
of the viewport */
|
||||
double pos_x=0, pos_y=0;
|
||||
double pos_x = 0;
|
||||
double pos_y = 0;
|
||||
page_number_to_position(zathura->document, link->target.page_number,
|
||||
0.0, 0.0, &pos_x, &pos_y);
|
||||
|
||||
/* correct to place the target position at the top of the viewport */
|
||||
/* NOTE: link->target is in page units, needs to be scaled and rotated */
|
||||
unsigned int cell_height=0, cell_width=0;
|
||||
unsigned int cell_height = 0;
|
||||
unsigned int cell_width = 0;
|
||||
zathura_document_get_cell_size(zathura->document, &cell_height, &cell_width);
|
||||
|
||||
unsigned int doc_height=0, doc_width=0;
|
||||
unsigned int doc_height = 0;
|
||||
unsigned int doc_width = 0;
|
||||
zathura_document_get_document_size(zathura->document, &doc_height, &doc_width);
|
||||
|
||||
bool link_hadjust = true;
|
||||
|
|
|
@ -916,16 +916,19 @@ sc_search(girara_session_t* session, girara_argument_t* argument,
|
|||
girara_setting_get(session, "search-hadjust", &search_hadjust);
|
||||
|
||||
/* compute the position of the center of the page */
|
||||
double pos_x=0, pos_y=0;
|
||||
double pos_x = 0;
|
||||
double pos_y = 0;
|
||||
page_number_to_position(zathura->document, zathura_page_get_index(target_page),
|
||||
0.5, 0.5, &pos_x, &pos_y);
|
||||
|
||||
/* correction to center the current result */
|
||||
/* NOTE: rectangle is in viewport units, already scaled and rotated */
|
||||
unsigned int cell_height=0, cell_width=0;
|
||||
unsigned int cell_height = 0;
|
||||
unsigned int cell_width = 0;
|
||||
zathura_document_get_cell_size(zathura->document, &cell_height, &cell_width);
|
||||
|
||||
unsigned int doc_height=0, doc_width=0;
|
||||
unsigned int doc_height = 0;
|
||||
unsigned int doc_width = 0;
|
||||
zathura_document_get_document_size(zathura->document, &doc_height, &doc_width);
|
||||
|
||||
pos_y += (rectangle.y1 - (double)cell_height/2) / (double)doc_height;
|
||||
|
|
Loading…
Reference in a new issue