From: Jim Procter Date: Fri, 31 Aug 2018 11:10:26 +0000 (+0100) Subject: java doc and fix for JAL-3095 - region of trimmed RNA model to highlight is indexed... X-Git-Tag: Release_2_10_5~37 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=2bfa6fa77d4ad322d566bd52851c6981fb08509c;p=jalview.git java doc and fix for JAL-3095 - region of trimmed RNA model to highlight is indexed relative to SeuqenceI.getStart() --- diff --git a/src/jalview/gui/AppVarna.java b/src/jalview/gui/AppVarna.java index ea16f23..aad4a96 100644 --- a/src/jalview/gui/AppVarna.java +++ b/src/jalview/gui/AppVarna.java @@ -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); }