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

Resize MotionCanvas when container resizes (Fixes #1444) #2047

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

sdacunha
Copy link

I was facing the issue in #1444 and attempted to fix it locally via patch-package. It seems to correct the behaviour described in the issue with regards to updating the canvas size as the parent resizes, and utilizes react-use-measure as does the react-three implementation.

I did not find any relevant MotionCanvas tests I could use as a starting point, so I did not any tests for this case, but given it seems like a minor fix, that might be okay. Happy to add it if someone can point me in the right direction / contribute to this PR.

@mattgperry
Copy link
Collaborator

My initial thought is the reason MotionCanvas isn't so good with this is to support layout animations with LayoutCamera. It might be a good idea to grab an example from the docs and set up a test with that to see if layout animations work correctly with this.

@sdacunha
Copy link
Author

My initial thought is the reason MotionCanvas isn't so good with this is to support layout animations with LayoutCamera. It might be a good idea to grab an example from the docs and set up a test with that to see if layout animations work correctly with this.

@mattgperry Interesting - will try to take a look at this. Looking at the LayoutCamera example, it seems like resizing the window has some weird behaviour currently after clicking to start the animation. Nonetheless, will look into testing this behaviour when I can

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.

None yet

2 participants