From: Jim Procter Date: Sat, 4 Jul 2020 12:17:00 +0000 (+0100) Subject: JAL-3680 check whether a sequence selection exists before sliding the sequence under... X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=afce71ab973518ba76c313014651b97467d131bc;p=jalview.git JAL-3680 check whether a sequence selection exists before sliding the sequence under the cursor when sliding sequences --- diff --git a/src/jalview/gui/AlignFrame.java b/src/jalview/gui/AlignFrame.java index f906e5a..a9ff222 100644 --- a/src/jalview/gui/AlignFrame.java +++ b/src/jalview/gui/AlignFrame.java @@ -1803,19 +1803,19 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, synchronized void slideSequences(boolean right, int size) { List sg = new ArrayList<>(); - if (viewport.cursorMode) - { - sg.add(viewport.getAlignment() - .getSequenceAt(alignPanel.getSeqPanel().seqCanvas.cursorY)); - } - else if (viewport.getSelectionGroup() != null - && viewport.getSelectionGroup().getSize() != viewport - .getAlignment().getHeight()) + if (viewport.getSelectionGroup() != null && viewport.getSelectionGroup() + .getSize() != viewport.getAlignment().getHeight()) { sg = viewport.getSelectionGroup() .getSequences(viewport.getHiddenRepSequences()); } + if (sg.size() == 0 && viewport.cursorMode) + { + sg.add(viewport.getAlignment() + .getSequenceAt(alignPanel.getSeqPanel().seqCanvas.cursorY)); + } + if (sg.size() < 1) { return;