// reset the viewport ranges when the alignment panel is resized
// in particular, this initialises the end residue value when Jalview
// is initialised
-
-
if (av.getWrapAlignment())
{
int widthInRes = getSeqPanel().seqCanvas
.getWrappedCanvasWidth(getSeqPanel().seqCanvas.getWidth());
- vpRanges.setStartEndRes(vpRanges.getStartRes(), widthInRes);
+ vpRanges.setStartEndRes(vpRanges.getStartRes(),
+ vpRanges.getStartRes() + widthInRes);
}
else
{
.getCharWidth()) - 1;
int heightInSeq = (getSeqPanel().seqCanvas.getHeight() / av.getCharHeight()) - 1;
- vpRanges.setStartEndRes(vpRanges.getStartRes(), widthInRes);
- vpRanges.setStartEndSeq(vpRanges.getStartSeq(), heightInSeq);
+ vpRanges.setStartEndRes(vpRanges.getStartRes(),
+ vpRanges.getStartRes() + widthInRes);
+ vpRanges.setStartEndSeq(vpRanges.getStartSeq(),
+ vpRanges.getStartSeq() + heightInSeq);
}
-
-
}
});
else
{
vpRanges.scrollToWrappedVisible(start);
- // scrollToWrappedVisible(start);
}
}
{
int widthInRes = getSeqPanel().seqCanvas
.getWrappedCanvasWidth(getSeqPanel().seqCanvas.getWidth());
- vpRanges.setStartEndRes(vpRanges.getStartRes(), widthInRes);
+ vpRanges.setStartEndRes(vpRanges.getStartRes(),
+ vpRanges.getStartRes() + widthInRes - 1);
}
else
{
}
else if (offy > -1)
{
- vpRanges.setStartEndRes(offy * rowSize, (offy + 1) * rowSize);
+ vpRanges.setStartEndRes(offy * rowSize, (offy + 1) * rowSize - 1);
}
else
{
if (av.isFollowHighlight())
{
+ // don't allow highlight of protein/cDNA to also scroll a complementary
+ // panel,as this sets up a feedback loop (scrolling panel 1 causes moused
+ // over residue to change abruptly, causing highlighted residue in panel 2
+ // to change, causing a scroll in panel 1 etc)
+ ap.setDontScrollComplement(true);
if (ap.scrollToPosition(results, false))
{
seqCanvas.revalidate();
}
+ ap.setDontScrollComplement(false);
}
setStatusMessage(results);
seqCanvas.highlightSearchResults(results);