Skip to content

Conversation

noobiept
Copy link
Contributor

Fixing this issue: #551

By setting the id with the mouse button, it will end up with a separate object for each button. Before the same object would be reused regardless of what mouse button was pressed.

Test I used:

// ...
circle.addEventListener('pressup', function(event)
    {
    console.log(event.type, event.nativeEvent.which);
    });
circle.addEventListener('mousedown', function(event)
    {
    console.log(event.type, event.nativeEvent.which);
    });
stage.addEventListener('stagemouseup', function(event)
    {
    console.log(event.type, event.nativeEvent.which);
    });
// ...

Press the mouse button and the middle mouse button at same time, then release them.
Before this patch you get:

mousedown 1
mousedown 2
stagemouseup 2
pressup 2

After:

mousedown 1
mousedown 2
stagemouseup 2
pressup 2
stagemouseup 1
pressup 1

@noobiept
Copy link
Contributor Author

New test:

circle.addEventListener('pressup', function(event)
    {
    console.log(event.type, event.nativeEvent.which, event.pointerID);
    });
// etc

Result after patch:

mousedown 1 -1
mousedown 2 -2
stagemouseup 2 -2
pressup 2 -2
pressmove 1 -1
stagemouseup 1 -1
pressup 1 -1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant