Skip to content

Commit

Permalink
Add support for handling top-down layout when no approximator is set
Browse files Browse the repository at this point in the history
  • Loading branch information
Eddykasp committed Nov 12, 2024
1 parent b6ed84a commit aef3166
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,15 @@ protected List<ElkEdge> layoutRecursively(final ElkNode layoutNode, final TestCo
ElkPadding padding = childNode.getProperty(CoreOptions.PADDING);
childNode.setDimensions(Math.max(childNode.getWidth(), size.x + padding.left + padding.right),
Math.max(childNode.getHeight(), size.y + padding.top + padding.bottom));
} else {
// If no approximator is set, use the set sizes for atomic nodes and use the properties
// that have been set for nodes containing further children
if (childNode.getChildren().size() != 0) {
childNode.setDimensions(
layoutNode.getProperty(CoreOptions.TOPDOWN_HIERARCHICAL_NODE_WIDTH),
layoutNode.getProperty(CoreOptions.TOPDOWN_HIERARCHICAL_NODE_WIDTH) /
layoutNode.getProperty(CoreOptions.TOPDOWN_HIERARCHICAL_NODE_ASPECT_RATIO));
}
}
}
}
Expand Down

0 comments on commit aef3166

Please sign in to comment.