From 2fe73589fb67334e5f57464a23ceccfd222e60ce Mon Sep 17 00:00:00 2001 From: stuartmorgan Date: Wed, 15 Apr 2020 14:33:00 -0700 Subject: [PATCH] Use the right constant for macOS event timestamps (#17713) The NSEvent->Flutter event conversion code for pointer events was multiplying seconds by nanoseconds per milliseconds. While this does end up giving the right number of microseconds, it's a very confusing way to write it. --- .../darwin/macos/framework/Source/FlutterViewController.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shell/platform/darwin/macos/framework/Source/FlutterViewController.mm b/shell/platform/darwin/macos/framework/Source/FlutterViewController.mm index e9c26be8e0b..4813ab8fe22 100644 --- a/shell/platform/darwin/macos/framework/Source/FlutterViewController.mm +++ b/shell/platform/darwin/macos/framework/Source/FlutterViewController.mm @@ -405,7 +405,7 @@ static void CommonInit(FlutterViewController* controller) { FlutterPointerEvent flutterEvent = { .struct_size = sizeof(flutterEvent), .phase = phase, - .timestamp = static_cast(event.timestamp * NSEC_PER_MSEC), + .timestamp = static_cast(event.timestamp * USEC_PER_SEC), .x = locationInBackingCoordinates.x, .y = -locationInBackingCoordinates.y, // convertPointToBacking makes this negative. .device_kind = kFlutterPointerDeviceKindMouse,