JAL-2491 Make it work with cursor movement
[jalview.git] / src / jalview / viewmodel / ViewportRanges.java
index 15f5023..ebacab1 100644 (file)
@@ -390,15 +390,24 @@ public class ViewportRanges extends ViewportProperties
     setStartRes((res / width) * width);
   }
 
-  // pass av here until hidden columns JAL-2388 merged, then use alignment
-  // instead
+  /**
+   * Scroll so that (x,y) is visible
+   * 
+   * @param x
+   *          x position in alignment
+   * @param y
+   *          y position in alignment
+   * @param av
+   *          viewport to be visible in. Here until hidden columns JAL-2388
+   *          merged, then use alignment to get hidden cols
+   */
   public void scrollToVisible(int x, int y, AlignViewportI av)
   {
     while (y < startSeq)
     {
       scrollUp(true);
     }
-    while (y + 1 > endSeq)
+    while (y > endSeq)
     {
       scrollUp(false);
     }