Primary touch fix
This commit is contained in:
@@ -48,6 +48,7 @@ class HTML5Window {
|
|||||||
private var currentTouches = new Map<Int, Touch> ();
|
private var currentTouches = new Map<Int, Touch> ();
|
||||||
private var enableTextEvents:Bool;
|
private var enableTextEvents:Bool;
|
||||||
private var parent:Window;
|
private var parent:Window;
|
||||||
|
private var primaryTouch:Touch;
|
||||||
private var setHeight:Int;
|
private var setHeight:Int;
|
||||||
private var setWidth:Int;
|
private var setWidth:Int;
|
||||||
private var unusedTouchesPool = new List<Touch> ();
|
private var unusedTouchesPool = new List<Touch> ();
|
||||||
@@ -440,7 +441,13 @@ class HTML5Window {
|
|||||||
|
|
||||||
Touch.onStart.dispatch (touch);
|
Touch.onStart.dispatch (touch);
|
||||||
|
|
||||||
if (data == event.touches[0]) {
|
if (primaryTouch == null) {
|
||||||
|
|
||||||
|
primaryTouch = touch;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if (touch == primaryTouch) {
|
||||||
|
|
||||||
parent.onMouseDown.dispatch (x, y, 0);
|
parent.onMouseDown.dispatch (x, y, 0);
|
||||||
|
|
||||||
@@ -466,9 +473,10 @@ class HTML5Window {
|
|||||||
currentTouches.remove (data.identifier);
|
currentTouches.remove (data.identifier);
|
||||||
unusedTouchesPool.add (touch);
|
unusedTouchesPool.add (touch);
|
||||||
|
|
||||||
if (data == event.touches[0]) {
|
if (touch == primaryTouch) {
|
||||||
|
|
||||||
parent.onMouseUp.dispatch (x, y, 0);
|
parent.onMouseUp.dispatch (x, y, 0);
|
||||||
|
primaryTouch = null;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -491,7 +499,7 @@ class HTML5Window {
|
|||||||
|
|
||||||
Touch.onMove.dispatch (touch);
|
Touch.onMove.dispatch (touch);
|
||||||
|
|
||||||
if (data == event.touches[0]) {
|
if (touch == primaryTouch) {
|
||||||
|
|
||||||
parent.onMouseMove.dispatch (x, y);
|
parent.onMouseMove.dispatch (x, y);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user