From: James Procter Date: Fri, 17 Mar 2023 17:33:05 +0000 (+0000) Subject: JAL-4134 fix up column selection when hidden regions are present. Needs tests! X-Git-Tag: Release_2_11_3_0~15^2^2~12 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=31c6e45ee34d7a9b531fc01a0da478b911f35570;p=jalview.git JAL-4134 fix up column selection when hidden regions are present. Needs tests! --- diff --git a/src/jalview/gui/TreeCanvas.java b/src/jalview/gui/TreeCanvas.java index 97ca391..98026da 100755 --- a/src/jalview/gui/TreeCanvas.java +++ b/src/jalview/gui/TreeCanvas.java @@ -1036,12 +1036,17 @@ public class TreeCanvas extends JPanel implements MouseListener, Runnable, } ColumnSelection cs = av.getColumnSelection(); HiddenColumns hc = av.getAlignment().getHiddenColumns(); - int offp = (rseq != null) ? rseq.findIndex(rseq.getStart() - 1 + colm) + int offp = (rseq != null) ? rseq.findIndex(rseq.getStart() + colm) : colm; - if (!av.hasHiddenColumns() || hc.isVisible(offp)) + if (!av.hasHiddenColumns()) { - return cs.contains(offp); + return cs.contains(offp-1); + } + if (hc.isVisible(offp-1)) + { + return cs.contains(offp-1); +// return cs.contains(hc.absoluteToVisibleColumn(offp)); } return false; }