]> gerrit.simantics Code Review - simantics/district.git/commitdiff
Fixed District diagram viewer to allow moving of vertices again. 55/4055/1
authorTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Fri, 20 Mar 2020 13:15:21 +0000 (15:15 +0200)
committerTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Fri, 20 Mar 2020 13:17:21 +0000 (13:17 +0000)
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)

org.simantics.district.network.ui/src/org/simantics/district/network/ui/DistrictDiagramViewer.java

index 198389551768a250b22c6be34a293f6f99ba2acb..5b67fa519f418736b5a3cae28a6659ed670fbca9 100644 (file)
@@ -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