hammerjs / hammerjs.github.io

Website
https://hammerjs.github.io
71 stars 578 forks source link

pinch event not working #23

Open brendonco opened 9 years ago

brendonco commented 9 years ago

Hi,

I wanted to scale/pinch to zoom in/out my canvas but was not able to do it using the pinch event from my Desktop. Is there an easier tutorial how to do it? I saw that you have implemented in "http://cdn.rawgit.com/hammerjs/touchemulator/master/tests/manual/hammer.html" but too many to bind of event e.g. pan, swipe, rotate. I only need to scale the canvas without rotating the element. Below is the initialization based on your tutorial.

var hm = new Hammer.Manager(canvas); hm.on("pinchstart pinchmove", onPinch);

And I want to mock the pinch by using your touch-emulator.js. but not so sure how to use this. the touch event is triggering but I guess we need a little tweak since the event properties return from the touch-emulator is different from the pinch event. Any suggestion to make it simplier? :D