diff --git a/src/mousetracker.js b/src/mousetracker.js index a6a600d0..0a8c36c1 100644 --- a/src/mousetracker.js +++ b/src/mousetracker.js @@ -1400,11 +1400,20 @@ * @function */ removeContact: function() { - --this.contacts; + if ( + (this.type === "mouse" || + this.type === "pen" || + this.type === "touch") && + this.contacts > 0 + ) { + --this.contacts; - if (this.contacts < 0) { - $.console.warn('GesturePointList.removeContact() Implausible contacts value'); - this.contacts = 0; + if (this.contacts < 0) { + $.console.warn( + "GesturePointList.removeContact() Implausible contacts value" + ); + this.contacts = 0; + } } } }; @@ -2823,10 +2832,7 @@ // If child element relinquishes capture to a parent we may get here // from a pointerleave event while a pointerup event will never be received. // In that case, we'll clean up the contact count - if ( (pointsList.type === 'mouse' || pointsList.type === 'pen') && - pointsList.contacts > 0 ) { - pointsList.removeContact(); - } + pointsList.removeContact(); listLength = pointsList.removeById( gPoint.id ); } else { diff --git a/test/demo/iiif.html b/test/demo/iiif.html index 5d978df3..29ed803a 100644 --- a/test/demo/iiif.html +++ b/test/demo/iiif.html @@ -25,7 +25,7 @@ // debugMode: true, id: "contentDiv", prefixUrl: "../../build/openseadragon/images/", - tileSources: "http://wellcomelibrary.org/iiif-img/b11768265-0/a6801943-b8b4-4674-908c-7d5b27e70569/info.json", + tileSources: "https://iiif.wellcomecollection.org/image/V0021191/info.json", showNavigator:true });