From b3ffdf8a1d0e5bd9803c933e4b59170a019c90d9 Mon Sep 17 00:00:00 2001 From: jsimomaa Date: Wed, 2 Oct 2019 15:06:26 +0300 Subject: [PATCH] Some performance tuning on node hovering when mouse buttons are pressed gitlab #44 Change-Id: If7ef401979c2d606d96a7c2a3986b5c9f3b9ca46 --- .../district/network/ui/nodes/NetworkDrawingNode.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/org.simantics.district.network.ui/src/org/simantics/district/network/ui/nodes/NetworkDrawingNode.java b/org.simantics.district.network.ui/src/org/simantics/district/network/ui/nodes/NetworkDrawingNode.java index 2cd87d69..335f9e11 100644 --- a/org.simantics.district.network.ui/src/org/simantics/district/network/ui/nodes/NetworkDrawingNode.java +++ b/org.simantics.district.network.ui/src/org/simantics/district/network/ui/nodes/NetworkDrawingNode.java @@ -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()) { -- 2.47.1