]> gerrit.simantics Code Review - simantics/district.git/commitdiff
Use PickRequest with ICanvasContext for improved performance 54/2054/1
authorTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Thu, 30 Aug 2018 05:23:36 +0000 (08:23 +0300)
committerTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Thu, 30 Aug 2018 05:23:36 +0000 (08:23 +0300)
gitlab #6

Change-Id: Iaf0bd5aa99f3ad01fefe57cd75ec5b8aadd204da

org.simantics.district.network.ui/src/org/simantics/district/network/ui/NetworkDrawingParticipant.java
org.simantics.district.network.ui/src/org/simantics/district/network/ui/contributions/SetFocusableDynamicMenuContribution.java

index aa11d6bb10205817145ed325e3f2c8a88cf948be..7dd55f5e1743ace66ebb402ec46c498ff155dd84 100644 (file)
@@ -16,7 +16,6 @@ import org.simantics.g2d.diagram.handler.PickContext;
 import org.simantics.g2d.diagram.handler.PickRequest;
 import org.simantics.g2d.diagram.participant.AbstractDiagramParticipant;
 import org.simantics.g2d.element.IElement;
-import org.simantics.maps.MapScalingTransform;
 import org.simantics.scenegraph.g2d.G2DNode;
 import org.simantics.scenegraph.g2d.G2DParentNode;
 import org.simantics.utils.datastructures.hints.IHintContext.Key;
@@ -60,7 +59,7 @@ public class NetworkDrawingParticipant extends AbstractDiagramParticipant {
     }
 
     public boolean pickHoveredElement(Point2D currentMousePos) {
-        PickRequest req = new PickRequest(currentMousePos.getX(), currentMousePos.getY());
+        PickRequest req = new PickRequest(currentMousePos.getX(), currentMousePos.getY()).context(getContext());
         List<IElement> pickables = new ArrayList<IElement>();
         pick.pick(diagram, req, pickables);
         
index d2c2ed5ca799e26ab284c64b6842008d8c77d066..f8a363384b96a427f5a34fa6f21cc52176ad96e1 100644 (file)
@@ -58,7 +58,7 @@ public class SetFocusableDynamicMenuContribution {
         // Quite hackish solution..
         boolean oldIgnore = le.getIgnoreFocusSettings();
         le.setIgnoreFocusSettings(true);
-        pick.pick(diagram, new PickRequest(canvasPosition.getX(), canvasPosition.getY()), result);
+        pick.pick(diagram, new PickRequest(canvasPosition.getX(), canvasPosition.getY()).context(ctx), result);
         le.setIgnoreFocusSettings(oldIgnore);
         
         boolean allow = false;