From 013692af798bd65da3b5cc39cb24a0aaca54e613 Mon Sep 17 00:00:00 2001 From: gmungoc Date: Fri, 8 Mar 2019 11:26:52 +0000 Subject: [PATCH] JAL-3075 update column selection on mouse up after scroll --- src/jalview/gui/ScalePanel.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/jalview/gui/ScalePanel.java b/src/jalview/gui/ScalePanel.java index 0f2b765..b95c569 100755 --- a/src/jalview/gui/ScalePanel.java +++ b/src/jalview/gui/ScalePanel.java @@ -274,6 +274,7 @@ public class ScalePanel extends JPanel @Override public void mouseReleased(MouseEvent evt) { + boolean wasDragging = mouseDragging; mouseDragging = false; ap.getSeqPanel().stopScrolling(); @@ -285,7 +286,8 @@ public class ScalePanel extends JPanel res = av.getAlignment().getHiddenColumns() .visibleToAbsoluteColumn(res); } - res = Math.min(res, av.getAlignment().getWidth() - 1); + res = Math.min(res, av.getRanges().getEndRes()); + res = Math.max(0, res); if (!stretchingGroup) { @@ -312,6 +314,12 @@ public class ScalePanel extends JPanel { sg.setStartRes(res); } + if (wasDragging) + { + min = Math.min(res, min); + max = Math.max(res, max); + av.getColumnSelection().stretchGroup(res, sg, min, max); + } } stretchingGroup = false; ap.paintAlignment(false, false); -- 1.7.10.2