JAL-2439 Fixes to out-by-one sequence indexing in gui classes
[jalview.git] / src / jalview / appletgui / IdCanvas.java
index 8f8ed35..18281d9 100755 (executable)
@@ -117,7 +117,7 @@ public class IdCanvas extends Panel
       }
       else
       {
-        transY = imgHeight - vertical * av.getCharHeight();
+        transY = imgHeight - ((vertical + 1) * av.getCharHeight());
       }
     }
     else if (vertical < 0)
@@ -264,7 +264,7 @@ public class IdCanvas extends Panel
     {
       // Now draw the id strings
       SequenceI seq;
-      for (int i = starty; i < endy; i++)
+      for (int i = starty; i <= endy; i++)
       {
 
         seq = av.getAlignment().getSequenceAt(i);