davidfig / pixi-viewport

A highly configurable viewport/2D camera designed to work with pixi.js
https://davidfig.github.io/pixi-viewport/
MIT License
1.04k stars 174 forks source link

Lagging Zoom while use Clamp #435

Closed Harwex213 closed 1 year ago

Harwex213 commented 1 year ago

I was researching two live examples mentioned in readme - "New" and "Original" and found that they are behavior different. On both I turn on clamp feature and tried to zoom in/out with position mouse outside of world boundaries.

"New" live example behavior:

"Original" live example behavior:

The last one is "shaking" while I'm zooming in/out. Such behavior I've faced while tried implement wheel with clamp in my project.

Can someone please explain me where is the difference?

Harwex213 commented 1 year ago

Resolved with passing PIXI app ticker to pixi-viewport init config:

const viewport = new Viewport({
    events: app.renderer.events,
    ticker: app.ticker, // ATTENTION
});