wasm: futureproof EmscriptenMouseEvent
Future versions of emscripten will remove the timestamp, so we need to
replace this with the current timestamp
See a7f058a1e6 (diff-9a5d68085dc7db2938b37a2b7b05c1f5)
Change-Id: Ieba323ad54933626d90ac7cbae5a2c471c52628e
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
This commit is contained in:
parent
50f3ccd782
commit
c2687d1e5d
@ -544,7 +544,7 @@ void resizeWindow(QWindow *window, QWasmWindow::ResizeMode mode,
|
||||
|
||||
void QWasmEventTranslator::processMouse(int eventType, const EmscriptenMouseEvent *mouseEvent)
|
||||
{
|
||||
auto timestamp = mouseEvent->timestamp;
|
||||
auto timestamp = emscripten_date_now();
|
||||
QPoint targetPoint(mouseEvent->targetX, mouseEvent->targetY);
|
||||
QPoint globalPoint = screen()->geometry().topLeft() + targetPoint;
|
||||
|
||||
@ -670,7 +670,7 @@ int QWasmEventTranslator::wheel_cb(int eventType, const EmscriptenWheelEvent *wh
|
||||
|
||||
QWasmEventTranslator *translator = (QWasmEventTranslator*)userData;
|
||||
Qt::KeyboardModifiers modifiers = translator->translateMouseEventModifier(&mouseEvent);
|
||||
auto timestamp = mouseEvent.timestamp;
|
||||
auto timestamp = emscripten_date_now();
|
||||
QPoint targetPoint(mouseEvent.targetX, mouseEvent.targetY);
|
||||
QPoint globalPoint = eventTranslator->screen()->geometry().topLeft() + targetPoint;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user