correct wrap alignment scrollbar size
authoramwaterhouse <Andrew Waterhouse>
Wed, 23 Mar 2005 11:57:06 +0000 (11:57 +0000)
committeramwaterhouse <Andrew Waterhouse>
Wed, 23 Mar 2005 11:57:06 +0000 (11:57 +0000)
src/jalview/gui/AlignmentPanel.java

index 95a8e7c..506fb09 100755 (executable)
@@ -244,29 +244,28 @@ public class AlignmentPanel extends GAlignmentPanel implements AdjustmentListene
                   av.charHeight / 2 + 12));\r
               scalePanelHolder.setPreferredSize(new Dimension(500,\r
                   av.charHeight / 2 + 12));\r
+\r
               if (av.getWrapAlignment())\r
               {\r
                 int max = av.alignment.getWidth() /\r
-                    (seqPanel.seqCanvas.getWidth() / av.charWidth) + 1;\r
+                    (seqPanel.seqCanvas.getWidth() / av.charWidth)+1 ;\r
 \r
-                int h = (av.alignment.getHeight() + 2) * av.charHeight;\r
-                vextent = seqPanel.seqCanvas.getHeight() / h;\r
-                vscroll.setValues(0, vextent, 0, max);\r
+                vscroll.setValues(0, 1, 0, max);\r
               }\r
               else\r
+              {\r
+                av.getConsensus(true);\r
+                if (overviewPanel != null)\r
+                  overviewPanel.updateOverviewImage();\r
+                 setScrollValues(av.getStartRes(), av.getStartSeq());\r
+              }\r
 \r
-              av.getConsensus(true);\r
-              if (overviewPanel != null)\r
-                overviewPanel.updateOverviewImage();\r
-\r
-          validate();\r
-          setScrollValues(av.getStartRes(), av.getStartSeq());\r
           repaint();\r
   }\r
+\r
   int hextent = 0;\r
   int vextent = 0;\r
 \r
-\r
   // return value is true if the scroll is valid\r
   public boolean scrollUp(boolean up)\r
   {\r