viktorthang / mgwt

Automatically exported from code.google.com/p/mgwt
Other
0 stars 0 forks source link

PinchRecognizer get stuck in INVALID state #345

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Initialize a TouchDelegate and add a PinchHandler using addPinchHandler
2. Add some arbitrary code that counts the number of pinch events detected and 
display to screen
3. Compile and run on a device. You will see that the pinch handler rarely (if 
ever) gets incremented

What is the expected output? What do you see instead?
PinchEvent should be fired constantly when 2 fingers are down and movement is 
detected. Instead, the state gets set to INVALID, which causes PinchEvent to 
never fire.

What version of the product are you using? On what operating system?
Tried with 1.2 and 2.0

Please provide any additional information below.
The bug is in PinchRecognizer.onTouchMove line: 122. The default case statement 
should be more lenient. It is almost impossible to NOT register a 
TouchMoveEvent while the ONE_FINGER state is active (usually the first few 
events after your first finger is "down").
In my fix, I simply commented out the default case statement and never set the 
state to INVALID. This fixes the issue.

Original issue reported on code.google.com by owre....@gmail.com on 12 Jan 2015 at 6:26