/*
* Scroll left to make start of search results visible
*/
- setScrollValues(start - 1, seqIndex);
+ // setScrollValues(start - 1, seqIndex); // plus one residue
+ setScrollValues(start, seqIndex);
}
else if ((endv = av.getEndRes()) <= end)
{
/*
* Scroll right to make end of search results visible
*/
- setScrollValues(startv + 1 + end - endv, seqIndex);
+ // setScrollValues(startv + 1 + end - endv, seqIndex); // plus one
+ setScrollValues(startv + end - endv, seqIndex);
}
else if ((starts = av.getStartSeq()) > seqIndex)
{
int wrappedBlock = -1;
+ /**
+ * Returns the aligned sequence position (base 0) at the mouse position, or
+ * the closest visible one
+ *
+ * @param evt
+ * @return
+ */
int findRes(MouseEvent evt)
{
int res = 0;
}
else
{
- if (x > seqCanvas.getWidth() + seqCanvas.getWidth())
+ if (x > seqCanvas.getX() + seqCanvas.getWidth())
{
// make sure we calculate relative to visible alignment, rather than
// right-hand gutter
x = seqCanvas.getX() + seqCanvas.getWidth();
}
res = (x / av.getCharWidth()) + av.getStartRes();
+ if (res > av.getEndRes())
+ {
+ // moused off right
+ res = av.getEndRes();
+ }
}
if (av.hasHiddenColumns())
if (av.isFollowHighlight())
{
/*
- * if scrollToPosition requires scroll adjustment, this flag prevents
+ * if scrollToPosition requires a scroll adjustment, this flag prevents
* another scroll event being propagated back to the originator
*
* @see AlignmentPanel#adjustmentValueChanged
*/
int seqOffset = 0;
SequenceI sequence = null;
+
+ /*
+ * locate 'middle' column (true middle if an odd number visible, left of
+ * middle if an even number visible)
+ */
int middleColumn = getStartRes() + (getEndRes() - getStartRes()) / 2;
final HiddenSequences hiddenSequences = getAlignment()
.getHiddenSequences();