Browse Source

Fixed Bug when adding Nodes to empty underlay graph

Jan Enders 7 years ago
parent
commit
81df30e5bd

+ 4 - 1
scopviz/src/main/java/de/tu_darmstadt/informatik/tk/scopviz/graphs/GraphManager.java

@@ -384,7 +384,10 @@ public class GraphManager {
 		for (String s : n.getAttributeKeySet()) {
 			attributes.put(s, n.getAttribute(s));
 		}
-		String nodeId = activeSubGraph.getId() + n.getId();
+		String nodeId = n.getId();
+		if (activeSubGraph != null){
+			nodeId = activeSubGraph.getId() + nodeId;
+		}
 		g.addNode(nodeId);
 		g.getNode(nodeId).addAttributes(attributes);
 		if (activeSubGraph != null && !activeSubGraph.equals(g)) {