question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

zoomPercent() doesn't trigger zoomed event

See original GitHub issue

As 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:closed
  • Created 2 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
bencrestycommented, Feb 19, 2022

@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.

0reactions
bencrestycommented, Feb 19, 2022

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

zoom and zoomed event cant't fire · Issue #180 - GitHub
I'm try to fire the zoom(zoomed) event in two way: new Viewer(el, { zoom() ... new Viewer(el, { zoom() { console.log('zoom') } })....
Read more >
Leaflet JS zoomend event is not triggering when zoomed out ...
When zooming from level e.g. 14 to 18 the zoom animation is not played by default - the default value for the map's...
Read more >
Using webhooks - Zoom App Marketplace
This webhook triggers when a user is created on a Zoom account that is subscribed to the User has been created event in...
Read more >
Controlling Zoom and Pan | Maps JavaScript API
This map reacts to all touch gestures and scroll events unlike cooperative .
Read more >
Connect your online event to Zoom | Eventbrite Help Center
☑️ You are the admin on a non-government Zoom account. This integration does not currently support .gov Zoom accounts. ☑️ You've created an...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found