diff --git a/swing/src/net/sf/openrocket/gui/figure3d/RocketFigure3d.java b/swing/src/net/sf/openrocket/gui/figure3d/RocketFigure3d.java index 76c29cc4a..738d02270 100644 --- a/swing/src/net/sf/openrocket/gui/figure3d/RocketFigure3d.java +++ b/swing/src/net/sf/openrocket/gui/figure3d/RocketFigure3d.java @@ -515,9 +515,11 @@ public class RocketFigure3d extends JPanel implements GLEventListener { // Calculate the distance needed to fit the bounds in both the X and Y // direction // Add 10% for space around it. + final double maxR = Math.max( Math.hypot(b.min.y, b.min.z), + Math.hypot(b.max.y, b.max.z)); final double dX = (b.span().x * 1.2 / 2.0) / Math.tan(Math.toRadians(fovX / 2.0)); - final double dY = (b.span().y * 1.2 / 2.0) + final double dY = (2*maxR * 1.2 / 2.0) / Math.tan(Math.toRadians(fovY / 2.0)); // Move back the greater of the 2 distances