From 80e3c4b6e17a6262ccbc193b9824ea3700a86f87 Mon Sep 17 00:00:00 2001 From: kiramt Date: Thu, 25 May 2017 14:06:38 +0100 Subject: [PATCH] JAL-2034 don't update overview after click without drag on group --- src/jalview/gui/SeqPanel.java | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/jalview/gui/SeqPanel.java b/src/jalview/gui/SeqPanel.java index 23bba38..a6fa141 100644 --- a/src/jalview/gui/SeqPanel.java +++ b/src/jalview/gui/SeqPanel.java @@ -590,6 +590,7 @@ public class SeqPanel extends JPanel implements MouseListener, @Override public void mouseReleased(MouseEvent evt) { + boolean didDrag = mouseDragging; // did we come here after a drag mouseDragging = false; mouseWheelPressed = false; @@ -602,7 +603,7 @@ public class SeqPanel extends JPanel implements MouseListener, if (!editingSeqs) { - doMouseReleasedDefineMode(evt); + doMouseReleasedDefineMode(evt, didDrag); return; } @@ -1754,12 +1755,15 @@ public class SeqPanel extends JPanel implements MouseListener, } /** - * DOCUMENT ME! + * Update the display after mouse up on a selection or group * * @param evt - * DOCUMENT ME! + * mouse released event details + * @param afterDrag + * true if this event is happening after a mouse drag (rather than a + * mouse down) */ - public void doMouseReleasedDefineMode(MouseEvent evt) + public void doMouseReleasedDefineMode(MouseEvent evt, boolean afterDrag) { if (stretchGroup == null) { @@ -1768,7 +1772,8 @@ public class SeqPanel extends JPanel implements MouseListener, // always do this - annotation has own state // but defer colourscheme update until hidden sequences are passed in boolean vischange = stretchGroup.recalcConservation(true); - needOverviewUpdate |= vischange && av.isSelectionDefinedGroup(); + needOverviewUpdate |= vischange && av.isSelectionDefinedGroup() + && afterDrag; if (stretchGroup.cs != null) { stretchGroup.cs.alignmentChanged(stretchGroup, -- 1.7.10.2