From 3499146a8122e152f0353b073d9cc1576b40edb5 Mon Sep 17 00:00:00 2001 From: Billy Olsen Date: Mon, 21 Dec 2020 20:19:55 -0700 Subject: [PATCH] Set the glViewport size on reshape Explicitly set the glViewport size on reshape in order to ensure it is rendered at the full scale of the viewport. Not doing so causes the display to render very small. Fixes #790 Signed-off-by: Billy Olsen --- swing/src/net/sf/openrocket/gui/figure3d/RocketFigure3d.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/swing/src/net/sf/openrocket/gui/figure3d/RocketFigure3d.java b/swing/src/net/sf/openrocket/gui/figure3d/RocketFigure3d.java index 45eeb7758..372e18867 100644 --- a/swing/src/net/sf/openrocket/gui/figure3d/RocketFigure3d.java +++ b/swing/src/net/sf/openrocket/gui/figure3d/RocketFigure3d.java @@ -459,6 +459,8 @@ public class RocketFigure3d extends JPanel implements GLEventListener { final double ratio = (double) w / (double) h; fovX = fovY * ratio; + // Make sure to set the viewport size to cover the full size + gl.glViewport(0, 0, w, h); gl.glMatrixMode(GLMatrixFunc.GL_PROJECTION); gl.glLoadIdentity(); glu.gluPerspective(fovY, ratio, 0.1f, 50f);