}
int index = 0;
int hiddenSeqs = 0;
+ int diff = 0;
if (hiddenSequences.length <= alignmentIndex)
{
+ // if the alignmentIndex runs past the end of hidden sequences
+ // and therefore actually past the end of the alignment
+ // store the difference to add back on at the end, so that behaviour
+ // is consistent with hidden columns behaviour (used by overview panel)
+ diff = alignmentIndex - hiddenSequences.length + 1;
alignmentIndex = hiddenSequences.length - 1;
}
index++;
}
- return (alignmentIndex - hiddenSeqs);
+ return (alignmentIndex - hiddenSeqs + diff);
}
/**
* the row to start from
* @return the position of the row in the visible alignment
*/
- public int findIndexNAboveRow(int visibleDistance, int startRow)
+ public int subtractVisibleRows(int visibleDistance, int startRow)
{
// walk upwards through the alignment
// count all the non-null sequences until we have visibleDistance counted