1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-04 13:13:25 +03:00

0032609: Visualization, Wasm_Window - handle mouse movements outside canvas element

Wasm_Window::ProcessMouseEvent() - removed redundant check on EMSCRIPTEN_EVENT_MOUSEUP event.
ViewerTest and WebGL sample - mouse movements are now tracked on window element
to allow tracking updates when mouse with clicked button is moved outside canvas element.
This commit is contained in:
kgv
2021-10-06 23:55:43 +03:00
committed by smoskvin
parent f9ae10ed21
commit f1c209dc77
3 changed files with 72 additions and 9 deletions

View File

@@ -290,10 +290,13 @@ bool Wasm_Window::ProcessMouseEvent (Aspect_WindowInputListener& theListener,
case EMSCRIPTEN_EVENT_MOUSEDOWN:
case EMSCRIPTEN_EVENT_MOUSEUP:
{
if (aNewPos2i.x() < 0 || aNewPos2i.x() > mySize.x()
|| aNewPos2i.y() < 0 || aNewPos2i.y() > mySize.y())
if (theEventType == EMSCRIPTEN_EVENT_MOUSEDOWN)
{
return false;
if (aNewPos2i.x() < 0 || aNewPos2i.x() > mySize.x()
|| aNewPos2i.y() < 0 || aNewPos2i.y() > mySize.y())
{
return false;
}
}
if (theListener.UpdateMouseButtons (aNewPos2i, aButtons, aFlags, isEmulated))
{