JAL-3253 fix scrollTo termination check.
[jalview.git] / src / jalview / viewmodel / ViewportRanges.java
index 9f54964..a022627 100644 (file)
@@ -224,7 +224,7 @@ public class ViewportRanges extends ViewportProperties
   public void setStartSeq(int seq)
   {
     int height = getViewportHeight();
-    int startseq = Math.max(seq, getVisibleAlignmentHeight() - height);
+    int startseq = Math.min(seq, getVisibleAlignmentHeight() - height);
     // BH 2019.07.27 cosmetic only -- was:
     // if (startseq + height - 1 > getVisibleAlignmentHeight() - 1)
     // {