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: Remounting canvas #306

Closed
wants to merge 1 commit into from
Closed

fix: Remounting canvas #306

wants to merge 1 commit into from

Conversation

cjboy76
Copy link

@cjboy76 cjboy76 commented Jun 17, 2023

Close #302
Appreciate you for your incredible work.
I found that while remounting the canvas, the perspective camera isn't rendered so that it causes this issue.

Also the condition with firstCamera is not needed because setFirstCamera only pushes camera if there is no cameras in state, perhaps there is some reasons why doing this.
Let me know any further updates.

@netlify
Copy link

netlify bot commented Jun 17, 2023

Deploy Preview for tresjs-docs ready!

Name Link
🔨 Latest commit ed0754c
🔍 Latest deploy log https://app.netlify.com/sites/tresjs-docs/deploys/648de139b2c88b000878d037
😎 Deploy Preview https://deploy-preview-306--tresjs-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@alvarosabu
Copy link
Member

Hi @cjboy76 first of all thanks for taking the time to create this PR. The solution does fix the issue of remounting but unfortunately breaks the HMR.

Although this is our fault because we recently figured out that using Composables like useCamera that access the provider context state shouldn't live inside the custom renderer nodeOpts (Composables need a component setup context which is lost constantly).

I'm gonna refactor the camera logic on #307, hope you don't mind if I close this PR.

Screenshot 2023-06-19 at 08 25 26

@cjboy76
Copy link
Author

cjboy76 commented Jun 19, 2023

@alvarosabu No problem, thanks for your reply 👍

@alvarosabu
Copy link
Member

@cjboy76 fixed here #308

@alvarosabu alvarosabu closed this Jun 19, 2023
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.

Nuxt3 + Tresjs rendering issue(when remounting, not displaying)
2 participants