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

Why I cannot destroy viewport on zoomed end event? #466

Open
devexus opened this issue Oct 2, 2023 · 1 comment
Open

Why I cannot destroy viewport on zoomed end event? #466

devexus opened this issue Oct 2, 2023 · 1 comment

Comments

@devexus
Copy link

devexus commented Oct 2, 2023

I want to change the view when I reach the set scale. I try to remove the viewport from the Pixi children and then run the destroy method. I received an error.

image

@blnvdanil
Copy link
Contributor

blnvdanil commented Oct 10, 2023

Simply because events are fired synchronously, and inside of viewport it has some other code to do after it fired zoom-end event. Destroy method does something like this.transform = null on display object, but viewport accesses position of the object, which is null, after it fired the event, and we have cannot get properties of null exception

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

2 participants