JAL-2609 process only up to end of alignment when shifting sequences
authorgmungoc <g.m.carstairs@dundee.ac.uk>
Thu, 3 Aug 2017 15:27:14 +0000 (17:27 +0200)
committergmungoc <g.m.carstairs@dundee.ac.uk>
Thu, 3 Aug 2017 15:27:14 +0000 (17:27 +0200)
src/jalview/gui/SeqCanvas.java

index 12b426d..576d6ca 100755 (executable)
@@ -1505,8 +1505,15 @@ public class SeqCanvas extends JComponent implements ViewportListenerI
     {
       visibleWidths++;
     }
-    // todo limit visibleWidths to not exceed width of alignment
-    // (don't process white space below)
+    /*
+     *  limit visibleWidths to not exceed width of alignment
+     */
+    int maxWidths = (xMax - ranges.getStartRes()) / viewportWidth;
+    if (xMax % viewportWidth > 0)
+    {
+      maxWidths++;
+    }
+    visibleWidths = Math.min(visibleWidths, maxWidths);
 
     if (positions > 0)
     {