computeCardDimensions

fun computeCardDimensions(viewportWidth: Double, cardMaxHeight: Double?, paddingHorizontal: Double, aspectRatio: Double): CardDimensions

Computes the rendered dimensions and horizontal centering offset for a card.

Return

CardDimensions containing width, height, and horizontal offset.

Parameters

viewportWidth

available viewport width.

cardMaxHeight

optional maximum height constraint.

paddingHorizontal

horizontal padding.

aspectRatio

width-to-height aspect ratio of the card.