Skip to content

Commit

Permalink
More changes to box algorithm
Browse files Browse the repository at this point in the history
  • Loading branch information
stu241636 committed Nov 12, 2024
1 parent bc1d189 commit 85c3778
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,11 @@ private KVector placeBoxes(final List<ElkNode> sortedBoxes, final double minSpac
double stddev = areaStdDev(sortedBoxes, mean);

totalArea += (sortedBoxes.size() * 1 * stddev);
// add padding to total area
// add top and bottom padding to total area
totalArea += Math.sqrt(totalArea) * (padding.getBottom() + padding.getTop());
// add left and right padding
totalArea += Math.sqrt(totalArea) * (padding.getRight());


// 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)
Expand Down

0 comments on commit 85c3778

Please sign in to comment.