Skip to content

Commit bc1d189

Browse files
stu241636tobias
authored and
tobias
committed
first improvement
1 parent 099fd0d commit bc1d189

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

plugins/org.eclipse.elk.core/src/org/eclipse/elk/core/util/BoxLayoutProvider.java

+2
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,8 @@ private KVector placeBoxes(final List<ElkNode> sortedBoxes, final double minSpac
194194
double stddev = areaStdDev(sortedBoxes, mean);
195195

196196
totalArea += (sortedBoxes.size() * 1 * stddev);
197+
// add padding to total area
198+
totalArea += Math.sqrt(totalArea) * (padding.getBottom() + padding.getTop());
197199

198200
// calculate the required row width w to achieve the desired aspect ratio,
199201
// i.e.: w*h=area s.t. w/h=dar -> w=sqrt(area * dar)

0 commit comments

Comments
 (0)