Skip to content

Commit

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

totalArea += (sortedBoxes.size() * 1 * stddev);
// 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 f84cac3

Please sign in to comment.