JAL-2778 Reduced cursor set/reset in overview mouse move
authorkiramt <k.mourao@dundee.ac.uk>
Fri, 3 Nov 2017 10:50:35 +0000 (10:50 +0000)
committerkiramt <k.mourao@dundee.ac.uk>
Fri, 3 Nov 2017 10:50:35 +0000 (10:50 +0000)
src/jalview/gui/OverviewCanvas.java
src/jalview/gui/OverviewPanel.java

index 2991889..9df0d82 100644 (file)
@@ -183,7 +183,7 @@ public class OverviewCanvas extends JComponent
   @Override
   public void paintComponent(Graphics g)
   {
-    // super.paintComponent(g);
+    super.paintComponent(g);
 
     if (restart)
     {
index 43b4310..28ad3c5 100755 (executable)
@@ -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));
+          }
         }
       }
     });