From 31c6e45ee34d7a9b531fc01a0da478b911f35570 Mon Sep 17 00:00:00 2001 From: James Procter Date: Fri, 17 Mar 2023 17:33:05 +0000 Subject: [PATCH] JAL-4134 fix up column selection when hidden regions are present. Needs tests! --- src/jalview/gui/TreeCanvas.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) 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; } -- 1.7.10.2