diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2018-11-13 18:45:02 +0100 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2018-11-13 22:29:33 +0100 |
commit | c409b8bebaeb72f8c95514ed3c01fd173fb0d98b (patch) | |
tree | d2511ea34b7232f7a5be9ba832c1d049fb53abde | |
parent | 225ba4f5fc19dc6783c2063525f8b309aa6a9413 (diff) | |
download | mupdf-c409b8bebaeb72f8c95514ed3c01fd173fb0d98b.tar.xz |
gl: Calculate accurate initial window size when scaling to fit screen.
-rw-r--r-- | platform/gl/gl-main.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/platform/gl/gl-main.c b/platform/gl/gl-main.c index 1910f1b3..7a2ac0a4 100644 --- a/platform/gl/gl-main.c +++ b/platform/gl/gl-main.c @@ -1587,9 +1587,17 @@ int main(int argc, char **argv) sx = sy; if (sx < 1) { + fz_irect area; + currentzoom *= sx; - page_tex.w *= sx; - page_tex.h *= sx; + + /* compute bounds here for initial window size */ + page_bounds = fz_bound_page(ctx, fzpage); + transform_page(); + + area = fz_irect_from_rect(draw_page_bounds); + page_tex.w = area.x1 - area.x0; + page_tex.h = area.y1 - area.y0; } ui_init(page_tex.w, page_tex.h, "MuPDF: Loading..."); |