align-baselines ( gadgets -- ys )


Vocabulary
ui.baseline-alignment

Inputs
gadgetsan object


Outputs
ysan object


Definition


:: align-baselines ( gadgets -- ys )
gadgets [ dup pref-dim <gadget-metrics> ] map
dup max-ascent 0 or :> max-ascent dup max-cap-height 0 or
:> max-cap-height dup max-graphics-height
:> max-graphics-height max-cap-height max-graphics-height +
2 /i :> critical-line critical-line max-ascent [-]
:> text-leading max-ascent critical-line [-]
:> graphics-leading [
dup ascent>>
[ ascent>> max-ascent swap - text-leading ] [
height>> max-graphics-height swap - 2 /i
graphics-leading
] if +
] map ;