From e1599ccd3f89943a11c89ac8a31cc7d3edd72073 Mon Sep 17 00:00:00 2001 From: stuartmorgan Date: Mon, 20 May 2019 17:01:29 -0400 Subject: [PATCH] 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. --- .../platform/darwin/macos/framework/Source/FLEViewController.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shell/platform/darwin/macos/framework/Source/FLEViewController.mm b/shell/platform/darwin/macos/framework/Source/FLEViewController.mm index dd7f9379f58..b061f2369ff 100644 --- a/shell/platform/darwin/macos/framework/Source/FLEViewController.mm +++ b/shell/platform/darwin/macos/framework/Source/FLEViewController.mm @@ -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);