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.
This commit is contained in:
stuartmorgan 2020-04-15 14:33:00 -07:00 committed by GitHub
parent 98412a7adc
commit 2fe73589fb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -405,7 +405,7 @@ static void CommonInit(FlutterViewController* controller) {
FlutterPointerEvent flutterEvent = {
.struct_size = sizeof(flutterEvent),
.phase = phase,
.timestamp = static_cast<size_t>(event.timestamp * NSEC_PER_MSEC),
.timestamp = static_cast<size_t>(event.timestamp * USEC_PER_SEC),
.x = locationInBackingCoordinates.x,
.y = -locationInBackingCoordinates.y, // convertPointToBacking makes this negative.
.device_kind = kFlutterPointerDeviceKindMouse,