Skip to content

Commit

Permalink
Include padding when setting node sizes in top-down layout (#1046)
Browse files Browse the repository at this point in the history
  • Loading branch information
Eddykasp authored Jul 4, 2024
1 parent 830b539 commit e8f6b30
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -252,8 +252,9 @@ protected List<ElkEdge> layoutRecursively(final ElkNode layoutNode, final TestCo
TopdownSizeApproximator approximator =
childNode.getProperty(CoreOptions.TOPDOWN_SIZE_APPROXIMATOR);
KVector size = approximator.getSize(childNode);
childNode.setDimensions(Math.max(childNode.getWidth(), size.x),
Math.max(childNode.getHeight(), size.y));
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));
}
}
}
Expand Down

0 comments on commit e8f6b30

Please sign in to comment.