From: kiramt Date: Thu, 27 Jul 2017 11:12:18 +0000 (+0200) Subject: JAL-2611 Moved draggingBox setting/unsetting into MouseReleased X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=4efe5c8d36740fc15d862edd5b121c56df7f1c94;p=jalview.git JAL-2611 Moved draggingBox setting/unsetting into MouseReleased --- diff --git a/src/jalview/appletgui/OverviewPanel.java b/src/jalview/appletgui/OverviewPanel.java index 456a38c..1ee1400 100755 --- a/src/jalview/appletgui/OverviewPanel.java +++ b/src/jalview/appletgui/OverviewPanel.java @@ -146,11 +146,12 @@ public class OverviewPanel extends Panel implements Runnable, } else { + // don't do anything if the mouse press is in the overview's box + // (wait to see if it's a drag instead) + // otherwise update the viewport if (!od.isPositionInBox(evt.getX(), evt.getY())) { - // don't do anything if the mouse press is in the overview's box - // (wait to see if it's a drag instead) - // otherwise update the viewport + draggingBox = false; od.updateViewportFromMouse(evt.getX(), evt.getY(), av.getAlignment().getHiddenSequences(), av.getAlignment().getHiddenColumns()); @@ -168,10 +169,6 @@ public class OverviewPanel extends Panel implements Runnable, @Override public void mouseReleased(MouseEvent evt) { - if (draggingBox) - { - draggingBox = false; - } } @Override diff --git a/src/jalview/gui/OverviewPanel.java b/src/jalview/gui/OverviewPanel.java index c81ac2f..9f6afa0 100755 --- a/src/jalview/gui/OverviewPanel.java +++ b/src/jalview/gui/OverviewPanel.java @@ -158,13 +158,13 @@ public class OverviewPanel extends JPanel implements Runnable, } } else - // if (!av.getWrapAlignment()) { + // don't do anything if the mouse press is in the overview's box + // (wait to see if it's a drag instead) + // otherwise update the viewport if (!od.isPositionInBox(evt.getX(), evt.getY())) { - // don't do anything if the mouse press is in the overview's box - // (wait to see if it's a drag instead) - // otherwise update the viewport + draggingBox = false; od.updateViewportFromMouse(evt.getX(), evt.getY(), av.getAlignment().getHiddenSequences(), av.getAlignment().getHiddenColumns()); @@ -180,15 +180,6 @@ public class OverviewPanel extends JPanel implements Runnable, } @Override - public void mouseReleased(MouseEvent evt) - { - if (draggingBox) - { - draggingBox = false; - } - } - - @Override public void mouseClicked(MouseEvent evt) { if (SwingUtilities.isRightMouseButton(evt))