mirror of
https://github.com/moonlight-stream/moonlight-ios.git
synced 2026-06-17 14:11:35 +00:00
Fix erratic scroll movement when beginning a scroll gesture
This commit is contained in:
@@ -58,15 +58,23 @@ static const int REFERENCE_HEIGHT = 720;
|
|||||||
}
|
}
|
||||||
|
|
||||||
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
|
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
|
||||||
UITouch *touch = [[event allTouches] anyObject];
|
|
||||||
originalLocation = touchLocation = [touch locationInView:view];
|
|
||||||
touchMoved = false;
|
touchMoved = false;
|
||||||
if ([[event allTouches] count] == 1 && !isDragging) {
|
if ([[event allTouches] count] == 1) {
|
||||||
dragTimer = [NSTimer scheduledTimerWithTimeInterval:0.650
|
UITouch *touch = [[event allTouches] anyObject];
|
||||||
target:self
|
originalLocation = touchLocation = [touch locationInView:view];
|
||||||
selector:@selector(onDragStart:)
|
if (!isDragging) {
|
||||||
userInfo:nil
|
dragTimer = [NSTimer scheduledTimerWithTimeInterval:0.650
|
||||||
repeats:NO];
|
target:self
|
||||||
|
selector:@selector(onDragStart:)
|
||||||
|
userInfo:nil
|
||||||
|
repeats:NO];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if ([[event allTouches] count] == 2) {
|
||||||
|
CGPoint firstLocation = [[[[event allTouches] allObjects] objectAtIndex:0] locationInView:view];
|
||||||
|
CGPoint secondLocation = [[[[event allTouches] allObjects] objectAtIndex:1] locationInView:view];
|
||||||
|
|
||||||
|
originalLocation = touchLocation = CGPointMake((firstLocation.x + secondLocation.x) / 2, (firstLocation.y + secondLocation.y) / 2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user