Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Mouse: Recover after out of document mouseup
Browse files Browse the repository at this point in the history
Fixes gh-279
Closes gh-297
  • Loading branch information
bethge committed Jul 2, 2016
1 parent b7a47c9 commit a9d1b71
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/mouse.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,13 @@ var mouseEvents = {
},
prepareButtonsForMove: function(e, inEvent) {
var p = pointermap.get(this.POINTER_ID);
e.buttons = p ? p.buttons : 0;

// Update buttons state after possible out-of-document mouseup.
if (inEvent.which === 0 || !p) {
e.buttons = 0;
} else {
e.buttons = p.buttons;
}
inEvent.buttons = e.buttons;
},
mousedown: function(inEvent) {
Expand Down

0 comments on commit a9d1b71

Please sign in to comment.