mirror of
https://github.com/moonlight-stream/moonlight-ios.git
synced 2026-04-22 16:26:59 +00:00
Improve scrolling behavior for continuous scroll input
This commit is contained in:
@@ -459,17 +459,20 @@ static const double X1_MOUSE_SPEED_DIVISOR = 2.5;
|
|||||||
switch (gesture.state) {
|
switch (gesture.state) {
|
||||||
case UIGestureRecognizerStateBegan:
|
case UIGestureRecognizerStateBegan:
|
||||||
case UIGestureRecognizerStateChanged:
|
case UIGestureRecognizerStateChanged:
|
||||||
case UIGestureRecognizerStateEnded:
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case UIGestureRecognizerStateEnded:
|
||||||
default:
|
default:
|
||||||
// Ignore recognition failure and other states
|
// Ignore recognition failure and other states
|
||||||
|
lastScrollTranslation = CGPointMake(0, 0);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
short velocityY = [gesture velocityInView:self].y;
|
CGPoint currentScrollTranslation = [gesture translationInView:self];
|
||||||
if (velocityY != 0) {
|
short translationDeltaY = ((currentScrollTranslation.y - lastScrollTranslation.y) / self.bounds.size.height) * 120; // WHEEL_DELTA
|
||||||
LiSendHighResScrollEvent(velocityY);
|
if (translationDeltaY != 0) {
|
||||||
|
LiSendHighResScrollEvent(translationDeltaY);
|
||||||
|
lastScrollTranslation = currentScrollTranslation;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user