checks for scrollbar height
authoramwaterhouse <Andrew Waterhouse>
Wed, 18 Apr 2007 12:03:28 +0000 (12:03 +0000)
committeramwaterhouse <Andrew Waterhouse>
Wed, 18 Apr 2007 12:03:28 +0000 (12:03 +0000)
src/jalview/gui/AlignmentPanel.java

index 836d962..f6b56f9 100755 (executable)
@@ -295,9 +295,12 @@ public class AlignmentPanel
       System.out.println("NEEDS FIXING");\r
     }\r
 \r
-    int height = annotationPanel.adjustPanelHeight() +\r
-        hscroll.getPreferredSize().height;\r
+    int height = annotationPanel.adjustPanelHeight();\r
 \r
+    if (hscroll.isVisible())\r
+    {\r
+      height += hscroll.getPreferredSize().height;\r
+    }\r
     if (height > alignFrame.getHeight() / 2)\r
     {\r
       height = alignFrame.getHeight() / 2;\r
@@ -306,8 +309,7 @@ public class AlignmentPanel
     hscroll.addNotify();\r
 \r
     annotationScroller.setPreferredSize(\r
-        new Dimension(annotationScroller.getWidth(),\r
-                      height + hscroll.getHeight()));\r
+        new Dimension(annotationScroller.getWidth(), height));\r
 \r
 \r
     annotationSpaceFillerHolder.setPreferredSize(new Dimension(\r