X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Futil%2FMapList.java;h=826ead7326bbd9cad27d1310f49b3c422b5f9eab;hb=855f7a4bb3e8d5fcfa9059df64262fc73f0164be;hp=4922267f414af7bcaf71a8f436cbab4680454a64;hpb=d4b01f3adab0fab7774a0cb5e5226cfa44d303fe;p=jalview.git diff --git a/src/jalview/util/MapList.java b/src/jalview/util/MapList.java index 4922267..826ead7 100644 --- a/src/jalview/util/MapList.java +++ b/src/jalview/util/MapList.java @@ -417,7 +417,7 @@ public class MapList public int[] locateInFrom(int start, int end) { // inefficient implementation int fromStart[] = shiftTo(start); - int fromEnd[] = shiftTo(end); + int fromEnd[] = shiftTo(end); // needs to be inclusive of end of symbol position if (fromStart==null || fromEnd==null) return null; int iv[] = getIntervals(fromShifts, fromStart, fromEnd,fromRatio); @@ -450,9 +450,11 @@ public class MapList */ private int[] getIntervals(Vector fromShifts2, int[] fromStart, int[] fromEnd, int fromRatio2) { - // correct for word direction for start and end - int startpos = fromStart[0]+fromStart[2]*(fromRatio2-1); - int endpos = fromEnd[0]+fromEnd[2]*(fromRatio2-1); + // TODO: correct for word boundary w.r.t. fromStart->fromEnd direction for startpos and endpos. + // test is (1,8,12,17) to (1,5) and features on to : 2,2; 3,3; 4,3; 3,4; 4,4; 5,3; 3,5; 2,4; 4,2; + // correct for word direction for start and end : + int startpos = fromStart[0]+fromStart[2]*(fromRatio2-1); // Math.min(fromStart[0], .. ); + int endpos = fromEnd[0]+fromEnd[2]*(fromRatio2-1); // Math.max(fromEnd[0],); int intv=0,intvSize= fromShifts2.size(); int iv[],i=0,fs=-1,fe=-1; // containing intervals while (intv