Open rdoi opened 9 years ago
@rdoi totally shouldn't.
I've added some logging (check out recent commits in develop). You can compile against source code (but you will need to add conditional compilation flag CONFIG::GestouchDebug true) or build debug swc first: Maven: mvn clean package -Dprofile=debug
or Ant: ant compile.swc.debug
check out the logs and we'll see what kind of problem between touch and mouse events you have.
Well, I am not sure if I've expressed myself correctly.
There is a problem in the zoom gesture recognition when a mouse and touch happens at same time, in which the reported scale (offset) returns an "Infinity" value.
Its probably because the OS (Windows) "moves" the mouse cursor to where a touch happens. Its true also when you are still pressing down the mouse button, and touch the screen somewhere else.
So, when the 2nd real touch is recognized, the first touch (the mousedown) position is reported in the same place than the 2nd touch.
And if you try to calculate the distance between these 2 points you get a 0, hence returning a "Infinity" if you use it as divisor.
ZoomGesture.onTouchMove: around #117
if (lockAspectRatio)
{
_scaleX *= currTransformVector.length / _transformVector.length; // <-- HERE
_scaleY = _scaleX;
}
// (...)
@rdoi yeah, I understood you. But as we didn't have any real information about how OS delivers input information to the Flash runtime, I added logging. With it we can see exactly what is the input (events, ids and positions). No point to speculate, just try it =)
This is a very specific situation when using a device that have both mouse and touch capabilities (Win8).
If you click down with the mouse (keep pressed) and then touch and pan around with the finger somewhere else, a ZoomGesture is detected with a serie of scaleX and scaleY with 0 and "Infinity" values.
Not sure what should be the best behavior in this case, but I think "Infinity" value should not happen.
Here is a quick code: