Fix "Automatic Zoom" for landscape documents with very wide pages (issue 5398)

Attempting to fix #5398.