java doc and fix for JAL-3095 - region of trimmed RNA model to highlight is indexed...
authorJim Procter <jprocter@issues.jalview.org>
Fri, 31 Aug 2018 11:10:26 +0000 (12:10 +0100)
committerJim Procter <jprocter@issues.jalview.org>
Fri, 31 Aug 2018 11:10:26 +0000 (12:10 +0100)
src/jalview/gui/AppVarna.java

index ea16f23..aad4a96 100644 (file)
@@ -120,6 +120,15 @@ public class AppVarna extends JInternalFrame
       }
     }
 
+    /**
+     * highlight a region from start to end (inclusive) on rna
+     * 
+     * @param rna
+     * @param start
+     *          - first base pair index (from 0)
+     * @param end
+     *          - last base pair index (from 0)
+     */
     public void highlightRegion(RNA rna, int start, int end)
     {
       clearLastSelection();
@@ -397,7 +406,8 @@ public class AppVarna extends JInternalFrame
     RnaModel rnaModel = models.get(rna);
     if (rnaModel.seq == sequence)
     {
-      int highlightPos = rnaModel.gapped ? index : position - 1;
+      int highlightPos = rnaModel.gapped ? index
+              : position - sequence.getStart();
       mouseOverHighlighter.highlightRegion(rna, highlightPos, highlightPos);
       vab.updateSelectedRNA(rna);
     }