JAL-2388 Working hidden regions hide/show in desktop
[jalview.git] / src / jalview / datamodel / VisibleRowsIterator.java
index 0259fd3..a9c782d 100644 (file)
@@ -57,12 +57,12 @@ public class VisibleRowsIterator implements Iterator<Integer>
     current = firstrow;
     last = lastrow;
     hidden = al.getHiddenSequences();
-    while (hidden.isHidden(last) && last > current)
+    while (last > current && hidden.isHidden(last))
     {
       last--;
     }
     current = firstrow;
-    while (hidden.isHidden(current) && current < last)
+    while (current < last && hidden.isHidden(current))
     {
       current++;
     }
@@ -86,7 +86,7 @@ public class VisibleRowsIterator implements Iterator<Integer>
     do
     {
       next++;
-    } while (hidden.isHidden(next) && next <= last);
+    } while (next <= last && hidden.isHidden(next));
     return current;
   }