LottieFiles / dotlottie-web

Official LottieFiles player for rendering Lottie and dotLottie animations in the web. Supports React, Vue, Svelte, SolidJS and Web Components.
https://developers.lottiefiles.com/docs/dotlottie-player/
MIT License
191 stars 11 forks source link

Layout property not working #323

Closed housemeow closed 3 months ago

housemeow commented 3 months ago

Overview

After I apply the layout property to DotLottie object, the animation will disappear

Consuming repo

What repo were you working in when this issue occurred?

Here is the codepen link, yoiu you will see there are 2 canvas but only 1 shows. the different between them is layout property. https://codepen.io/housemeow/pen/OJeQggr

Labels

theashraf commented 3 months ago

Hi @housemeow, It looks like the layout object is missing the align property.

image

One enhancement we can implement on our end is to add default fit and align properties to the layout object if they are missing.

housemeow commented 3 months ago

thanks @theashraf reply! cool! my animation shows!

does it mean 2 properties of layout object are required?

I can create a PR for that.

image
theashraf commented 3 months ago

Hi @housemeow, Yes, both are required, but we can make them optional if we have a default value to rely on.

Sure, feel free to contribute—this would be a valuable fix for those using the layout option.