zoomPercent() doesn't trigger zoomed event
See original GitHub issueAs title; when setting a zoom with zoomPercent()
the zoomed
event (and the zoomed-end
event) is not triggered. This is causing logic that needs to counter-scale or update something with the viewport scaling missing the event to update itself.
[edit] When doing more testing I see that there is a difference between hitting the method once and keep on triggering the method during an animation. When triggering the method once it works and the zoom events get triggered, but when doing it from within an animation (see code below) it doesn’t trigger events. Obviously also when triggered from an animation events should be triggered. Not sure why that’s not the case right now.
This is the code that doesn’t trigger the events. It’s used to animate zoom while holding a button.
const delta = 0.01;
this._tween = gsap.to({}, {
duration: 1,
repeat: -1,
onUpdate: () => {
this.vp.zoomPercent(delta, true);
},
});
pixi-viewport: 4.34.4
Issue Analytics
- State:
- Created 2 years ago
- Comments:9 (4 by maintainers)
Top GitHub Comments
@davidfig you are clearly not reading my posts. Also you must be the first one I ever meet working with pixiJs that doesn’t know Greensock Gsap This is not ‘my’ animation system, it’s a well proven animation system used by a huge number of developers all over the world for lots of years.
Also I wrote a few times now that the method DOES fire, but only when triggered once under a button. Not when triggered from within an animation. I posted the EXACT code laready in the opening post.
It’s pretty difficult to communicate with some one that doesn’t even read my posts.
Wow, so this is how you handle people mentioning bugs, right?
First act like you don’t get it and frustrate the issue mentioner who tries to explain the issue again and again, eventhough it was already clear in the opening post and I kept taking the time to explain again and again.
And then just close the issue, while the bug is still there? Only because I pinpoint what’s happening here?
Very mature and professional to act like an issue isn’t there, hide the post and to not have to solve it.