bug fix
This commit is contained in:
1 parent
0fda662370
commit
4b2ae15efc
1 file changed
+14
-9
@@ -266,8 +266,11 @@ static const double X1_MOUSE_SPEED_DIVISOR = 2.5;
|
|||||||
// remove pointerId in UITouchPhaseEnded condition
|
// remove pointerId in UITouchPhaseEnded condition
|
||||||
- (void)removePointerId:(UITouch*)event{
|
- (void)removePointerId:(UITouch*)event{
|
||||||
uint64_t eventAddrValue = (uint64_t)event;
|
uint64_t eventAddrValue = (uint64_t)event;
|
||||||
[pointerIdSet removeObject:[pointerIdDict objectForKey:@(eventAddrValue)]];
|
NSNumber* pointerIdObj = [pointerIdDict objectForKey:@(eventAddrValue)];
|
||||||
[pointerIdDict removeObjectForKey:@(eventAddrValue)];
|
if(pointerIdObj != nil){
|
||||||
|
[pointerIdSet removeObject:pointerIdObj];
|
||||||
|
[pointerIdDict removeObjectForKey:@(eventAddrValue)];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 从字典中获取UITouch事件对应的pointerId
|
// 从字典中获取UITouch事件对应的pointerId
|
||||||
@@ -320,17 +323,16 @@ static const double X1_MOUSE_SPEED_DIVISOR = 2.5;
|
|||||||
case UITouchPhaseRegionMoved://停留
|
case UITouchPhaseRegionMoved://停留
|
||||||
type = LI_TOUCH_EVENT_HOVER;
|
type = LI_TOUCH_EVENT_HOVER;
|
||||||
break;
|
break;
|
||||||
|
case UITouchPhaseCancelled://触摸取消
|
||||||
|
type = LI_TOUCH_EVENT_CANCEL;
|
||||||
|
[self sendTouchEvent:event touchType:type]; //先发送,再删除
|
||||||
|
[self removePointerId:event]; //删除pointerId
|
||||||
|
return;
|
||||||
case UITouchPhaseEnded://触摸结束
|
case UITouchPhaseEnded://触摸结束
|
||||||
type = LI_TOUCH_EVENT_UP;
|
type = LI_TOUCH_EVENT_UP;
|
||||||
[self sendTouchEvent:event touchType:type]; //先发送,再删除
|
[self sendTouchEvent:event touchType:type]; //先发送,再删除
|
||||||
[self removePointerId:event]; //删除pointerId
|
[self removePointerId:event]; //删除pointerId
|
||||||
return;
|
return;
|
||||||
case UITouchPhaseCancelled://触摸取消
|
|
||||||
type = LI_TOUCH_EVENT_CANCEL;
|
|
||||||
//[self sendTouchEvent:event touchType:type];
|
|
||||||
// [pointerIdDict removeAllObjects]; //do not remove object from pointerDict & pointerIdSet here. they'll be removed in UITouchPhaseEnded.
|
|
||||||
// [pointerIdSet removeAllObjects];
|
|
||||||
//return;
|
|
||||||
default:
|
default:
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -462,6 +464,7 @@ static const double X1_MOUSE_SPEED_DIVISOR = 2.5;
|
|||||||
// return;
|
// return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// NSLog(@"touchesBegan - allTouches %lu, pointerSet count %lu",[[event allTouches] count], [pointerIdSet count]);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -645,7 +648,7 @@ static const double X1_MOUSE_SPEED_DIVISOR = 2.5;
|
|||||||
// return;
|
// return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// NSLog(@"touchesMoved - allTouches %lu, pointerSet count %lu",[[event allTouches] count], [pointerIdSet count]);
|
||||||
UITouch *touch = [touches anyObject];
|
UITouch *touch = [touches anyObject];
|
||||||
if (touch.type == UITouchTypeIndirectPointer) {
|
if (touch.type == UITouchTypeIndirectPointer) {
|
||||||
if (@available(iOS 14.0, *)) {
|
if (@available(iOS 14.0, *)) {
|
||||||
@@ -738,6 +741,7 @@ static const double X1_MOUSE_SPEED_DIVISOR = 2.5;
|
|||||||
// return;
|
// return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// NSLog(@"touchesEnded - allTouches %lu, pointerSet count %lu",[[event allTouches] count], [pointerIdSet count]);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -763,6 +767,7 @@ static const double X1_MOUSE_SPEED_DIVISOR = 2.5;
|
|||||||
// return;
|
// return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// NSLog(@"touchesCancelled - allTouches %lu, pointerSet count %lu",[[event allTouches] count], [pointerIdSet count]);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user