JAL-2759 Additional tests and tweaks to numColumns update
[jalview.git] / src / jalview / datamodel / HiddenColumns.java
index d2e46c6..dfa0890 100644 (file)
@@ -287,7 +287,6 @@ public class HiddenColumns
     region[1] = Math.max(region[1], end);
 
     numColumns += oldstart - region[0];
-    numColumns += region[1] - oldend;
 
     /*
      * also update or remove any subsequent ranges 
@@ -305,11 +304,10 @@ public class HiddenColumns
         break;
       }
       numColumns -= nextRegion[1] - nextRegion[0] + 1;
-      oldend = nextRegion[1];
       region[1] = Math.max(nextRegion[1], end);
-      numColumns += region[1] - oldend + 1;
       endi++;
     }
+    numColumns += region[1] - oldend;
     hiddenColumns.subList(i + 1, endi + 1).clear();
   }