Layout

When creating a Config you are able to define a Layout object that contains information about how you want the animation to be positioned inside the canvas.

let anim = DotLottieAnimation(
fileName: "",
config: AnimationConfig(..., layout: Layout(fit: Fit.contain, align: [0, 1]))
)

The Layout object is created with a fit and align:

PropertyTypeDescriptionDefault value
fitFitThe fit mode of the animation. Accepts “contain”, “cover”, “fill”, “fit-width”, “fit-height” and “none”.contain
align[Float]The alignment of the animation in the canvas. Origin is at the top-left corner where [0, 0] is the top-left corner and [1, 1] is the bottom-right corner.[0.5, 0.5]