From 73dc6895f152fd167d8245ef30d27f7f41d12895 Mon Sep 17 00:00:00 2001 From: Mark Salsbery <> Date: Tue, 9 Feb 2021 16:28:42 -0800 Subject: [PATCH] Removed commented legacy fix code (#1872) --- src/mousetracker.js | 103 -------------------------------------------- src/viewer.js | 7 --- 2 files changed, 110 deletions(-) diff --git a/src/mousetracker.js b/src/mousetracker.js index 01469a65..f5863bf1 100644 --- a/src/mousetracker.js +++ b/src/mousetracker.js @@ -349,27 +349,6 @@ return this; }, - // //TODO Revisit this if there's still an issue. The PointerEvent model should have no problems - // // like the issue this code attempts to fix. - // /** - // * Returns the {@link OpenSeadragon.MouseTracker.GesturePointList|GesturePointList} for all but the given pointer device type. - // * @function - // * @param {String} type - The pointer device type: "mouse", "touch", "pen", etc. - // * @returns {Array.} - // */ - // getActivePointersListsExceptType: function ( type ) { - // var delegate = THIS[ this.hash ]; - // var listArray = []; - - // for (var i = 0; i < delegate.activePointersLists.length; ++i) { - // if (delegate.activePointersLists[i].type !== type) { - // listArray.push(delegate.activePointersLists[i]); - // } - // } - - // return listArray; - // }, - /** * Returns the {@link OpenSeadragon.MouseTracker.GesturePointList|GesturePointList} for the given pointer device type, * creating and caching a new {@link OpenSeadragon.MouseTracker.GesturePointList|GesturePointList} if one doesn't already exist for the type. @@ -1065,24 +1044,6 @@ } } - //TODO Revisit this if there's still an issue. The PointerEvent model should have no problems - // like the issue this code attempts to fix. - // /** - // * Resets all active mousetrakers. (Added to patch issue #697 "Mouse up outside map will cause "canvas-drag" event to stick") - // * - // * @private - // * @member resetAllMouseTrackers - // * @memberof OpenSeadragon.MouseTracker - // */ - // $.MouseTracker.resetAllMouseTrackers = function(){ - // for(var i = 0; i < MOUSETRACKERS.length; i++){ - // if (MOUSETRACKERS[i].isTracking()){ - // MOUSETRACKERS[i].setTracking(false); - // MOUSETRACKERS[i].setTracking(true); - // } - // } - // }; - /** * Provides continuous computation of velocity (speed and direction) of active pointers. * This is a singleton, used by all MouseTracker instances, as it is unlikely there will ever be more than @@ -2529,36 +2490,6 @@ } - //TODO Revisit this if there's still an issue. The PointerEvent model should have no problems - // like the issue this code attempts to fix. - // /** - // * @private - // * @inner - // */ - // function abortContacts( tracker, event, pointsList ) { - // var i, - // gPointCount = pointsList.getLength(), - // abortGPoints = []; - - // // Check contact count for hoverable pointer types before aborting - // if (pointsList.type === 'touch' || pointsList.contacts > 0) { - // for ( i = 0; i < gPointCount; i++ ) { - // abortGPoints.push( pointsList.getByIndex( i ) ); - // } - - // if ( abortGPoints.length > 0 ) { - // // simulate touchend/mouseup - // updatePointerUp( tracker, eventInfo, , 0 ); // 0 means primary button press/release or touch contact - // // release pointer capture - // pointsList.captureCount = 1; - // //releasePointer( tracker, pointsList.type ); - // // simulate touchleave/mouseout - // updatePointerLeave( tracker, eventInfo, ); - // } - // } - // } - - /** * @private * @inner @@ -2574,12 +2505,6 @@ //$.console.log('touchstart ' + (tracker.userData ? tracker.userData.toString() : '')); - //TODO Revisit this if there's still an issue. The PointerEvent model should have no problems - // like the issue this code attempts to fix. - // if ( pointsList.getLength() > event.touches.length - touchCount ) { - // $.console.warn('Tracked touch contact count doesn\'t match event.touches.length. Removing all tracked touch pointers.'); - // abortContacts( tracker, event, pointsList ); - // } if ( pointsList.getLength() > event.touches.length - touchCount ) { $.console.warn('Tracked touch contact count doesn\'t match event.touches.length'); } @@ -3678,16 +3603,6 @@ } } - //TODO Revisit this if there's still an issue. The PointerEvent model should have no problems - // like the issue this code attempts to fix. - // // Some pointers may steal control from another pointer without firing the appropriate release events - // // e.g. Touching a screen while click-dragging with certain mice. - // var otherPointsLists = tracker.getActivePointersListsExceptType(gPoint.type); - // for (i = 0; i < otherPointsLists.length; i++) { - // //If another pointer has contact, simulate the release - // abortContacts(tracker, event, otherPointsLists[i]); // No-op if no active pointer - // } - // Only capture and track primary button, pen, and touch contacts if ( buttonChanged !== 0 ) { eventInfo.shouldCapture = false; @@ -3880,27 +3795,9 @@ ); } - //TODO Revisit this if there's still an issue. The PointerEvent model should have no problems - // like the issue this code attempts to fix. - // // A primary mouse button may have been released while the non-primary button was down - // var otherPointsList = tracker.getActivePointersListByType("mouse"); - // // Stop tracking the mouse; see https://github.com/openseadragon/openseadragon/pull/1223 - // abortContacts(tracker, event, otherPointsList); // No-op if no active pointer - return; } - //TODO Revisit this if there's still an issue. The PointerEvent model should have no problems - // like the issue this code attempts to fix. - // GitHub PR: https://github.com/openseadragon/openseadragon/pull/1754 - // // OS-specific gestures (e.g. swipe up with four fingers in iPadOS 13) - // if (typeof gPoint.currentPos === "undefined") { - // $.console.log('typeof gPoint.currentPos === "undefined" ' + (tracker.userData ? tracker.userData.toString() : '')); - // abortContacts(tracker, event, pointsList); - - // return false; - // } - updateGPoint = pointsList.getById( gPoint.id ); if ( updateGPoint ) { diff --git a/src/viewer.js b/src/viewer.js index 1eb6f45e..dfb80a1c 100644 --- a/src/viewer.js +++ b/src/viewer.js @@ -2956,13 +2956,6 @@ function onCanvasEnter( event ) { } function onCanvasLeave( event ) { - - //TODO Revisit this if there's still an issue. The PointerEvent model should have no problems - // like the issue this code attempts to fix. - // if (window.location !== window.parent.location){ - // $.MouseTracker.resetAllMouseTrackers(); - // } - /** * Raised when a pointer leaves the {@link OpenSeadragon.Viewer#canvas} element. *