X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=org.simantics.district.network.ui%2Fsrc%2Forg%2Fsimantics%2Fdistrict%2Fnetwork%2Fui%2Fnodes%2FNetworkDrawingNode.java;fp=org.simantics.district.network.ui%2Fsrc%2Forg%2Fsimantics%2Fdistrict%2Fnetwork%2Fui%2Fnodes%2FNetworkDrawingNode.java;h=1ccde2c7b18db0c459648af546428b57c3205428;hb=00e4eca98cef6d77d5023f4b424f9e8da0487463;hp=b2c157184f07cf0c96b9eb342b3dc438f7cf53b8;hpb=02ecca5e61d2eb17de40cc058be678b414aaad00;p=simantics%2Fdistrict.git diff --git a/org.simantics.district.network.ui/src/org/simantics/district/network/ui/nodes/NetworkDrawingNode.java b/org.simantics.district.network.ui/src/org/simantics/district/network/ui/nodes/NetworkDrawingNode.java index b2c15718..1ccde2c7 100644 --- a/org.simantics.district.network.ui/src/org/simantics/district/network/ui/nodes/NetworkDrawingNode.java +++ b/org.simantics.district.network.ui/src/org/simantics/district/network/ui/nodes/NetworkDrawingNode.java @@ -163,13 +163,14 @@ public class NetworkDrawingNode extends G2DNode { * String str = formatValue(val); */ // TODO: fix scale - double scale = 100000; -// double scale = 1; - double startLat = ModelledCRS.yToLatitude(start.getY() / scale); - double startLon = ModelledCRS.xToLongitude(start.getX() / scale); + double scaleY = getTransform().getScaleY(); + double scaleX = getTransform().getScaleX(); - double endLat = ModelledCRS.yToLatitude(end.getY() / scale); - double endLon = ModelledCRS.xToLongitude(end.getX() / scale); + double startLat = ModelledCRS.yToLatitude(start.getY() / scaleY); + double startLon = ModelledCRS.xToLongitude(start.getX() / scaleX); + + double endLat = ModelledCRS.yToLatitude(end.getY() / scaleY); + double endLon = ModelledCRS.xToLongitude(end.getX() / scaleX); double[] startCoords = new double[] { startLon, startLat }; double[] endCoords = new double[] { endLon, endLat }; @@ -179,7 +180,7 @@ public class NetworkDrawingNode extends G2DNode { @Override public void perform(WriteGraph graph) throws DatabaseException { - builder.create(graph, startCoords, endCoords, padding / scale); + builder.create(graph, startCoords, endCoords, 1 / padding); } });