mirror of
https://git.pwmt.org/pwmt/zathura.git
synced 2025-01-05 21:56:01 +01:00
parent
d05e40a8b5
commit
de17088c91
1 changed files with 26 additions and 14 deletions
40
shortcuts.c
40
shortcuts.c
|
@ -118,20 +118,32 @@ sc_adjust_window(girara_session_t* session, girara_argument_t* argument,
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned int rotation = zathura_document_get_rotation(zathura->document);
|
unsigned int rotation = zathura_document_get_rotation(zathura->document);
|
||||||
if (argument->n == ZATHURA_ADJUST_WIDTH) {
|
switch (argument->n) {
|
||||||
if (rotation == 0 || rotation == 180) {
|
case ZATHURA_ADJUST_WIDTH:
|
||||||
zathura_document_set_scale(zathura->document, width / total_width);
|
if (rotation == 0 || rotation == 180) {
|
||||||
} else {
|
zathura_document_set_scale(zathura->document, width / total_width);
|
||||||
zathura_document_set_scale(zathura->document, width / total_height);
|
} else {
|
||||||
}
|
zathura_document_set_scale(zathura->document, width / total_height);
|
||||||
} else if (argument->n == ZATHURA_ADJUST_BESTFIT) {
|
}
|
||||||
if (rotation == 0 || rotation == 180) {
|
break;
|
||||||
zathura_document_set_scale(zathura->document, height / max_height);
|
case ZATHURA_ADJUST_BESTFIT:
|
||||||
} else {
|
if (total_width < total_height) {
|
||||||
zathura_document_set_scale(zathura->document, width / total_height);
|
if (rotation == 0 || rotation == 180) {
|
||||||
}
|
zathura_document_set_scale(zathura->document, height / max_height);
|
||||||
} else {
|
} else {
|
||||||
goto error_ret;
|
zathura_document_set_scale(zathura->document, width / total_height);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (rotation == 0 || rotation == 180) {
|
||||||
|
zathura_document_set_scale(zathura->document, width / total_width);
|
||||||
|
} else {
|
||||||
|
zathura_document_set_scale(zathura->document, height / total_width);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
goto error_ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* keep position */
|
/* keep position */
|
||||||
|
|
Loading…
Reference in a new issue