-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Mouse wheel delta adjustments #7968
Conversation
For testing, one way is to create a test .cpp file that prints out the different scroll values, and create a test in Reading how the test_interactive.py script builds the test page also helps one with instructions to repro a build of the page manually, e.g. if one wants to test the behavior across different browsers/devices. |
Interactive tests sound perfect for this! I'll look into it. |
Okay, I have added a sanity check to the existing SDL mouse wheel test.
This test also prints the received delta values, so testers should be able to tell if the values look reasonable. The test succeeded for both Chrome and Firefox. |
ping @juj - this looks good to me, did you want to take another look? Thanks @Owlinated! |
Looks good. It would be good to add a note in the Changelog, since this will disrupt everyone who is currently using SDL with scrolling. This does not preserve the scale in any scenario, but always rescales to a different coordinate scale than before, so everyone who is using SDL 1 will need to update their code to rescale to the new heuristics. I am fine with this landing, though mostly since this is in library_browser.js, which is a bit of legacy/compatibility layer at this point, so I want to lean towards making development easier for anyone using it. For contrast, this would not be good behavior for HTML5 API mouse scrolling. SDL2 uses the HTML5 API, so it will be unaffected by this PR. lgtm! |
Hmm, can you double check the edit to ChangeLog? Perhaps this was based on older revision of incoming, since this is now saying a conflict against |
@juj Done :) |
Thanks! Though sorry, looks like Alon landed something else to incoming just tonight, so the file is in conflict again. Apologies for that, can you resolve once again? |
@juj Sure thing! |
Alright, thanks! |
Description
Right now the mouse wheel delta is not scaled properly. See #6283 for a discussion of this issue.
This pull request handles all event types and modes separately. All units are converted into steps, i.e. wheel notches.
Testing
Unfortunately I don't know how to automatically test this behavior.
I have manually tested this on Windows 10 with Chrome, Firefox, Edge, and IE11.
You can use the following snippet to test this in isolation: