mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 06:57:45 +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
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
|
- (void)scrollWheel:(NSEvent*)event
|
||||||
{
|
{
|
||||||
auto [position, screen_position, button, modifiers] = Ladybird::ns_event_to_mouse_event(event, self, GUI::MouseButton::Middle);
|
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];
|
CGFloat delta_y = -[event scrollingDeltaY];
|
||||||
if (![event hasPreciseScrollingDeltas]) {
|
if (![event hasPreciseScrollingDeltas]) {
|
||||||
delta_x *= [self scrollView].horizontalLineScroll;
|
delta_x *= [self scrollView].horizontalLineScroll;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue