wasm: fix screen offset logic

Change-Id: Id71dfcba5d0bc1fe660a478db5f4c57e68468b4b
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
This commit is contained in:
Lorn Potter 2021-03-05 10:19:10 +10:00
parent ec716dc1fd
commit f677f62943

View File

@ -209,8 +209,8 @@ void QWasmScreen::updateQScreenAndCanvasRenderSize()
m_canvas.set("height", canvasSize.height());
QPoint offset;
offset.setX(m_canvas["offsetTop"].as<int>());
offset.setY(m_canvas["offsetLeft"].as<int>());
offset.setX(m_canvas["offsetLeft"].as<int>());
offset.setY(m_canvas["offsetTop"].as<int>());
emscripten::val rect = m_canvas.call<emscripten::val>("getBoundingClientRect");
QPoint position(rect["left"].as<int>() - offset.x(), rect["top"].as<int>() - offset.y());