{
x = 0;
}
- else if (x >= width)
- {
- x = alwidth - 1;
- }
if (y < 0)
{
y = 0;
}
- else if (y >= sequencesHeight)
- {
- y = alheight - 1;
- }
//
// Convert x value to residue position
int endRes = xAsRes + vpwidth - 1;
// check in case we went off the edge of the alignment
- if (endRes > alwidth)
+ int visAlignWidth = hiddenCols.findColumnPosition(alwidth);
+ if (endRes > visAlignWidth - 1)
{
// went past the end of the alignment, adjust backwards
- endRes = alwidth;
+ endRes = visAlignWidth - 1;
// recalc xAsRes backwards from endRes
// add 1 because width includes xAsRes
- xAsRes = endRes - vpwidth + 1;
+ xAsRes = hiddenCols.adjustForHiddenColumns(endRes - vpwidth + 1);
}
//
int endSeq = yAsSeq + vpheight - 1;
// check in case we went off the edge of the alignment
- if (endSeq > alheight)
+ int visAlignHeight = hiddenSeqs.findIndexWithoutHiddenSeqs(alheight);
+ if (hiddenSeqs.findIndexWithoutHiddenSeqs(endSeq) > visAlignHeight - 1)
{
// went past the end of the alignment, adjust backwards
- endSeq = alheight;
+ endSeq = visAlignHeight - 1;
// recalc yAsSeq backwards from endSeq
yAsSeq = endSeq - vpheight + 1;
}