]> gerrit.simantics Code Review - simantics/district.git/commitdiff
Fixed District diagram viewer to allow moving of vertices again. 35/4035/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:15:21 +0000 (15:15 +0200)
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

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