git://source.jalview.org
/
jalview.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
f02e65a
)
JAL-2811 Made it work for hidden columns/seqs too
author
kiramt
<k.mourao@dundee.ac.uk>
Tue, 14 Nov 2017 13:43:40 +0000
(13:43 +0000)
committer
kiramt
<k.mourao@dundee.ac.uk>
Tue, 14 Nov 2017 13:43:40 +0000
(13:43 +0000)
src/jalview/gui/SeqCanvas.java
patch
|
blob
|
history
diff --git
a/src/jalview/gui/SeqCanvas.java
b/src/jalview/gui/SeqCanvas.java
index
394a0b6
..
4aa7851
100755
(executable)
--- a/
src/jalview/gui/SeqCanvas.java
+++ b/
src/jalview/gui/SeqCanvas.java
@@
-1275,13
+1275,22
@@
public class SeqCanvas extends JComponent implements ViewportListenerI
// define our cursor image
BufferedImage cursorImage = null;
// 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
// 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;
{
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
if (av.getWrapAlignment())
{
// work out the correct offsets for the cursor
@@
-1305,7
+1314,7
@@
public class SeqCanvas extends JComponent implements ViewportListenerI
int ypos = hgap; // vertical offset
// iterate down the wrapped panels
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;
{
// update vertical offset
ypos += cHeight + getAnnotationHeight() + hgap;
@@
-1319,7
+1328,7
@@
public class SeqCanvas extends JComponent implements ViewportListenerI
}
// now check if cursor is within range for x values
}
// 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();
{
// get a new image of the correct size
cursorImage = setupImage();
@@
-1330,8
+1339,8
@@
public class SeqCanvas extends JComponent implements ViewportListenerI
char s = seq.getCharAt(cursorX);
seqRdr.drawCursor(g, s,
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();
}
}
g.dispose();
}
}