JAL-2778 Reduced cursor set/reset in overview mouse move
[jalview.git] / src / jalview / gui / OverviewPanel.java
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));
+          }
         }
       }
     });