mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 23:50:19 +00:00
Ladybird/AppKit: Invert the horizontal delta scroll value
This matches the negation of the vertical scroll delta value. This makes the scroll events behave as follows on macOS: Natural scrolling enabled: * Scrolling up on the trackpad scrolls down on the page. * Scrolling right on the trackpad scrolls left on the page. Natural scrolling disabled: * Scrolling up on the trackpad scrolls up on the page. * Scrolling right on the trackpad scrolls right on the page.
This commit is contained in:
parent
754ecc56dd
commit
fb1845f294
Notes:
sideshowbarker
2024-07-17 07:14:09 +09:00
Author: https://github.com/trflynn89 Commit: https://github.com/SerenityOS/serenity/commit/fb1845f294 Pull-request: https://github.com/SerenityOS/serenity/pull/22042 Issue: https://github.com/SerenityOS/serenity/issues/21749
1 changed files with 1 additions and 1 deletions
|
@ -1099,7 +1099,7 @@ static void copy_data_to_clipboard(StringView data, NSPasteboardType pasteboard_
|
|||
- (void)scrollWheel:(NSEvent*)event
|
||||
{
|
||||
auto [position, screen_position, button, modifiers] = Ladybird::ns_event_to_mouse_event(event, self, GUI::MouseButton::Middle);
|
||||
CGFloat delta_x = [event scrollingDeltaX];
|
||||
CGFloat delta_x = -[event scrollingDeltaX];
|
||||
CGFloat delta_y = -[event scrollingDeltaY];
|
||||
if (![event hasPreciseScrollingDeltas]) {
|
||||
delta_x *= [self scrollView].horizontalLineScroll;
|
||||
|
|
Loading…
Reference in a new issue