Skip to content

Commit

Permalink
layered: Correctly insert nodes during df model order layering.
Browse files Browse the repository at this point in the history
  • Loading branch information
soerendomroes committed Oct 18, 2023
1 parent cfc8845 commit 6ddf867
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,9 @@ public void process(final LGraph thelayeredGraph, final IElkProgressMonitor moni
if (!nodesToPlace.isEmpty()) {
if (layerDiff > 0) {
// Case some dependency to the existing graph was found add all nodes to their layers.
for (LNode toPlace : nodesToPlace) {
toPlace.id += maxLayer;
}
placeNodesToPlace();
// Remove all nodes since they are now placed correctly.
nodesToPlace.clear();
Expand Down Expand Up @@ -209,7 +212,7 @@ private boolean isConnectedToCurrentLayer(final LNode node) {
boolean connectedViaLabelDummy;
if (nodesToPlace.isEmpty()) {
// Case the node to check already has a layer.
// TODO this may case an NPE if getLayer is null;
// This may case an NPE if getLayer is null;
directlyConnected = edge.getSource().getNode().getType() == NodeType.NORMAL
&& edge.getSource().getNode().getLayer() != null
&& edge.getSource().getNode().getLayer().id == currentLayerId;
Expand Down

0 comments on commit 6ddf867

Please sign in to comment.