Fix first tap in touch mode not registering

This commit is contained in:
Cameron Gutman
2020-11-01 14:43:55 -06:00
parent 7270554153
commit a1f09f117f
3 changed files with 13 additions and 10 deletions
+2 -2
View File
@@ -57,7 +57,7 @@
if (touch.timestamp - lastTouchUp.timestamp > DOUBLE_TAP_DEAD_ZONE_DELAY ||
sqrt(pow((touchLocation.x / view.bounds.size.width) - (lastTouchUpLocation.x / view.bounds.size.width), 2) +
pow((touchLocation.y / view.bounds.size.height) - (lastTouchUpLocation.y / view.bounds.size.height), 2)) > DOUBLE_TAP_DEAD_ZONE_DELTA) {
[view updateCursorLocation:touchLocation];
[view updateCursorLocation:touchLocation isMouse:NO];
}
// Press the left button down
@@ -90,7 +90,7 @@
longPressTimer = nil;
}
[view updateCursorLocation:[[touches anyObject] locationInView:view]];
[view updateCursorLocation:[[touches anyObject] locationInView:view] isMouse:NO];
}
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {