From: Tuukka Lehtonen Date: Thu, 30 Aug 2018 05:23:36 +0000 (+0300) Subject: Use PickRequest with ICanvasContext for improved performance X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F54%2F2054%2F1;p=simantics%2Fdistrict.git Use PickRequest with ICanvasContext for improved performance gitlab #6 Change-Id: Iaf0bd5aa99f3ad01fefe57cd75ec5b8aadd204da --- diff --git a/org.simantics.district.network.ui/src/org/simantics/district/network/ui/NetworkDrawingParticipant.java b/org.simantics.district.network.ui/src/org/simantics/district/network/ui/NetworkDrawingParticipant.java index aa11d6bb..7dd55f5e 100644 --- a/org.simantics.district.network.ui/src/org/simantics/district/network/ui/NetworkDrawingParticipant.java +++ b/org.simantics.district.network.ui/src/org/simantics/district/network/ui/NetworkDrawingParticipant.java @@ -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 pickables = new ArrayList(); pick.pick(diagram, req, pickables); diff --git a/org.simantics.district.network.ui/src/org/simantics/district/network/ui/contributions/SetFocusableDynamicMenuContribution.java b/org.simantics.district.network.ui/src/org/simantics/district/network/ui/contributions/SetFocusableDynamicMenuContribution.java index d2c2ed5c..f8a36338 100644 --- a/org.simantics.district.network.ui/src/org/simantics/district/network/ui/contributions/SetFocusableDynamicMenuContribution.java +++ b/org.simantics.district.network.ui/src/org/simantics/district/network/ui/contributions/SetFocusableDynamicMenuContribution.java @@ -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;