- // find bounds and set origin appopriately
- // locate first visible position for this sequence
- int[] refbounds = av.getColumnSelection()
- .locateVisibleBoundsOfSequence(refSeq);
+ // find bounds and set origin appropriately
+ // locate first residue in sequence which is not hidden
+ Iterator<int[]> it = hc.iterator();
+ int index = refSeq.firstResidueOutsideIterator(it);
+ refSp = hc.absoluteToVisibleColumn(index);
+
+ refStartI = refSeq.findIndex(refSeq.getStart()) - 1;
+
+ int seqlength = refSeq.getLength();
+ // get sequence position past the end of the sequence
+ int pastEndPos = refSeq.findPosition(seqlength + 1);
+ refEndI = refSeq.findIndex(pastEndPos - 1) - 1;