From 2bfa6fa77d4ad322d566bd52851c6981fb08509c Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Fri, 31 Aug 2018 12:10:26 +0100 Subject: [PATCH] java doc and fix for JAL-3095 - region of trimmed RNA model to highlight is indexed relative to SeuqenceI.getStart() --- src/jalview/gui/AppVarna.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) 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); } -- 1.7.10.2