JAL-2491 Tweaks to avoid scroll problems at bottom of wrapped alignment
[jalview.git] / src / jalview / viewmodel / ViewportRanges.java
index 72155aa..7a526c7 100644 (file)
@@ -103,11 +103,7 @@ public class ViewportRanges extends ViewportProperties
     }
     this.startRes = startres;
 
-    if (endres >= al.getWidth())
-    {
-      endres = al.getWidth() - 1;
-    }
-    else if (endres < 0)
+    if (endres < 0)
     {
       endres = 0;
     }
@@ -287,11 +283,7 @@ public class ViewportRanges extends ViewportProperties
 
   public void scrollToWrappedVisible(int res)
   {
-    if (res < startRes || res > endRes)
-    {
-      setEndSeq(res / getViewportWidth());
-    }
-
+    setStartRes(res);
   }
 
 }