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.

Prevent browser page zoom pinch gesture on desktop

See original GitHub issue

Posted in html5 game forum here - haven’t received a response, but I believe this might be a bug.

Having an issue on desktop where Pixi interaction manager doesn’t appear to prevent default capturing pinch gestures.

This is especially problematic with Pixi Viewport, where pinch zoom gesture is getting caught by the browser; therefore, zooming the browser’s viewport (entire DOM).

pinch-zoom

Above, the pinch-zoom gesture is still picked up by the browser window.

Pixi Viewport creator David Figatner thought this should be default in Pixi’s Interaction Manager. https://github.com/davidfig/pixi-viewport/issues/196

Expected Behavior

Presume that Pixi would capture this event, and prevent default of the browser.

Believe this works in frameworks like Fabric.js and Deck.gl

Current Behavior

Pinch gesture is picked up by the browser, zooming the entire browser.

Another side effect is that the Pixi view becomes grainy since it isn’t being re-rendered.

Possible Solution

Prevent default of the events.

Maybe the intent is for it to zoom the entire DOM, without rendering high resolution.

Steps to Reproduce

Pinch-zoom a Pixi application - ideally with Pixi Viewport.

Environment

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:15 (7 by maintainers)

github_iconTop GitHub Comments

7reactions
eXponentacommented, Feb 15, 2020

@jasonsturges Ok, i found a solution. It is simple and doesn’t apply fo PIXI.

You should prevent wheel event =)

https://www.pixiplayground.com/#/edit/qjyV1YQMdfWc-db8AVGd2

Added to WIKI: https://github.com/pixijs/pixi.js/wiki/v5-Hacks#prevent-pinch-gesture-in-chrome

1reaction
fakobcommented, May 13, 2021

Thanks @nazywamsiepawel for your solution. I had the same issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Prevent browser page zoom pinch gesture on desktop #6414
Pinch gesture is picked up by the browser, zooming the entire browser. Another side effect is that the Pixi view becomes grainy since...
Read more >
How to prevent native browser default pinch to zoom behavior?
The native browser (Google Chrome for Mac, for instance) supports the "pinch to zoom" gesture by default which will zoom the whole viewport....
Read more >
Pinch to zoom vs trackpad pinch to zoom and zooming by code
If all you need is to prevent pinch gestures, you can do that without any downstream changes. To disable touchscreen pinch zoom, you...
Read more >
Prevent browser page zoom pinch gesture on desktop - Pixi.js
Having an issue on desktop where Pixi interaction manager doesn't appear to prevent default capturing pinch gestures.
Read more >
Disable pinch-zoom gesture in Chrome (Windows 10)
You can disable the full touch screen not just the pinch-zoom gesture in Google Chrome using this Chrome flag: chrome://flags/#touch-events.
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