Fix horizontal scroll direction for macOS (flutter/engine#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:
stuartmorgan
2019-05-20 17:01:29 -04:00
committed by GitHub
parent 1cf094e38b
commit 7092aaf246

View File

@@ -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);