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:
@@ -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))
|
||||
{
|
||||
|
Reference in New Issue
Block a user