From: Tuukka Lehtonen Date: Fri, 20 Mar 2020 13:15:21 +0000 (+0200) Subject: Fixed District diagram viewer to allow moving of vertices again. X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F55%2F4055%2F1;p=simantics%2Fdistrict.git Fixed District diagram viewer to allow moving of vertices again. The problem was caused by the default grid snap advisor which the base DiagramViewer injects into the canvas context, which had 1.0mm snap region. This removes the snap advisor entirely. gitlab #82 Change-Id: Ibbced0c118801266c15e1dae50f39fdee28cf0a6 (cherry picked from commit ff17be003806b0570ebd6f0017d27e99e31e0c24) --- diff --git a/org.simantics.district.network.ui/src/org/simantics/district/network/ui/DistrictDiagramViewer.java b/org.simantics.district.network.ui/src/org/simantics/district/network/ui/DistrictDiagramViewer.java index 19838955..5b67fa51 100644 --- a/org.simantics.district.network.ui/src/org/simantics/district/network/ui/DistrictDiagramViewer.java +++ b/org.simantics.district.network.ui/src/org/simantics/district/network/ui/DistrictDiagramViewer.java @@ -32,6 +32,7 @@ import org.simantics.district.network.visualisations.model.DynamicSizeContributi import org.simantics.district.network.visualisations.model.SizeBarOptions; import org.simantics.g2d.canvas.ICanvasContext; import org.simantics.g2d.canvas.impl.CanvasContext; +import org.simantics.g2d.diagram.DiagramHints; import org.simantics.g2d.diagram.handler.PickRequest.PickFilter; import org.simantics.g2d.diagram.participant.DelayedBatchElementPainter; import org.simantics.g2d.diagram.participant.ElementPainter; @@ -101,6 +102,7 @@ public class DistrictDiagramViewer extends DiagramViewer { h.setHint(PanZoomRotateHandler.KEY_ZOOM_IN_LIMIT, 10000.0); h.setHint(PanZoomRotateHandler.KEY_ZOOM_OUT_LIMIT, 0.01); h.setHint(DiagramModelHints.KEY_DIAGRAM_RESOURCE, diagramResource); + h.removeHint(DiagramHints.SNAP_ADVISOR); } @Override