From 319d27f0c07eaea13d14750f118c649c825d03dd Mon Sep 17 00:00:00 2001 From: larissasmith Date: Fri, 16 Jun 2017 14:05:35 -0600 Subject: [PATCH 1/2] Fix image stuck to mouse when right-clicking and left-clicking simultaneously. Mouseup and mousedown events are lost when two buttons are pressed at the same time. Pressing buttons in the order left-button down, right-button down (ignored), left-button up (ignored), right-button up was leaving drag state active. --- src/mousetracker.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/mousetracker.js b/src/mousetracker.js index 3dbcf595..5887f4aa 100644 --- a/src/mousetracker.js +++ b/src/mousetracker.js @@ -2879,6 +2879,12 @@ } } + // A primary mouse button may have been released while the non-primary button was down + if (pointsList.contacts > 0 && pointsList.type === 'mouse') { + // Stop tracking the mouse + pointsList.contacts--; + return true; + } return false; } From ad206a7738ecf1016a3911df5ecc9d80dc96923b Mon Sep 17 00:00:00 2001 From: larissasmith Date: Tue, 20 Jun 2017 16:35:00 -0600 Subject: [PATCH 2/2] Add reference to github discussion on mouse tracking bug fix. --- src/mousetracker.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mousetracker.js b/src/mousetracker.js index 5887f4aa..d81f5561 100644 --- a/src/mousetracker.js +++ b/src/mousetracker.js @@ -2881,7 +2881,7 @@ // A primary mouse button may have been released while the non-primary button was down if (pointsList.contacts > 0 && pointsList.type === 'mouse') { - // Stop tracking the mouse + // Stop tracking the mouse; see https://github.com/openseadragon/openseadragon/pull/1223 pointsList.contacts--; return true; }