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 resize->save bug in texture inspector #11191

Merged

Conversation

darraghjburke
Copy link
Contributor

Forum post for context: https://forum.babylonjs.com/t/texture-swap-incorrectly-accounted-for-when-exporting-modified-babylon-scene-from-sandbox/24184/4

If you resize a texture in the texture inspector, or upload a texture with a different size, then try to save your texture, you will get an empty image file. This is because the canvas size was being controlled by React. The texture size would change, then several frames later the React component would re-render. Changing the size of the canvas causes it to be cleared.

This PR takes away control of the canvas size from React to prevent the canvas from being cleared when the re-render happens. Now canvas size is controlled completely imperatively, so there are no unexpected resizes.

@darraghjburke darraghjburke merged commit 2d3436e into BabylonJS:master Sep 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants