mirror of
https://git.pwmt.org/pwmt/zathura.git
synced 2024-11-11 00:23:47 +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
4
utils.c
4
utils.c
@ -26,10 +26,6 @@
|
||||
double
|
||||
zathura_correct_scale_value(girara_session_t* session, const double scale)
|
||||
{
|
||||
if (scale <= FLT_EPSILON) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (session == NULL) {
|
||||
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);
|
||||
|
||||
/* check for valid scale value */
|
||||
if (file_info.scale <= DBL_EPSILON) {
|
||||
file_info.scale = 1;
|
||||
}
|
||||
zathura_document_set_scale(document,
|
||||
zathura_correct_scale_value(zathura->ui.session, file_info.scale));
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user