Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Canvas resize() breaks shape layers #3109

Open
Joolyan opened this issue Aug 10, 2024 · 2 comments
Open

Canvas resize() breaks shape layers #3109

Joolyan opened this issue Aug 10, 2024 · 2 comments

Comments

@Joolyan
Copy link

Joolyan commented Aug 10, 2024

Calling resize() with the canvas renderer, correctly resizes the canvas element but breaks shape layer rendering.

Tell us about your environment
Reproduced on macOS 13.6.9 and Windows 10
Browser: Firefox, Chrome, Edge, Safari
After Effects 24.5
Bodymovin 5.12.1

What did you do? Please explain the steps you took before you encountered the problem.
Called resize() with the canvas renderer.

What did you expect to happen?
Resize the canvas element after changes to viewport window - without breaking shape layer formatting.

What actually happened? Please include as much relevant detail as possible.
Canvas element correctly resized, but with some shape layers reverting to default settings.

  • Shape layer paths change from round cap to butt cap
  • Shape layer stroke widths change to 2
  • Shape layer colours change to black

Please provide a download link to the After Effects file that demonstrates the problem.
https://codepen.io/e-media/pen/BagwWOr?editors=1111

The CodePen should open with the correctly formatted Lottie animation (Red dots with white trails) but when you resize the window, some of the formatting reverts to defaults.

Lottie hasn't been updated for over a year, but hopefully someone will have a possible solution. My temporary solution when the canvas renderer is requested, is to destroy the animation instance and reload, which is not ideal.

@Joolyan
Copy link
Author

Joolyan commented Aug 15, 2024

Just realised that the issue was introduced in v5.12.1 of the renderer, so downgrading to v5.12.0 is another temporary solution. This can be tested in the above CodePen example by changing the JS settings to https://cdnjs.cloudflare.com/ajax/libs/lottie-web/5.12.0/lottie.min.js
Unfortunately v5.12.0 doesn't include some important new features and fixes. So hopefully this will be helpful to someone.

@Joolyan
Copy link
Author

Joolyan commented Aug 21, 2024

Found the issue which will require an update to the canvas renderer, however it appears that this is unlikely to happen anytime soon. v5.12.0 seems to be the best option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant