]> gerrit.simantics Code Review - simantics/district.git/blobdiff - org.simantics.district.network.ui/src/org/simantics/district/network/ui/nodes/NetworkDrawingNode.java
Some performance tuning on node hovering when mouse buttons are pressed
[simantics/district.git] / org.simantics.district.network.ui / src / org / simantics / district / network / ui / nodes / NetworkDrawingNode.java
index 2cd87d69a2b0a65980e85f4972b94a76e8e2691a..335f9e118cd1d8c14bd640cc6bd850f6dadb3a18 100644 (file)
@@ -299,7 +299,8 @@ public class NetworkDrawingNode extends G2DNode {
         boolean repaint = false;
         Point2D p = NodeUtil.worldToLocal(this, e.controlPosition, new Point2D.Double());
         boolean isConnectionTool = mode == Hints.CONNECTTOOL || e.hasAnyModifier(MouseEvent.ALT_MASK | MouseEvent.ALT_GRAPH_MASK);
-        if (participant.pickHoveredElement(p, isConnectionTool)) {
+        // To boost pan perf hovering is only considered if no mouse button is pressed)
+        if (e.buttons == 0 && participant.pickHoveredElement(p, isConnectionTool)) {
             repaint = true;
         }
         if (!nodes.isEmpty()) {