From bc1d189bf50b7e0ff80d43badab0fe92fb2350ca Mon Sep 17 00:00:00 2001 From: Tobias Weimar Date: Fri, 8 Nov 2024 15:13:17 +0100 Subject: [PATCH] first improvement --- .../src/org/eclipse/elk/core/util/BoxLayoutProvider.java | 2 ++ 1 file changed, 2 insertions(+) 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)