(pack-stripe) ( image-placements atlas-width @y -- stripe-height/f )


Vocabulary
images.atlas.private

Inputs
image-placementsan object
atlas-widthan object
@yan object


Outputs
stripe-height/fan object


Definition


:: (pack-stripe)
( image-placements atlas-width @y -- stripe-height/f )
0 :> @x! f :> stripe-height! image-placements [| ip |
ip loc>> [
ip image>> dim>> :> dim stripe-height
[ dim height stripe-height 0 or max stripe-height! ]
unless dim width :> w atlas-width w @x + >=
[ ip { @x @y } >>loc drop @x w + @x! ] when
] unless
] each stripe-height ;