pub fn guess(boundingboxes: &[Rectangle]) -> GuessedExpand description
Guesses layout properties (direction, spacing and alignment) from a list of bounding boxes.
The algorithm roughly follows these steps:
- Sum gaps along both axes and pick the axis with the larger gap spread as the main axis.
- Compute average spacing along the chosen axis.
- Sort rectangles on that axis to derive their order.
- Estimate cross axis alignment by comparing the variance of starts, centers and ends.