summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--platform/gl/gl-main.c12
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...");