JAL-845 set split frame divider safely for eXpand Views
authorgmungoc <g.m.carstairs@dundee.ac.uk>
Thu, 23 Apr 2015 08:21:53 +0000 (09:21 +0100)
committergmungoc <g.m.carstairs@dundee.ac.uk>
Thu, 23 Apr 2015 08:21:53 +0000 (09:21 +0100)
src/jalview/jbgui/GSplitFrame.java

index a377571..bcd5f64 100644 (file)
@@ -45,7 +45,8 @@ public class GSplitFrame extends JInternalFrame
     splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, topFrame,
             bottomFrame);
     splitPane.setVisible(true);
-    final double ratio = topFrame.getHeight()
+    final double ratio = bottomFrame.getHeight() == 0 ? 0.5d : topFrame
+            .getHeight()
             / (double) (topFrame.getHeight() + bottomFrame.getHeight());
     splitPane.setDividerLocation(ratio);
     splitPane.setResizeWeight(ratio);