// define our cursor image
BufferedImage cursorImage = null;
+ // convert the cursorY into a position on the visible alignment
+ int cursor_ypos = av.getAlignment().getHiddenColumns()
+ .findColumnPosition(cursorY);
+
// don't do work unless we have to
- if (av.cursorMode && cursorY >= startSeq && cursorY <= endSeq)
+ if (av.cursorMode && cursor_ypos >= startSeq && cursor_ypos <= endSeq)
{
int yoffset = 0;
int xoffset = 0;
int startx = startRes;
int endx = endRes;
+
+ // convert the cursorX into a position on the visible alignment
+ int cursor_xpos = av.getAlignment().getHiddenColumns()
+ .findColumnPosition(cursorX);
+
if (av.getWrapAlignment())
{
// work out the correct offsets for the cursor
int ypos = hgap; // vertical offset
// iterate down the wrapped panels
- while ((ypos <= canvasHeight) && (endx < cursorX))
+ while ((ypos <= canvasHeight) && (endx < cursor_xpos))
{
// update vertical offset
ypos += cHeight + getAnnotationHeight() + hgap;
}
// now check if cursor is within range for x values
- if (cursorX >= startx && cursorX <= endx)
+ if (cursor_xpos >= startx && cursor_xpos <= endx)
{
// get a new image of the correct size
cursorImage = setupImage();
char s = seq.getCharAt(cursorX);
seqRdr.drawCursor(g, s,
- xoffset + (cursorX - startx) * av.getCharWidth(),
- yoffset + (cursorY - startSeq) * av.getCharHeight());
+ xoffset + (cursor_xpos - startx) * av.getCharWidth(),
+ yoffset + (cursor_ypos - startSeq) * av.getCharHeight());
g.dispose();
}
}