Skip to content

Commit

Permalink
Layered: Added fixed graph size support. (#804)
Browse files Browse the repository at this point in the history
Fixes #725.
Signed-off-by: Soeren Domroes <sdo@informatik.uni-kiel.de>
  • Loading branch information
soerendomroes committed Mar 21, 2022
1 parent 10d85dc commit cdfa858
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,9 @@ public void doLayout(final LGraph lgraph, final IElkProgressMonitor monitor) {
componentsProcessor.combine(components, lgraph);

// Resize the resulting graph, according to minimal size constraints and such
resizeGraph(lgraph);
if (!lgraph.getProperty(LayeredOptions.NODE_SIZE_FIXED_GRAPH_SIZE)) {
resizeGraph(lgraph);
}

theMonitor.done();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ algorithm layered(LayeredLayoutProvider) {
supports org.eclipse.elk.insideSelfLoops.yo
supports org.eclipse.elk.nodeSize.constraints
supports org.eclipse.elk.nodeSize.options
supports org.eclipse.elk.nodeSize.fixedGraphSize
supports org.eclipse.elk.direction = Direction.UNDEFINED
supports org.eclipse.elk.nodeLabels.placement
supports org.eclipse.elk.nodeLabels.padding
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -369,12 +369,14 @@ private void applyParentNodeLayout(final LGraph lgraph) {
true);
} else {
// Ports have not been positioned yet - leave this for next layouter
ElkUtil.resizeNode(
elknode,
actualGraphSize.x,
actualGraphSize.y,
true,
true);
if (!elknode.getProperty(LayeredOptions.NODE_SIZE_FIXED_GRAPH_SIZE)) {
ElkUtil.resizeNode(
elknode,
actualGraphSize.x,
actualGraphSize.y,
true,
true);
}
}
}

Expand Down

0 comments on commit cdfa858

Please sign in to comment.