I was working on including rotate gestures in my app following the tutorial given on https://konvajs.org/docs/sandbox/Gestures.html. But in my app i have also attached 'tap' event listener so whenever I tried to rotate the shape using gesture , 'tap' event gets emitted also and on taping the shape for once 'tap' event is getting emitted twice. Is there any way so that I can prevent that from happening means while rotation via 2 finger rotate gesture, 'tap' event should not get emitted? is there any way to use stopImmediatePropagation() in konvajs?
group.on('tap', function(ev) {
console.log("tap event")
});
group.on('rotatestart', function(ev) {
oldRotation = ev.evt.gesture.rotation;
startScale = rect.scaleX();
group.stopDrag();
group.draggable(false);
text.text('rotating...');
});
group.on('rotate', function(ev) {
var delta = oldRotation - ev.evt.gesture.rotation;
group.rotate(-delta);
oldRotation = ev.evt.gesture.rotation;
group.scaleX(startScale * ev.evt.gesture.scale);
group.scaleY(startScale * ev.evt.gesture.scale);
layer.batchDraw();
});
group.on('rotateend rotatecancel', function(ev) {
text.text(defaultText);
group.draggable(true);
layer.batchDraw();
});