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

fix: 🐛 ensure canvas is cleared before loading a new animation #86

Merged
merged 4 commits into from
Feb 22, 2024

Conversation

theashraf
Copy link
Member

Fixes:

  • Ensure tvg_canvas_clear(true) is called before loading a new animation to free the pushed paints from memory. This prevents memory leaks when loading multiple animations.
  • Modify the thorvg::Animation struct to own the raw pointer to the picture, resulting in all related picture methods being moved to the Animation struct. This also simplifies the API.
  • The width and height of the background_color shape should match the canvas's width and height, not the picture's width and height.
  • Resize the background_color shape on canvas resize.

Copy link

changeset-bot bot commented Feb 21, 2024

⚠️ No Changeset found

Latest commit: 0284121

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@theashraf theashraf marked this pull request as ready for review February 21, 2024 14:05
@theashraf theashraf merged commit 38932bf into main Feb 22, 2024
1 check passed
@github-actions github-actions bot mentioned this pull request Apr 3, 2024
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

Successfully merging this pull request may close these issues.

2 participants