From f10d847a95f007d43e392a1c418eb0a6168e33f5 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Wed, 30 Oct 2013 03:35:56 +0100 Subject: [PATCH] CS Signed-off-by: Sebastian Ramacher --- commands.c | 3 ++- links.c | 9 ++++++--- shortcuts.c | 9 ++++++--- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/commands.c b/commands.c index 900bfc3..9b2e798 100644 --- a/commands.c +++ b/commands.c @@ -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; diff --git a/links.c b/links.c index c221cc3..085fcaa 100644 --- a/links.c +++ b/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; diff --git a/shortcuts.c b/shortcuts.c index f50325e..3908167 100644 --- a/shortcuts.c +++ b/shortcuts.c @@ -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;