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

[1.20.2] Fix mouse scroll events and scroll axis handling #239

Merged
merged 2 commits into from
Nov 3, 2023

Conversation

XFactHD
Copy link
Member

@XFactHD XFactHD commented Nov 3, 2023

This PR updates the mouse scroll events - InputEvent.MouseScrollingEvent and ScreenEvent.MouseScrolled.Pre/Post to be specific - to match the separate handling of horizontal and vertical scrolling, which was implemented by vanilla in 1.20.2, by exposing the separate deltas on the events and removing the patch that previously made scrolling on both axis work on macOS.
Also included is a change to restore the order of operations with regards to Screen#mouseScrolled() plus the associated events and Screen#afterMouseAction().

Fixes #229

@sciwhiz12 sciwhiz12 added bug A bug or error 1.20 Targeted at Minecraft 1.20 regression Worked previously but doesn't anymore enhancement New (or improvement to existing) feature or request breaking change Breaks binary compatibility labels Nov 3, 2023
Copy link
Member

@sciwhiz12 sciwhiz12 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine to me. Technically a breaking change, owing to the removal of getScrollDelta()s as replaced by the X- and Y-axis variants.

@sciwhiz12 sciwhiz12 merged commit e7329c1 into neoforged:1.20.x Nov 3, 2023
2 checks passed
@XFactHD XFactHD deleted the mouse_scroll_event branch November 3, 2023 20:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.20 Targeted at Minecraft 1.20 breaking change Breaks binary compatibility bug A bug or error enhancement New (or improvement to existing) feature or request regression Worked previously but doesn't anymore
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MouseScrollingEvent scroll delta is always positive
3 participants