mirror of
https://git.pwmt.org/pwmt/zathura.git
synced 2024-12-29 16:46:00 +01:00
Move input validation back to document_open
Re-setting scale back to 1 does not make sense if the change to scale comes from zooming in zathura. Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
This commit is contained in:
parent
48183d6717
commit
e0753ce954
2 changed files with 3 additions and 4 deletions
4
utils.c
4
utils.c
|
@ -26,10 +26,6 @@
|
||||||
double
|
double
|
||||||
zathura_correct_scale_value(girara_session_t* session, const double scale)
|
zathura_correct_scale_value(girara_session_t* session, const double scale)
|
||||||
{
|
{
|
||||||
if (scale <= FLT_EPSILON) {
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (session == NULL) {
|
if (session == NULL) {
|
||||||
return scale;
|
return scale;
|
||||||
}
|
}
|
||||||
|
|
|
@ -607,6 +607,9 @@ document_open(zathura_t* zathura, const char* path, const char* password,
|
||||||
zathura_document_set_page_offset(document, file_info.page_offset);
|
zathura_document_set_page_offset(document, file_info.page_offset);
|
||||||
|
|
||||||
/* check for valid scale value */
|
/* check for valid scale value */
|
||||||
|
if (file_info.scale <= DBL_EPSILON) {
|
||||||
|
file_info.scale = 1;
|
||||||
|
}
|
||||||
zathura_document_set_scale(document,
|
zathura_document_set_scale(document,
|
||||||
zathura_correct_scale_value(zathura->ui.session, file_info.scale));
|
zathura_correct_scale_value(zathura->ui.session, file_info.scale));
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue