X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fdatamodel%2FSearchResults.java;h=b9db46123c335bd5f703045adbecd9f6e0107c84;hb=0673686a4ceda776a64350afd35ecff18e74e575;hp=33294318ed89a3c0c87042bfb4a6cf27a24d8dac;hpb=07e95212532922e9a7966b81724b5a54e26b51a8;p=jalview.git diff --git a/src/jalview/datamodel/SearchResults.java b/src/jalview/datamodel/SearchResults.java index 3329431..b9db461 100755 --- a/src/jalview/datamodel/SearchResults.java +++ b/src/jalview/datamodel/SearchResults.java @@ -67,8 +67,22 @@ public class SearchResults public Match(SequenceI seq, int start, int end) { sequence = seq; - this.start = start; - this.end = end; + + /* + * always hold in forwards order, even if given in reverse order + * (such as from a mapping to a reverse strand); this avoids + * trouble for routines that highlight search results etc + */ + if (start <= end) + { + this.start = start; + this.end = end; + } + else + { + this.start = end; + this.end = start; + } } public SequenceI getSequence() @@ -232,8 +246,7 @@ public class SearchResults if (result == null) { - result = new int[] - { matchStart, matchEnd }; + result = new int[] { matchStart, matchEnd }; } else {