diff --git a/plugins/org.eclipse.elk.core/src/org/eclipse/elk/core/util/BoxLayoutProvider.java b/plugins/org.eclipse.elk.core/src/org/eclipse/elk/core/util/BoxLayoutProvider.java index 6170bade68..973984b651 100644 --- a/plugins/org.eclipse.elk.core/src/org/eclipse/elk/core/util/BoxLayoutProvider.java +++ b/plugins/org.eclipse.elk.core/src/org/eclipse/elk/core/util/BoxLayoutProvider.java @@ -194,6 +194,8 @@ private KVector placeBoxes(final List sortedBoxes, final double minSpac double stddev = areaStdDev(sortedBoxes, mean); totalArea += (sortedBoxes.size() * 1 * stddev); + // add padding to total area + totalArea += Math.sqrt(totalArea) * (padding.getBottom() + padding.getTop()); // calculate the required row width w to achieve the desired aspect ratio, // i.e.: w*h=area s.t. w/h=dar -> w=sqrt(area * dar)