public static final DNEdgeInternalSize INSTANCE = new DNEdgeInternalSize();
+ private ThreadLocal<Path2D> path = new ThreadLocal<Path2D>() {
+ 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);