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:
Sebastian Ramacher 2014-10-27 17:09:57 +01:00
parent 48183d6717
commit e0753ce954
2 changed files with 3 additions and 4 deletions

View file

@ -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;
}

View file

@ -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));