mirror of
https://git.pwmt.org/pwmt/zathura.git
synced 2025-02-27 17:14:40 +01:00
Revert commit ce6e735
This wasn't correct. Padding is already accounted for: scale = (width - (pages_per_row - 1) * padding) / (pages_per_row * cell_width) If you add padding on the denominator, you end up with black margins on the sides of the window, which isn't what padding is for (i.e. insert a gap between rendered pages), and defeats the purpose of a "best-fit". Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
This commit is contained in:
parent
9b1a037fe0
commit
f5b02a9751
1 changed files with 2 additions and 2 deletions
|
@ -144,7 +144,7 @@ sc_adjust_window(girara_session_t* session, girara_argument_t* argument,
|
||||||
if (argument->n == ZATHURA_ADJUST_WIDTH ||
|
if (argument->n == ZATHURA_ADJUST_WIDTH ||
|
||||||
(argument->n == ZATHURA_ADJUST_BESTFIT && page_ratio < window_ratio)) {
|
(argument->n == ZATHURA_ADJUST_BESTFIT && page_ratio < window_ratio)) {
|
||||||
scale = (double)(width - (pages_per_row - 1) * padding) /
|
scale = (double)(width - (pages_per_row - 1) * padding) /
|
||||||
(double)(pages_per_row * cell_width + (pages_per_row - 1) * padding);
|
(double)(pages_per_row * cell_width);
|
||||||
zathura_document_set_scale(zathura->document, scale);
|
zathura_document_set_scale(zathura->document, scale);
|
||||||
|
|
||||||
bool show_scrollbars = false;
|
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) {
|
if (0 < requisition.width && (unsigned)requisition.width < width) {
|
||||||
width -= requisition.width;
|
width -= requisition.width;
|
||||||
scale = (double)(width - (pages_per_row - 1) * padding) /
|
scale = (double)(width - (pages_per_row - 1) * padding) /
|
||||||
(double)(pages_per_row * cell_width + (pages_per_row - 1) * padding);
|
(double)(pages_per_row * cell_width);
|
||||||
zathura_document_set_scale(zathura->document, scale);
|
zathura_document_set_scale(zathura->document, scale);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue