From 5bbc4e9b824e386b184c805eb06f2bc3ce24d7a1 Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Sat, 4 Jul 2020 13:17:00 +0100 Subject: [PATCH] JAL-3680 check whether a sequence selection exists before sliding the sequence under the cursor when sliding sequences --- src/jalview/gui/AlignFrame.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/jalview/gui/AlignFrame.java b/src/jalview/gui/AlignFrame.java index 0a42036..61a6af6 100644 --- a/src/jalview/gui/AlignFrame.java +++ b/src/jalview/gui/AlignFrame.java @@ -1740,19 +1740,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; -- 1.7.10.2