Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix broken scrolling behavior on iPad. #609

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions Limelight/Input/StreamView.m
Original file line number Diff line number Diff line change
Expand Up @@ -699,26 +699,25 @@ - (void)mouseWheelMovedContinuous:(UIPanGestureRecognizer *)gesture {
case UIGestureRecognizerStateEnded:
default:
// Ignore recognition failure and other states
lastScrollTranslation = CGPointMake(0, 0);
lastScrollTranslation = CGPointZero;
return;
}

CGPoint currentScrollTranslation = [gesture translationInView:self];

{
short translationDeltaY = ((currentScrollTranslation.y - lastScrollTranslation.y) / self.bounds.size.height) * 120; // WHEEL_DELTA
short translationDeltaY = (short)(currentScrollTranslation.y - lastScrollTranslation.y); // WHEEL_DELTA
if (translationDeltaY != 0) {
LiSendHighResScrollEvent(translationDeltaY * 20);
lastScrollTranslation = currentScrollTranslation;
lastScrollTranslation.y += translationDeltaY;
}
}

{
short translationDeltaX = ((currentScrollTranslation.x - lastScrollTranslation.x) / self.bounds.size.width) * 120; // WHEEL_DELTA
short translationDeltaX = (short)(currentScrollTranslation.x - lastScrollTranslation.x); // WHEEL_DELTA
if (translationDeltaX != 0) {
// Direction is reversed from vertical scrolling
LiSendHighResHScrollEvent(-translationDeltaX * 20);
lastScrollTranslation = currentScrollTranslation;
lastScrollTranslation.x += translationDeltaX;
}
}
}
Expand Down