From: kiramt Date: Fri, 3 Nov 2017 10:50:35 +0000 (+0000) Subject: JAL-2778 Reduced cursor set/reset in overview mouse move X-Git-Tag: Release_2_10_4~67^2~13 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=d1192ef92ac9563bbc40a648f80e9b6d8162ed2b;p=jalview.git JAL-2778 Reduced cursor set/reset in overview mouse move --- diff --git a/src/jalview/gui/OverviewCanvas.java b/src/jalview/gui/OverviewCanvas.java index 2991889..9df0d82 100644 --- a/src/jalview/gui/OverviewCanvas.java +++ b/src/jalview/gui/OverviewCanvas.java @@ -183,7 +183,7 @@ public class OverviewCanvas extends JComponent @Override public void paintComponent(Graphics g) { - // super.paintComponent(g); + super.paintComponent(g); if (restart) { diff --git a/src/jalview/gui/OverviewPanel.java b/src/jalview/gui/OverviewPanel.java index 43b4310..28ad3c5 100755 --- a/src/jalview/gui/OverviewPanel.java +++ b/src/jalview/gui/OverviewPanel.java @@ -170,15 +170,20 @@ public class OverviewPanel extends JPanel @Override public void mouseMoved(MouseEvent evt) { - if (od.isPositionInBox(evt.getX(), evt.getY())) + if (!draggingBox) + // don't bother changing the cursor if we're dragging the box + // as we can't have moved inside or out of the box in that case { - // display drag cursor at mouse position - setCursor(Cursor.getPredefinedCursor(Cursor.MOVE_CURSOR)); - } - else - { - // reset cursor - setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); + if (od.isPositionInBox(evt.getX(), evt.getY())) + { + // display drag cursor at mouse position + setCursor(Cursor.getPredefinedCursor(Cursor.MOVE_CURSOR)); + } + else + { + // reset cursor + setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); + } } } });