From: gmungoc Date: Fri, 8 Mar 2019 11:26:52 +0000 (+0000) Subject: JAL-3075 update column selection on mouse up after scroll X-Git-Tag: Release_2_11_0~17^2~52^2 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=refs%2Fheads%2Fbug%2FJAL-3075;p=jalview.git JAL-3075 update column selection on mouse up after scroll --- 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);