\r
if (av.wrapAlignment)\r
{\r
+\r
+ int hgap = av.charHeight;\r
+ if (av.scaleAboveWrapped)\r
+ hgap += av.charHeight;\r
+\r
+ int cHeight = av.getAlignment().getHeight() * av.charHeight\r
+ + hgap + seqCanvas.getAnnotationHeight();\r
+\r
int y = evt.getY();\r
- y -= (2 * av.charHeight);\r
+ y -= hgap;\r
x -= seqCanvas.LABEL_WEST;\r
\r
- int chunkHeight = (av.getAlignment().getHeight() + 2) * av.charHeight;\r
- int cwidth = seqCanvas.getWrappedCanvasWidth(this.getSize().width);\r
- wrappedBlock = y/chunkHeight;\r
- wrappedBlock += av.getStartRes()/cwidth;\r
\r
- res = wrappedBlock*cwidth + x / av.getCharWidth();\r
+ int cwidth = seqCanvas.getWrappedCanvasWidth(getSize().width);\r
+\r
+ wrappedBlock = y / cHeight;\r
+ wrappedBlock += av.getStartRes() / cwidth;\r
+\r
+ res = wrappedBlock * cwidth + x / av.getCharWidth();\r
+\r
}\r
else\r
{\r
\r
int findSeq(MouseEvent evt)\r
{\r
+\r
int seq = 0;\r
int y = evt.getY();\r
\r
if (av.wrapAlignment)\r
{\r
- y -= (2 * av.charHeight);\r
- int chunkHeight = (av.getAlignment().getHeight() + 2) * av.charHeight;\r
- seq = ( (y % chunkHeight) / av.getCharHeight());\r
+ int hgap = av.charHeight;\r
+ if (av.scaleAboveWrapped)\r
+ hgap += av.charHeight;\r
+\r
+ int cHeight = av.getAlignment().getHeight() * av.charHeight\r
+ + hgap + seqCanvas.getAnnotationHeight();\r
+\r
+ y -= hgap;\r
+\r
+ seq = ( (y % cHeight) / av.getCharHeight());\r
}\r
else\r
{\r
}\r
}\r
\r
+ if(seqCanvas.pdbCanvas!=null && sequence==seqCanvas.pdbCanvas.sequence)\r
+ {\r
+ seqCanvas.pdbCanvas.highlightRes(sequence.findPosition(res));\r
+ }\r
+\r
ap.alignFrame.statusBar.setText(text.toString());\r
\r
// use aa to see if the mouse pointer is on a\r
while (e.hasMoreElements())\r
{\r
SequenceFeature sf = (SequenceFeature) e.nextElement();\r
- if (sf.getStart() <= sequence.findPosition(res) &&\r
+ if (sf.getBegin() <= sequence.findPosition(res) &&\r
sf.getEnd() >= sequence.findPosition(res))\r
{\r
if (sbuffer.length() > 0)\r