]> gerrit.simantics Code Review - simantics/district.git/commitdiff
NPE fix for district scene graph nodes 79/3479/2
authorTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Thu, 7 Nov 2019 18:35:16 +0000 (20:35 +0200)
committerTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Thu, 7 Nov 2019 18:41:11 +0000 (18:41 +0000)
gitlab #63

Change-Id: Ie5902a9476d1ca516fb1a5c3e0af9ddc28f7b394

org.simantics.district.network.ui/src/org/simantics/district/network/ui/nodes/DistrictNetworkEdgeNode.java
org.simantics.district.network.ui/src/org/simantics/district/network/ui/nodes/DistrictNetworkVertexNode.java

index 8c4af387cee34a288e888e0c03d74c943198424b..8f8c08e6cc36f7f838e86c2254217f1fff1179fa 100644 (file)
@@ -71,6 +71,8 @@ public class DistrictNetworkEdgeNode extends G2DParentNode implements ISelection
         if (t != null && !t.isIdentity()) {
             //ot = g2d.getTransform();
             ot = (AffineTransform) g2d.getRenderingHint(G2DRenderingHints.KEY_TRANSFORM_UNDER_SPATIAL_ROOT);
+            if (ot == null)
+                ot = g2d.getTransform();
             g2d.transform(t);
             if (scaleStroke) {
                 AffineTransform work = DistrictNetworkNodeUtils.sharedTransform.get();
index 51ae30e07f58113363020d4f34b248b10c4ad331..1639d5712b8abaaf3fc8e542d74d9d9110444a4b 100644 (file)
@@ -67,6 +67,8 @@ public class DistrictNetworkVertexNode extends G2DParentNode implements ISelecti
         if (t != null && !t.isIdentity()) {
             //ot = g2d.getTransform();
             ot = (AffineTransform) g2d.getRenderingHint(G2DRenderingHints.KEY_TRANSFORM_UNDER_SPATIAL_ROOT);
+            if (ot == null)
+                ot = g2d.getTransform();
             g2d.transform(t);
 
             if (scaleStroke) {