Fix invalid zoom when opening document with "adjust-open width" option

This commit fixes attempt to set INFINITY zoom value when opening
document for first time with "adjust-open width" option.

In this case function zathura_document_get_document_size returns 0 width
which leads to incorrect zoom calculation.
This commit is contained in:
Georgy Komarov 2020-08-23 20:44:45 +03:00
parent 3a20080210
commit 582d3f6be3
Failed to generate hash of commit

View file

@ -1685,7 +1685,7 @@ adjust_view(zathura_t* zathura)
zathura_document_get_document_size(zathura->document, &document_height, &document_width);
zathura_document_get_viewport_size(zathura->document, &view_height, &view_width);
if (view_height == 0 || view_width == 0 || cell_height == 0 || cell_width == 0) {
if (view_height == 0 || view_width == 0 || cell_height == 0 || cell_width == 0 || document_width == 0) {
goto error_ret;
}