From 4efe5c8d36740fc15d862edd5b121c56df7f1c94 Mon Sep 17 00:00:00 2001 From: kiramt Date: Thu, 27 Jul 2017 13:12:18 +0200 Subject: [PATCH] JAL-2611 Moved draggingBox setting/unsetting into MouseReleased --- src/jalview/appletgui/OverviewPanel.java | 11 ++++------- src/jalview/gui/OverviewPanel.java | 17 ++++------------- 2 files changed, 8 insertions(+), 20 deletions(-) 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)) -- 1.7.10.2