From: amwaterhouse Date: Thu, 22 Dec 2005 15:58:09 +0000 (+0000) Subject: Wrapped search scrolls to visible result X-Git-Tag: Root_VamJalview_2_07b+~228 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=ee22ee70f8364e0c293f98da8368cdcff314f16b;p=jalview.git Wrapped search scrolls to visible result --- diff --git a/src/jalview/gui/AlignmentPanel.java b/src/jalview/gui/AlignmentPanel.java index c7fccfe..3ebc57c 100755 --- a/src/jalview/gui/AlignmentPanel.java +++ b/src/jalview/gui/AlignmentPanel.java @@ -253,11 +253,22 @@ public class AlignmentPanel extends GAlignmentPanel int start = seq.findIndex(results[1]) - 1; int end = seq.findIndex(results[2]) - 1; - if ( (av.getStartRes() > start) || (av.getEndRes() < end) || - ( (av.getStartSeq() > results[0]) || - (av.getEndSeq() < results[0]))) + if(!av.wrapAlignment) { - setScrollValues(start, results[0]); + if ( (av.getStartRes() > start) || (av.getEndRes() < end) || + ( (av.getStartSeq() > results[0]) || + (av.getEndSeq() < results[0]))) + { + setScrollValues(start, results[0]); + } + } + else + { + int cwidth = seqPanel.seqCanvas.getWrappedCanvasWidth(seqPanel.seqCanvas.getWidth()); + if( start(av.getStartRes()+cwidth) ) + { + vscroll.setValue(start / cwidth); + } } } }