wasm: make setting the cursor shape work again

Commit 960af0d64 ported away from EM_ASM but also
changed the logic. Set the canvas.style.cursor property,
like it originally did.

Change-Id: Ie4b23abeae54173894bff1db000a305c459684bb
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
bb10
Morten Johan Sørvig 2019-02-21 15:29:48 +01:00
parent 3d7616a316
commit b5c16921cc
1 changed files with 2 additions and 1 deletions

View File

@ -53,7 +53,8 @@ void QWasmCursor::changeCursor(QCursor *windowCursor, QWindow *window)
htmlCursorName = "auto";
// Set cursor on the main canvas
emscripten::val::global("window").set("cursor", emscripten::val(htmlCursorName.constData()));
emscripten::val canvasStyle = emscripten::val::module_property("canvas")["style"];
canvasStyle.set("cursor", emscripten::val(htmlCursorName.constData()));
}
QByteArray QWasmCursor::cursorShapeToHtml(Qt::CursorShape shape)