Wrap alignment with annotations
[jalview.git] / src / jalview / gui / IdCanvas.java
index 9581ccc..2951c14 100755 (executable)
@@ -217,12 +217,28 @@ public class IdCanvas extends JPanel
 \r
         if (av.getWrapAlignment())\r
         {\r
+          int annotationHeight = 0;\r
+\r
+          if(av.showAnnotation)\r
+          {\r
+            AnnotationPanel ap = new AnnotationPanel(av);\r
+            annotationHeight = ap.adjustPanelHeight();\r
+          }\r
+\r
+          int hgap = av.charHeight;\r
+          if (av.scaleAboveWrapped)\r
+            hgap += av.charHeight;\r
+\r
+          int cHeight = av.getAlignment().getHeight() * av.charHeight\r
+              + hgap\r
+              + annotationHeight;\r
+\r
             int rowSize = av.getEndRes() - av.getStartRes();\r
 \r
             // Draw the rest of the panels\r
-            for (int ypos = 2 * av.charHeight, row = av.startRes;\r
+            for (int ypos = hgap, row = av.startRes;\r
                     (ypos <= getHeight()) && (row < av.alignment.getWidth());\r
-                    ypos += av.chunkHeight, row += rowSize)\r
+                    ypos += cHeight, row += rowSize)\r
             {\r
                 for (int i = starty; i < av.alignment.getHeight(); i++)\r
                 {\r