git://source.jalview.org
/
jalview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
JAL-2674 testing
[jalview.git]
/
src
/
jalview
/
datamodel
/
HiddenColumns.java
diff --git
a/src/jalview/datamodel/HiddenColumns.java
b/src/jalview/datamodel/HiddenColumns.java
index
f8a7f0c
..
839cee2
100644
(file)
--- a/
src/jalview/datamodel/HiddenColumns.java
+++ b/
src/jalview/datamodel/HiddenColumns.java
@@
-1641,14
+1641,14
@@
public class HiddenColumns
private List<int[]> localHidden = new ArrayList<>();
private List<int[]> localHidden = new ArrayList<>();
- private int lasthiddenregion;
+ private int nexthiddenregion;
VisibleColsIterator(int firstcol, int lastcol, boolean useCopy)
{
last = lastcol;
current = firstcol;
next = firstcol;
VisibleColsIterator(int firstcol, int lastcol, boolean useCopy)
{
last = lastcol;
current = firstcol;
next = firstcol;
- lasthiddenregion = -1;
+ nexthiddenregion = 0;
try
{
try
{
@@
-1663,7
+1663,7
@@
public class HiddenColumns
{
int i = 0;
for (i = 0; i < hiddenColumns.size()
{
int i = 0;
for (i = 0; i < hiddenColumns.size()
- && (current < hiddenColumns.get(i)[0]); ++i)
+ && (current <= hiddenColumns.get(i)[0]); ++i)
{
if (current >= hiddenColumns.get(i)[0]
&& current <= hiddenColumns.get(i)[1])
{
if (current >= hiddenColumns.get(i)[0]
&& current <= hiddenColumns.get(i)[1])
@@
-1671,13
+1671,12
@@
public class HiddenColumns
// current is hidden, move to right
current = hiddenColumns.get(i)[1] + 1;
next = current;
// current is hidden, move to right
current = hiddenColumns.get(i)[1] + 1;
next = current;
+ nexthiddenregion = i + 1;
}
}
}
}
- lasthiddenregion = i - 1;
-
for (i = hiddenColumns.size() - 1; i >= 0
for (i = hiddenColumns.size() - 1; i >= 0
- && (last > hiddenColumns.get(i)[1]); --i)
+ && (last >= hiddenColumns.get(i)[1]); --i)
{
if (last >= hiddenColumns.get(i)[0]
&& last <= hiddenColumns.get(i)[1])
{
if (last >= hiddenColumns.get(i)[0]
&& last <= hiddenColumns.get(i)[1])
@@
-1688,7
+1687,7
@@
public class HiddenColumns
}
// make a local copy of the bit we need
}
// make a local copy of the bit we need
- i = lasthiddenregion + 1;
+ i = nexthiddenregion;
while (i < hiddenColumns.size()
&& hiddenColumns.get(i)[0] <= last)
{
while (i < hiddenColumns.size()
&& hiddenColumns.get(i)[0] <= last)
{
@@
-1697,7
+1696,6
@@
public class HiddenColumns
localHidden.add(region);
i++;
}
localHidden.add(region);
i++;
}
- lasthiddenregion = -1;
}
} finally
{
}
} finally
{
@@
-1723,20
+1721,20
@@
public class HiddenColumns
}
current = next;
if ((localHidden != null)
}
current = next;
if ((localHidden != null)
- && (lasthiddenregion + 1 < localHidden.size()))
+ && (nexthiddenregion < localHidden.size()))
{
// still some more hidden regions
{
// still some more hidden regions
- if (next + 1 < localHidden.get(lasthiddenregion + 1)[0])
+ if (next + 1 < localHidden.get(nexthiddenregion)[0])
{
// next+1 is still before the next hidden region
next++;
}
{
// next+1 is still before the next hidden region
next++;
}
- else if ((next + 1 >= localHidden.get(lasthiddenregion + 1)[0])
- && (next + 1 <= localHidden.get(lasthiddenregion + 1)[1]))
+ else if ((next + 1 >= localHidden.get(nexthiddenregion)[0])
+ && (next + 1 <= localHidden.get(nexthiddenregion)[1]))
{
// next + 1 is in the next hidden region
{
// next + 1 is in the next hidden region
- next = localHidden.get(lasthiddenregion + 1)[1] + 1;
- lasthiddenregion++;
+ next = localHidden.get(nexthiddenregion)[1] + 1;
+ nexthiddenregion++;
}
}
else
}
}
else
@@
-1949,7
+1947,6
@@
public class HiddenColumns
int blockEnd = end;
int hiddenSoFar = 0;
int visSoFar = 0;
int blockEnd = end;
int hiddenSoFar = 0;
int visSoFar = 0;
- int maxVisible = end - start;
endsAtHidden = false;
// iterate until a region begins within (start,end]
endsAtHidden = false;
// iterate until a region begins within (start,end]
@@
-1985,9
+1982,9
@@
public class HiddenColumns
i++;
}
i++;
}
- if (visSoFar < maxVisible)
+ if (visSoFar < end - start)
{
{
- blockEnd = blockStart + maxVisible - visSoFar;
+ blockEnd = blockStart + end - start - visSoFar;
int[] contig = new int[] { blockStart, blockEnd };
vcontigs.add(contig);
int[] contig = new int[] { blockStart, blockEnd };
vcontigs.add(contig);