pixi-viewport icon indicating copy to clipboard operation
pixi-viewport copied to clipboard

2nd time you pinch on mobile it breaks

Open stevemarksd opened this issue 5 years ago • 3 comments

Reproduce:

  • Open this page https://davidfig.github.io/pixi-viewport/ in chrome on your android phone
  • Pinch once (all fine)
  • Pinch again

What happens:

  • It kind of freaks out in a strange way. Kind of starts panning on one pointer, but then flickers a bit between one finger and the other finger.

What should happen:

  • Same as on first pinch, smooth zoom

stevemarksd avatar Feb 19 '20 14:02 stevemarksd

I was able to replicate the bug. It's weird because it only happens on the second pinch. Future pinches and all drags work fine.

This is likely caused by pixi's hitArea test for the viewport. The viewport is not getting the pointerdown event for the finger that is outside the viewport during that second pinch. Weirdly, it does get pointermove events when that finger moves, but it's getting the same id as the other finger, which is why the viewport gets wonky: it's performing the drag calculation using two separate finger locations.

Is this causing problems in your app? I'd have to dig deeper and figure out where the events are getting crossed.

davidfig avatar Feb 19 '20 23:02 davidfig

yes it is causing :( everything works quite smoothly. there is actually another bug and I will open now

stevemarksd avatar Feb 24 '20 13:02 stevemarksd

Were we able to figure out the root cause of this bug?

devyeshtandon avatar Jan 18 '24 12:01 devyeshtandon