JAL-2674 add bounds to findHiddenRegionPositions
[jalview.git] / src / jalview / gui / ScalePanel.java
index 7c497d1..4e4db23 100755 (executable)
@@ -487,16 +487,12 @@ public class ScalePanel extends JPanel
 
       if (av.getShowHiddenMarkers())
       {
-        List<Integer> positions = hidden.findHiddenRegionPositions();
+        List<Integer> positions = hidden.findHiddenRegionPositions(startx,
+                startx + widthx + 1);
         for (int pos : positions)
         {
           res = pos - startx;
 
-          if (res < 0 || res > widthx)
-          {
-            continue;
-          }
-
           gg.fillPolygon(
                   new int[]
                   { -1 + res * avCharWidth - avCharHeight / 4,