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

Scale relative cursor speed if client and server resolutions differ #142

Merged
merged 4 commits into from
Apr 17, 2024

Conversation

PMohanJ
Copy link
Contributor

@PMohanJ PMohanJ commented Apr 17, 2024

Reference the issue numbers and reviewers
#98 @ehfd

Explain relevant issues and how this pull request solves them
This pull request fixes the issue #98 by implementing the a scaling technique to change the cursor speeds.

Describe the changes in code and its dependencies and justify that they work as intended after testing
The changes revolve around detecting if client and server are having different resolutions, if so, we'd introduce the cursorScalingFactor which is then be used to scale the relative cursor speeds by multiplying the relative cursor position (x and y values) with the scalingFactor before sending to server. Thus based on the scaling factor the speed could either increase or decrease to provide smooth user experience.

Describe alternatives you've considered
NA

Additional context
The code includes a check if the client resolution is the range of delta 10, this is done due to the reason that sometimes the video and window resolution doesn't match quite exactly.
Screenshot from 2024-04-17 17-07-47

  • I confirm that this pull request is relevant to the scope of this project. If you know that upstream projects are the cause of this problem, please file the pull request there.
  • I confirm that this pull request has been tested thoroughly and to the best of my knowledge that additional unintended problems do not arise.
  • I confirm that the style of the changed code conforms to the overall style of the project.
  • I confirm that I have read other open and closed pull requests and that duplicates do not exist.
  • I confirm that I have justified the need for this pull request and that the changes reflect the fix for the specified problem.
  • I confirm that no portion of this pull request contains credentials or other private information, and it is my own responsibility to protect my privacy.

@ehfd ehfd self-requested a review April 17, 2024 14:29
@ehfd ehfd merged commit 61186a2 into selkies-project:main Apr 17, 2024
11 checks passed
@ehfd ehfd deleted the cursors branch April 17, 2024 15:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants