Fix lost MouseButtonUp events when cursor leaves canvas (Web/WASM)#602
Open
TheRedDeveloper wants to merge 1 commit intonot-fl3:masterfrom
Open
Fix lost MouseButtonUp events when cursor leaves canvas (Web/WASM)#602TheRedDeveloper wants to merge 1 commit intonot-fl3:masterfrom
TheRedDeveloper wants to merge 1 commit intonot-fl3:masterfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.