SP4 Controls: Prevent horizontal scroll wheel events from throwing exceptions#2600
Merged
swharden merged 5 commits intoScottPlot:mainfrom May 14, 2023
Merged
Conversation
Member
|
Hi @bclehmann, thanks for reporting this! It took me a while to get to this (I was sick for a few weeks) but I am happy to resume work on it now. Related to this PR, @szescxz found that the same exception may be thrown in the WPF control (#2626). I'll modify this PR by editing the backend to allow a fix for all controls then merge it today |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose:
Fixes an issue reported by Svetlana in the discord. This appears to only affect the v4 Avalonia control.
Before this change an attempt to scroll horizontally would reach this line:
ScottPlot/src/ScottPlot4/ScottPlot/Control/Backend.cs
Lines 731 to 732 in 521bbcf
This is fixed by simply ignoring horizontal scroll inputs (which I believe is what we implicitly do on other platforms). In principle we could also treat horizontal inputs as if they were vertical, which may be preferable on MacOS when the shift key is pressed (and in my opinion at no other time): AvaloniaUI/Avalonia#8628 (comment)