Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multi-touch zoom not working on hybrid laptop #53

Closed
bergwerf opened this issue Mar 14, 2016 · 7 comments
Closed

Multi-touch zoom not working on hybrid laptop #53

bergwerf opened this issue Mar 14, 2016 · 7 comments
Labels

Comments

@bergwerf
Copy link

I have a Chromebook with both a touch screen and a touchpad. I can zoom using my touchpad but not using multi-touch on the touch screen.

@arose arose added the bug label Mar 14, 2016
@arose
Copy link
Collaborator

arose commented Mar 14, 2016

Is this on http://arose.github.io/ngl/, if not does it work there? Does it work on this site http://threejs.org/examples/#misc_controls_trackball? Are there any messages in the browser console?

@bergwerf
Copy link
Author

It doesn't work on the three.js site and there are no console errors. The problem is basically that the system defaults to page zooming when you use multitouch zoom. I just discovered zooming out works (because the page cannot be zoomed out any more, so zooming the canvas is working again). You have to block the event from propagating to other elements/prevent the default action (e.g. e.preventDefault()).

@arose
Copy link
Collaborator

arose commented Mar 15, 2016

Thanks @hermanbergwerf added some e.preventDefault()s, see be33e14. Please let me know if it works for you http://arose.github.io/ngl/.

@bergwerf
Copy link
Author

Unfortunately it did not work. I shortly looked into it and this oneliner solves the issue.

document.getElementById('viewport').addEventListener('touchmove',function(e){e.preventDefault();});

Preventing on scoll is probably not working since multitouch zoom is not considered a scroll event by the browser. You should block the propagation of touchmove.

@arose
Copy link
Collaborator

arose commented Mar 15, 2016

Cool, I add that later today. Thanks!

On Tue, Mar 15, 2016, at 11:30 AM, Herman Bergwerf wrote:

Unfortunately it did not work. I shortly looked into it and this
oneliner solves the issue.
document.getElementById('viewport').addEventListener('touchmove',func-
tion(e){e.preventDefault();});
Preventing on scoll is probably not working since multitouch zoom is
not considered a scroll event by the browser. You should block the
propagation of touchmove.

You are receiving this because you commented.
Reply to this email directly or view it on GitHub[1]

Links:

  1. Multi-touch zoom not working on hybrid laptop #53 (comment)

@arose
Copy link
Collaborator

arose commented Mar 17, 2016

Ok, could reproduce this and hopefully fixed it now (73983c5, 2f139f4). Thanks again.

@bergwerf
Copy link
Author

Yep, fixed now (on my Chromebook). Awesome!

@arose arose closed this as completed Mar 17, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants