alignToVertically

fun List<Rectangle>.alignToVertically(to: Rectangle, anchor: Double = 0.5): List<Rectangle>(source)

Aligns the rectangles in the list vertically to a reference rectangle. The vertical position of each rectangle is determined based on the reference rectangle and the specified vertical anchor point.

Return

A new list of rectangles aligned vertically to the specified rectangle.

Parameters

to

The reference rectangle to which the list of rectangles is vertically aligned.

anchor

A value between 0.0 and 1.0 representing the vertical anchor point. Defaults to 0.5, which aligns based on the center.