-
- }
-
- /**
- * Answers the index in the alignment (0...) of the sequence under the mouse
- * position. If the mouse is below the alignment (say, over annotations),
- * answers the index of the last sequence.
- *
- * @param evt
- * @return
- */
- int findSeq(MouseEvent evt)
- {
- int seq = 0;
- int y = evt.getY();
-
- int charHeight = av.getCharHeight();
- int alignmentHeight = av.getAlignment().getHeight();
- if (av.getWrapAlignment())
- {
- int hgap = charHeight;
- if (av.getScaleAboveWrapped())
- {
- hgap += charHeight;
- }
-
- int alignmentHeightPixels = alignmentHeight * charHeight;
- int cHeight = alignmentHeightPixels + hgap
- + seqCanvas.getAnnotationHeight();
-
- y -= hgap;
-
- int yOffsetPx = y % cHeight; // yPos below repeating width(s)
-// if (yOffsetPx > alignmentHeightPixels)
-// {
-// seq = -1; // cursor is over annotation or below alignment entirely
-// }
-// else
- // {
- seq = Math.min(yOffsetPx / charHeight, alignmentHeight - 1);
-// }
- }
- else
- {
- seq = Math.min((y / charHeight) + av.getRanges().getStartSeq(),
- alignmentHeight - 1);
- }
-
- return seq;