mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
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:
parent
98412a7adc
commit
2fe73589fb
@ -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,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user