Repository navigation
Open
TheRedDeveloper wants to merge 1 commit into
8000
…ot-fl3#698, not-fl3#602 (#1) * Integrate upstream PRs not-fl3#701, not-fl3#698, not-fl3#602: js/gl.js * ci: add targeted Rust WebAssembly and JS build checks * ci: allow generating Cargo.lock for library builds
Problem:
In the WASM target, the mouse event listener for
mouseupwas attached directly to thecanvaselement (canvas.onmouseup).If a user clicks inside the canvas, drags the mouse outside the canvas boundaries, and then releases the button, the
canvaselement does not receive the event. This causes the application to miss theMouseButtonUpevent and think the mouse is still held down.Solution:
Changed the event binding in
gl.jsto listen formouseupon the globalwindowobject instead of thecanvas. This ensures the release event is caught regardless of where the cursor is (on and off the page).Yes, this is the same issue as the one in the PR on macroquad, except this one is a web issue.
Hope this can get merged soon.