mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Fix horizontal scroll direction for macOS (#9022)
macOS uses negative values to represent scrolls to the right, while Flutter expects the opposite, so flip X deltas.
This commit is contained in:
parent
dbf083bda1
commit
e1599ccd3f
@ -486,7 +486,7 @@ static void CommonInit(FLEViewController* controller) {
|
||||
}
|
||||
}
|
||||
double scaleFactor = self.view.layer.contentsScale;
|
||||
flutterEvent.scroll_delta_x = event.scrollingDeltaX * pixelsPerLine * scaleFactor;
|
||||
flutterEvent.scroll_delta_x = -event.scrollingDeltaX * pixelsPerLine * scaleFactor;
|
||||
flutterEvent.scroll_delta_y = -event.scrollingDeltaY * pixelsPerLine * scaleFactor;
|
||||
}
|
||||
FlutterEngineSendPointerEvent(_engine, &flutterEvent, 1);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user