Commit e0753ce9 authored by Sebastian Ramacher's avatar Sebastian Ramacher

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's avatarSebastian Ramacher <sebastian+dev@ramacher.at>
parent 48183d67
...@@ -26,10 +26,6 @@ ...@@ -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, ...@@ -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));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment