fitVertically
fun List<Rectangle>.fitVertically(within: Rectangle = bounds, gutter: Double = 0.0): List<Rectangle>(source)
Fits a list of rectangles within a given vertical rectangular area. Each rectangle's height is adjusted proportionally based on its original height relative to the total height of all rectangles in the list. The rectangles are then distributed vertically, with an optional gutter spacing between them.
Return
A new list of rectangles that are proportionally resized and vertically distributed within the specified bounding rectangle.
Parameters
within
The bounding rectangle within which the list of rectangles should fit. If not provided, the bounds of the current list of rectangles will be used.
gutter
The vertical spacing between the rectangles. Default value is 0.0.