Respect padding in sc_adjust_window

Thanks to Marwan Tanager
This commit is contained in:
Moritz Lipp 2013-02-07 09:26:35 +01:00
parent 88f1866fc4
commit ce6e7351ca

View file

@ -144,7 +144,7 @@ sc_adjust_window(girara_session_t* session, girara_argument_t* argument,
if (argument->n == ZATHURA_ADJUST_WIDTH ||
(argument->n == ZATHURA_ADJUST_BESTFIT && page_ratio < window_ratio)) {
scale = (double)(width - (pages_per_row - 1) * padding) /
(double)(pages_per_row * cell_width);
(double)(pages_per_row * cell_width + (pages_per_row - 1) * padding);
zathura_document_set_scale(zathura->document, scale);
bool show_scrollbars = false;
@ -165,7 +165,7 @@ sc_adjust_window(girara_session_t* session, girara_argument_t* argument,
if (0 < requisition.width && (unsigned)requisition.width < width) {
width -= requisition.width;
scale = (double)(width - (pages_per_row - 1) * padding) /
(double)(pages_per_row * cell_width);
(double)(pages_per_row * cell_width + (pages_per_row - 1) * padding);
zathura_document_set_scale(zathura->document, scale);
}
}