PDA

View Full Version : [FIXED-242] Pinch gesture is interpreted as swipe



Kask
26 Aug 2010, 5:01 AM
Sencha Touch version tested:


0.9 rev 3



only default ext-all.css


Platform tested against:


iOS 3.x
iOS 4


Description:
If you are doing a rather small pinch, but still a two-finger pinch, it can be interpreted as a swipe and rise that event instead of the pinch event. Might have to do with the plastic film on my iPad, but its still an issue.

Test Case:



Ext.ux.TouchPad = Ext.extend(Ext.Component, {
id: 'touchpad',
html: 'Touch here!',
fullscreen: true,
initComponent : function() {
Ext.ux.TouchPad.superclass.initComponent.call(this);
},

afterRender: function() {
Ext.ux.TouchPad.superclass.afterRender.call(this);

this.mon(this.el, {
swipe: this.handleEvent,
pinch: this.handleEvent,
});
},

handleEvent: function(e) {
console.log(e.type);
}
});


Ext.setup({
glossOnIcon: false,
onReady: function () {

new Ext.Panel({
fullscreen: true,
title: 'Swipe/Pinch test',
items: new Ext.ux.TouchPad()
});
}
});

Steps to reproduce the problem:


Do a small two-finger pinch.
Check console log.


The result that was expected:


Pinch event would rise.


The result that occurs instead:


Sometimes the swipe event is raised instead.


Debugging already done:


none


Possible fix:


Change the if-case that determines if check for swipe is to be done, and include that no check should be done if its multiTouch.
Line 4674 in ext-touch-debug-w-comments.js

if (!track.scrolling && track.events.swipe && !me.multiTouch)

Jamie Avins
26 Aug 2010, 2:55 PM
Thank you for the report.

TommyMaintz
20 Sep 2010, 7:38 AM
This has been fixed in the new gesture system that will be part of the next release.