X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=org.simantics.district.network.ui%2Fsrc%2Forg%2Fsimantics%2Fdistrict%2Fnetwork%2Fui%2Fadapters%2FDistrictNetworkEdgeElement.java;h=8fb105d8870f8f077b9f67407440e3c3b5bd89a7;hb=0f871d5a2e1a0a531195ef80f007af89de62c914;hp=ef2e21fed709518ca5c7c21075018526f0474dc6;hpb=94be073aed6fca8266b2d9ed147c4843f3d23da5;p=simantics%2Fdistrict.git diff --git a/org.simantics.district.network.ui/src/org/simantics/district/network/ui/adapters/DistrictNetworkEdgeElement.java b/org.simantics.district.network.ui/src/org/simantics/district/network/ui/adapters/DistrictNetworkEdgeElement.java index ef2e21fe..8fb105d8 100644 --- a/org.simantics.district.network.ui/src/org/simantics/district/network/ui/adapters/DistrictNetworkEdgeElement.java +++ b/org.simantics.district.network.ui/src/org/simantics/district/network/ui/adapters/DistrictNetworkEdgeElement.java @@ -102,13 +102,17 @@ public class DistrictNetworkEdgeElement { public static final DNEdgeInternalSize INSTANCE = new DNEdgeInternalSize(); + private ThreadLocal path = new ThreadLocal() { + protected Path2D initialValue() { return new Path2D.Double(); } + }; + @Override public Rectangle2D getBounds(IElement e, Rectangle2D size) { DistrictNetworkEdge edge = e.getHint(KEY_DN_EDGE); if (size == null) size = new Rectangle2D.Double(); if (edge != null) - size.setFrame(DistrictNetworkEdgeNode.calculatePath(edge, null, false).getBounds2D()); + size.setFrame(DistrictNetworkEdgeNode.calculatePath(edge, path.get(), false).getBounds2D()); else LOGGER.debug("Element {} does not have edge!", e);