-
Notifications
You must be signed in to change notification settings - Fork 8
/
fingers.min.js
9 lines (7 loc) · 20.6 KB
/
fingers.min.js
1
2
3
4
5
6
7
8
9
/*! Fingers.js - v1.0.5 - 2014-09-03
* https://github.com/paztis/fingers.js
*
* Copyright (c) 2014 Jérôme HENAFF <[email protected]>;
* Licensed under the MIT license */
!function(a,b){"use strict";var c=function v(a){return new v.Instance(a)};c.__extend=function(a){return Array.prototype.slice.call(arguments,1).forEach(function(b){if(b)for(var c in b)a[c]=b[c]}),a};var d={DIRECTION:{UP:"up",DOWN:"down",LEFT:"left",RIGHT:"right"},GROW:{IN:"in",OUT:"out"},getVelocity:function(a,b){return Math.abs(b/a)||0},getOrientedVelocity:function(a,b){return b/a||0},getAngle:function(a,b){return Math.atan2(a,b)},getDirection:function(a,b){return Math.abs(a)>=Math.abs(b)?a>0?this.DIRECTION.RIGHT:this.DIRECTION.LEFT:b>0?this.DIRECTION.DOWN:this.DIRECTION.UP},isVertical:function(a){return a===this.DIRECTION.UP||a===this.DIRECTION.DOWN},getDistance:function(a,b){return Math.sqrt(a*a+b*b)}};c.Utils=d;var e=function(){this._cache=[]};e.prototype={_cache:null,isCachedValue:function(a){return this._cache[a]!==b},getCachedValue:function(a){return this._cache[a]},setCachedValue:function(a,b){this._cache[a]=b},clearCachedValue:function(a){delete this._cache[a]},clearCache:function(){this._cache.length=0},getCachedValueOrUpdate:function(a,c,d){var e=this.getCachedValue(a);return e===b&&(e=c.call(d),this.setCachedValue(a,e)),e}},c.CacheArray=e;var f=function(a){this._init(a)};f.HAS_TOUCHEVENTS="ontouchstart"in a,f.IS_MOBILE=/mobile|tablet|ip(ad|hone|od)|android|silk/i.test(navigator.userAgent),f.LISTEN_TOUCH_EVENTS=f.HAS_TOUCHEVENTS&&f.IS_MOBILE,f.FINGER_MAP={},f.prototype={element:null,fingerList:null,fingerCreatedMap:null,gestureList:null,_init:function(a){this.element=a,this.fingerList=[],this.fingerCreatedMap={},this.gestureList=[],this.startListening()},getElement:function(){return this.element},getGestures:function(){return this.gestureList},addGesture:function(a,b){var c=new a(b);return this.gestureList.push(c),c},removeGesture:function(a){a.removeAllHandlers();var b=this.gestureList.indexOf(a);this.gestureList.splice(b,1)},removeAllGestures:function(){for(var a=0,b=this.gestureList.length;b>a;a++)this.gestureList[a].removeAllHandlers();this.gestureList.length=0},startListening:function(){if(null===this._stopListeningF){var a=this;if(f.LISTEN_TOUCH_EVENTS){var b=this._onTouchStart.bind(this),c=this._onTouchMove.bind(this),d=this._onTouchEnd.bind(this),e=this._onTouchCancel.bind(this);this.element.addEventListener("touchstart",b),this.element.addEventListener("touchmove",c),this.element.addEventListener("touchend",d),this.element.addEventListener("touchcancel",e),this._stopListeningF=function(){a.element.removeEventListener("touchstart",b),a.element.removeEventListener("touchmove",c),a.element.removeEventListener("touchend",d),a.element.removeEventListener("touchcancel",e)}}else{this._onMouseMoveF=this._onMouseMove.bind(this),this._onMouseUpF=this._onMouseUp.bind(this);var g=this._onMouseDown.bind(this);this.element.addEventListener("mousedown",g),this._stopListeningF=function(){a.element.removeEventListener("mousedown",g),document.removeEventListener("mousemove",this._onMouseMoveF),document.removeEventListener("mouseup",this._onMouseUpF)}}}},_stopListeningF:null,stopListening:function(){null!==this._stopListeningF&&(this._removeAllFingers(Date.now()),this._stopListeningF(),this._stopListeningF=null)},_onTouchStart:function(a){for(var b,c=0,d=a.changedTouches.length;d>c;c++)b=a.changedTouches[c],this._createFinger(b.identifier,a.timeStamp,b.pageX,b.pageY)},_onTouchMove:function(a){for(var b,c=0,d=a.changedTouches.length;d>c;c++)b=a.changedTouches[c],this._updateFingerPosition(b.identifier,a.timeStamp,b.pageX,b.pageY);a.preventDefault()},_onTouchEnd:function(a){for(var b=0,c=a.changedTouches.length;c>b;b++)this._removeFinger(a.changedTouches[b].identifier,a.timeStamp)},_onTouchCancel:function(a){for(var c,d=0,e=a.changedTouches.length;e>d;d++)if(c=f.FINGER_MAP[a.changedTouches[d].identifier],c!==b&&-1!==this._getFingerPosition(c)){this._removeAllFingers(a.timeStamp);break}},_onMouseDown:function(a){if(0===a.button){var c=f.FINGER_MAP[a.button];(c===b||-1===this._getFingerPosition(c))&&(document.addEventListener("mousemove",this._onMouseMoveF),document.addEventListener("mouseup",this._onMouseUpF),this._createFinger(a.button,a.timeStamp,a.pageX,a.pageY),a.preventDefault())}},_onMouseMoveF:null,_onMouseMove:function(a){0===a.button&&this._updateFingerPosition(a.button,a.timeStamp,a.pageX,a.pageY)},_onMouseUpF:null,_onMouseUp:function(a){document.removeEventListener("mousemove",this._onMouseMoveF),document.removeEventListener("mouseup",this._onMouseUpF),this._removeFinger(0,a.timeStamp)},_createFinger:function(a,c,d,e){var h;f.FINGER_MAP[a]===b?(h=new g(a,c,d,e),f.FINGER_MAP[a]=h,this.fingerCreatedMap[a]=h):h=f.FINGER_MAP[a],this.fingerList.push(h),h.nbListeningInstances++;for(var i=0,j=this.gestureList.length;j>i;i++)this.gestureList[i]._onFingerAdded(h,this.fingerList)},_removeFinger:function(a,c){var d=f.FINGER_MAP[a];d!==b&&(this.fingerList.splice(this._getFingerPosition(d),1),delete this.fingerCreatedMap[d.id],d.nbListeningInstances--,0===d.nbListeningInstances&&(d._setEndP(c),delete f.FINGER_MAP[d.id],d._clearHandlerObjects()))},_removeAllFingers:function(a){for(var b=this.fingerList.splice(0),c=0,d=b.length;d>c;c++)this._removeFinger(b[c].id,a)},_updateFingerPosition:function(a,c,d,e){var f=this.fingerCreatedMap[a];f!==b&&f._setCurrentP(c,d,e)},_getFingerPosition:function(a){return this.fingerList.indexOf(a)}},c.Instance=f;var g=function(a,b,c,d){this.id=a,this.state=g.STATE.ACTIVE,this._handlerList=[],this.startP=new i(b,c,d),this.previousP=new i(b,c,d),this.currentP=new i(b,c,d),this._cacheArray=new e},h=0;g.cacheIndexes={deltaTime:h++,totalTime:h++,deltaX:h++,deltaY:h++,deltaDistance:h++,totalX:h++,totalY:h++,totalDistance:h++,deltaDirection:h++,totalDirection:h++,velocityX:h++,velocityY:h++,velocity:h++,velocityAverage:h++,orientedVelocityX:h++,orientedVelocityY:h++},g.STATE={ACTIVE:"active",REMOVED:"removed"},g.CONSTANTS={inactivityTime:100},g.prototype={id:null,state:null,startP:null,previousP:null,currentP:null,nbListeningInstances:0,_cacheArray:null,_handlerList:null,_handlerListSize:0,_addHandlerObject:function(a){this._handlerList.push(a),this._handlerListSize=this._handlerList.length},_removeHandlerObject:function(a){var b=this._handlerList.indexOf(a);this._handlerList.splice(b,1),this._handlerListSize=this._handlerList.length},_clearHandlerObjects:function(){this._handlerList.length=0,this._handlerListSize=0},_setCurrentP:function(a,b,c,d){if(this.getX()!=b||this.getY()!=c||d){this._cacheArray.clearCache(),this.previousP.copy(this.currentP),this.currentP.set(a,b,c);for(var e=0;e<this._handlerListSize;e++)this._handlerList[e]._onFingerUpdate(this)}},_setEndP:function(a){a-this.getTime()>g.CONSTANTS.inactivityTime&&this._setCurrentP(a,this.getX(),this.getY(),!0),this.state=g.STATE.REMOVED;for(var b=this._handlerList.slice(0),c=0;c<b.length;c++)b[c]._onFingerRemoved(this)},getTime:function(){return this.currentP.timestamp},getDeltaTime:function(){return this._cacheArray.getCachedValueOrUpdate(g.cacheIndexes.deltaTime,this._getDeltaTime,this)},_getDeltaTime:function(){return this.currentP.timestamp-this.previousP.timestamp},getTotalTime:function(){return this._cacheArray.getCachedValueOrUpdate(g.cacheIndexes.totalTime,this._getTotalTime,this)},_getTotalTime:function(){return this.currentP.timestamp-this.startP.timestamp},getInactivityTime:function(){var a=Date.now()-this.currentP.timestamp;return a>g.CONSTANTS.inactivityTime?a:0},getX:function(){return this.currentP.x},getY:function(){return this.currentP.y},getDeltaX:function(){return this._cacheArray.getCachedValueOrUpdate(g.cacheIndexes.deltaX,this._getDeltaX,this)},_getDeltaX:function(){return this.currentP.x-this.previousP.x},getDeltaY:function(){return this._cacheArray.getCachedValueOrUpdate(g.cacheIndexes.deltaY,this._getDeltaY,this)},_getDeltaY:function(){return this.currentP.y-this.previousP.y},getDeltaDistance:function(){return this._cacheArray.getCachedValueOrUpdate(g.cacheIndexes.deltaDistance,this._getDeltaDistance,this)},_getDeltaDistance:function(){return d.getDistance(this.getDeltaX(),this.getDeltaY())},getTotalX:function(){return this._cacheArray.getCachedValueOrUpdate(g.cacheIndexes.totalX,this._getTotalX,this)},_getTotalX:function(){return this.currentP.x-this.startP.x},getTotalY:function(){return this._cacheArray.getCachedValueOrUpdate(g.cacheIndexes.totalY,this._getTotalY,this)},_getTotalY:function(){return this.currentP.y-this.startP.y},getDistance:function(){return this._cacheArray.getCachedValueOrUpdate(g.cacheIndexes.totalDistance,this._getDistance,this)},_getDistance:function(){return d.getDistance(this.getTotalX(),this.getTotalY())},getDeltaDirection:function(){return this._cacheArray.getCachedValueOrUpdate(g.cacheIndexes.deltaDirection,this._getDeltaDirection,this)},_getDeltaDirection:function(){return d.getDirection(this.getDeltaX(),this.getDeltaY())},getDirection:function(){return this._cacheArray.getCachedValueOrUpdate(g.cacheIndexes.totalDirection,this._getDirection,this)},_getDirection:function(){return d.getDirection(this.getTotalX(),this.getTotalY())},getVelocityX:function(){return this._cacheArray.getCachedValueOrUpdate(g.cacheIndexes.velocityX,this._getVelocityX,this)},_getVelocityX:function(){return d.getVelocity(this.getDeltaTime(),this.getDeltaX())},getVelocityY:function(){return this._cacheArray.getCachedValueOrUpdate(g.cacheIndexes.velocityY,this._getVelocityY,this)},_getVelocityY:function(){return d.getVelocity(this.getDeltaTime(),this.getDeltaY())},getVelocity:function(){return this._cacheArray.getCachedValueOrUpdate(g.cacheIndexes.velocity,this._getVelocity,this)},_getVelocity:function(){return d.getVelocity(this.getDeltaTime(),this.getDeltaDistance())},getVelocityAverage:function(){return this._cacheArray.getCachedValueOrUpdate(g.cacheIndexes.velocityAverage,this._getVelocity,this)},_getVelocityAverage:function(){return d.getVelocity(this.getTotalTime(),this.getDistance())},getOrientedVelocityX:function(){return this._cacheArray.getCachedValueOrUpdate(g.cacheIndexes.orientedVelocityX,this._getOrientedVelocityX,this)},_getOrientedVelocityX:function(){return d.getOrientedVelocity(this.getDeltaTime(),this.getDeltaX())},getOrientedVelocityY:function(){return this._cacheArray.getCachedValueOrUpdate(g.cacheIndexes.orientedVelocityY,this._getOrientedVelocityY,this)},_getOrientedVelocityY:function(){return d.getOrientedVelocity(this.getDeltaTime(),this.getDeltaY())}},c.Finger=g;var i=function(a,b,c){this.set(a,b,c)};i.prototype={timestamp:null,x:null,y:null,set:function(a,b,c){this.timestamp=a,this.x=b,this.y=c},copy:function(a){this.timestamp=a.timestamp,this.x=a.x,this.y=a.y}},c.Position=i;var j={getFingersAngle:function(a,b){return d.getAngle(b.currentP.x-a.currentP.x,b.currentP.y-a.currentP.y)},getFingersDistance:function(a,b){return d.getDistance(b.currentP.x-a.currentP.x,b.currentP.y-a.currentP.y)},getFingersCenter:function(a,b){return{x:Math.round((a.currentP.x+b.currentP.x)/2),y:Math.round((a.currentP.y+b.currentP.y)/2)}},getMultipleFingersCenter:function(){for(var a={x:0,y:0},b=arguments.length,c=0;b>c;c++)a.x+=arguments[c].currentP.x,a.y+=arguments[c].currentP.y;return a.x=Math.round(a.x/b),a.y=Math.round(a.y/b),a}};c.FingerUtils=j;var k=function(a,b){this.options=c.__extend({},b||{},a||{}),this._handlerList=[],this.listenedFingers=[]};k.EVENT_TYPE={instant:"instant",start:"start",end:"end",move:"move"},k.prototype={options:null,_handlerList:null,_handlerListSize:0,isListening:!1,listenedFingers:null,addHandler:function(a){return this._handlerList.push(a),this._handlerListSize++,this},removeHandler:function(a){var b=this._handlerList.indexOf(a);return this._handlerList.splice(b,1),this._handlerListSize--,this},removeAllHandlers:function(){return this._handlerList.length=0,this._handlerListSize=0,this},fire:function(a,b){for(var c=0;c<this._handlerListSize;c++)this._handlerList[c](a,b,this.listenedFingers)},_onFingerAdded:function(){},_onFingerUpdate:function(){},_onFingerRemoved:function(){},_addListenedFingers:function(){for(var a=0,b=arguments.length;b>a;a++)this._addListenedFinger(arguments[a])},_addListenedFinger:function(a){this.listenedFingers.push(a),a._addHandlerObject(this),this.isListening||(this.isListening=!0)},_removeListenedFingers:function(){for(var a=0,b=arguments.length;b>a;a++)this._removeListenedFinger(arguments[a])},_removeListenedFinger:function(a){a._removeHandlerObject(this);var b=this.listenedFingers.indexOf(a);this.listenedFingers.splice(b,1),0===this.listenedFingers.length&&(this.isListening=!1)},_removeAllListenedFingers:function(){for(var a,b=0,c=this.listenedFingers.length;c>b;b++)a=this.listenedFingers[b],a._removeHandlerObject(this);this.listenedFingers.length=0,this.isListening=!1},isListenedFinger:function(a){return this.isListening&&this.getListenedPosition(a)>-1},getListenedPosition:function(a){return this.listenedFingers.indexOf(a)}},c.Gesture=k,c.gesture={};var l=function(a){function b(b){a.call(this,b)}return c.__extend(b.prototype,a.prototype,{_onFingerAdded:function(b){this.isListening||(this._addListenedFinger(b),this.fire(a.EVENT_TYPE.start,null))},_onFingerUpdate:function(){this.fire(a.EVENT_TYPE.move,null)},_onFingerRemoved:function(){this.fire(a.EVENT_TYPE.end,null),this._removeAllListenedFingers()}}),b}(c.Gesture);c.gesture.Drag=l;var m=function(a){function b(b){a.call(this,b,d),this._onHoldTimeLeftF=this._onHoldTimeLeft.bind(this)}var d={nbFingers:1,disanceThreshold:10,duration:500};return c.__extend(b.prototype,a.prototype,{timer:null,_onFingerAdded:function(a,b){if(!this.isListening&&b.length>=this.options.nbFingers){for(var c=0;c<this.options.nbFingers;c++)this._addListenedFinger(b[c]);clearTimeout(this.timer),this.timer=setTimeout(this._onHoldTimeLeftF,this.options.duration)}},_onFingerUpdate:function(){for(var a=this.listenedFingers.length,b=0;a>b;b++)if(this.listenedFingers[b].getDistance()>this.options.disanceThreshold){this._onHoldCancel();break}},_onFingerRemoved:function(){this._onHoldCancel()},_onHoldTimeLeftF:null,_onHoldTimeLeft:function(){this.fire(a.EVENT_TYPE.instant,null)},_onHoldCancel:function(){clearTimeout(this.timer),this._removeAllListenedFingers()}}),b}(c.Gesture);c.gesture.Hold=m;var n=function(a){function b(b){a.call(this,b,e),this.data={grow:null,scale:1}}var e={pinchInDetect:.6,pinchOutDetect:1.4};return c.__extend(b.prototype,a.prototype,{_startDistance:0,data:null,_onFingerAdded:function(a,b){!this.isListening&&b.length>=2&&(this._addListenedFingers(b[0],b[1]),this._startDistance=this._getFingersDistance())},_onFingerUpdate:function(){},_onFingerRemoved:function(){var b=this._getFingersDistance(),c=b/this._startDistance;(c<=this.options.pinchInDetect||c>=this.options.pinchOutDetect)&&(this.data.grow=c>1?d.GROW.OUT:d.GROW.IN,this.data.scale=c,this.fire(a.EVENT_TYPE.instant,this.data)),this._removeAllListenedFingers()},_getFingersDistance:function(){var a=this.listenedFingers[0].currentP,b=this.listenedFingers[1].currentP;return c.Utils.getDistance(b.x-a.x,b.y-a.y)}}),b}(c.Gesture);c.gesture.Pinch=n;var o=function(a){function b(b){a.call(this,b,d)}var d={nbMaxFingers:Number.MAX_VALUE};return c.__extend(b.prototype,a.prototype,{_onFingerAdded:function(b){this.listenedFingers.length<this.options.nbMaxFingers&&(this._addListenedFinger(b),this.fire(a.EVENT_TYPE.start,b))},_onFingerUpdate:function(b){this.fire(a.EVENT_TYPE.move,b)},_onFingerRemoved:function(b){this.fire(a.EVENT_TYPE.end,b),this._removeListenedFinger(b)}}),b}(c.Gesture);c.gesture.Raw=o;var p=function(a){function b(b){a.call(this,b,d),this.data={direction:null,velocity:0}}var d={nbFingers:1,swipeVelocityX:.6,swipeVelocityY:.6};return c.__extend(b.prototype,a.prototype,{data:null,_onFingerAdded:function(a,b){if(!this.isListening&&b.length>=this.options.nbFingers)for(var c=0;c<this.options.nbFingers;c++)this._addListenedFinger(b[c])},_onFingerUpdate:function(){},_onFingerRemoved:function(){for(var b=!0,c=this.listenedFingers[0].getDeltaDirection(),d=0,e=0,f=this.listenedFingers.length,g=0;f>g;g++)b=b&&c===this.listenedFingers[g].getDeltaDirection(),d=Math.max(d,this.listenedFingers[g].getVelocityX()),e=Math.max(e,this.listenedFingers[g].getVelocityY());b&&(d>this.options.swipeVelocityX||e>this.options.swipeVelocityY)&&(this.data.direction=c,this.data.velocity=d>this.options.swipeVelocityX?d:e,this.fire(a.EVENT_TYPE.instant,this.data)),this._removeAllListenedFingers()}}),b}(c.Gesture);c.gesture.Swipe=p;var q=function(a){function b(b){a.call(this,b,d),this.data={nbTap:0,lastTapTimestamp:0}}var d={nbFingers:1,nbTapMin:0,nbTapMax:Number.MAX_VALUE,tapInterval:400,maxDistanceMoving:Number.MAX_VALUE};return c.__extend(b.prototype,a.prototype,{data:null,_onFingerAdded:function(a,b){if(!this.isListening&&b.length>=this.options.nbFingers){a.getTime()-this.data.lastTapTimestamp>this.options.tapInterval&&this._clearTap();for(var c=0;c<this.options.nbFingers;c++)this._addListenedFinger(b[c])}},_onFingerUpdate:function(){},_onFingerRemoved:function(b){this._removeAllListenedFingers(),b.getTotalTime()<this.options.tapInterval&&b.getDistance()<this.options.maxDistanceMoving&&(this.data.lastTapTimestamp=b.getTime(),this.data.nbTap++,this.data.nbTap>=this.options.nbTapMin&&this.data.nbTap<=this.options.nbTapMax&&this.fire(a.EVENT_TYPE.instant,this.data))},_clearTap:function(){this.data.lastTapTimestamp=0,this.data.nbTap=0}}),b}(c.Gesture);c.gesture.Tap=q;var r=function(a){function b(b){a.call(this,b,d),this.data={totalRotation:0,deltaRotation:0,totalScale:1,deltaScale:1}}var d={rotation:!0,scale:!0};return c.__extend(b.prototype,a.prototype,{_startAngle:0,_lastAngle:0,_startDistance:0,_lastDistance:0,data:null,_onFingerAdded:function(b,c){!this.isListening&&c.length>=2&&(this._addListenedFingers(c[0],c[1]),this.options.rotation&&(this._lastAngle=this._getFingersAngle(),this._startAngle=this._lastAngle,this.data.totalRotation=0,this.data.deltaRotation=0),this.options.scale&&(this._lastDistance=this._getFingersDistance(),this._startDistance=this._lastDistance,this.data.totalScale=1,this.data.deltaScale=1),this.fire(a.EVENT_TYPE.start,this.data))},_onFingerUpdate:function(){if(this.options.rotation){var b=this._getFingersAngle();this.data.totalRotation=this._startAngle-b,this.data.deltaRotation=this._lastAngle-b,this._lastAngle=b}if(this.options.scale){var c=this._getFingersDistance();this.data.totalScale=c/this._startDistance,this.data.deltaScale=c/this._lastDistance,this._lastDistance=c}this.fire(a.EVENT_TYPE.move,this.data)},_onFingerRemoved:function(){this.fire(a.EVENT_TYPE.end,this.data),this._removeAllListenedFingers()},_getFingersAngle:function(){return c.FingerUtils.getFingersAngle(this.listenedFingers[0],this.listenedFingers[1])},_getFingersDistance:function(){return c.FingerUtils.getFingersDistance(this.listenedFingers[0],this.listenedFingers[1])}}),b}(c.Gesture);c.gesture.Transform=r;var s=function(a){function b(b){b=b||{},b.rotation=!0,b.scale=!1,a.call(this,b)}return c.__extend(b.prototype,a.prototype),b}(r);c.gesture.Rotate=s;var t=function(a){function b(b){b=b||{},b.rotation=!1,b.scale=!0,a.call(this,b)}return c.__extend(b.prototype,a.prototype),b}(r);c.gesture.Scale=t;var u=function(a){function d(b){a.call(this,b,e),this._zoneList=[],this._zoneMap={}}var e={};return d.TYPE={enter:"enter",leave:"leave"},d.LAST_ZONE_ID=0,c.__extend(d.prototype,a.prototype,{_zoneList:null,_zoneMap:null,_zoneSize:0,_onFingerAdded:function(a){if(0===this.listenedFingers.length){this._addListenedFinger(a);for(var b=0;b<this._zoneSize;b++)this._checkZone(this._zoneList[b],a)}},_onFingerUpdate:function(a){for(var b=0;b<this._zoneSize;b++)this._checkZone(this._zoneList[b],a)},_onFingerRemoved:function(a){for(var b,c=0;c<this._zoneSize;c++)b=this._zoneList[c],this._zoneMap[b.id]===!0&&this._fireLeaveZone(b);this._removeListenedFinger(a)},addZone:function(a){return-1===this._zoneList.indexOf(a)&&(a.id===b&&(a.id=d.LAST_ZONE_ID++),this._zoneList.push(a),this._zoneMap[a.id]=!1,this._zoneSize++),this},removeZone:function(a){var b=this._zoneList.indexOf(a);return-1!==b&&(this._zoneList.splice(b,1),delete this._zoneMap[a.id],this._zoneSize--),this},getHoveredZones:function(){for(var a,b=[],c=0;c<this._zoneSize;c++)a=this._zoneList[c],this._zoneMap[a.id]===!0&&b.push(a);return b},_checkZone:function(a,b){var c=this._isInZone(a,b.getX(),b.getY());this._zoneMap[a.id]===!1&&c?(this._zoneMap[a.id]=!0,this._fireEnterZone(a)):this._zoneMap[a.id]!==!0||c||(this._zoneMap[a.id]=!1,this._fireLeaveZone(a))},_fireEnterZone:function(b){this.fire(a.EVENT_TYPE.instant,{type:d.TYPE.enter,zone:b})},_fireLeaveZone:function(b){this.fire(a.EVENT_TYPE.instant,{type:d.TYPE.leave,zone:b})},_isInZone:function(a,b,c){return b>=a.left&&b<=a.right&&c>=a.top&&c<=a.bottom}}),d}(c.Gesture);c.gesture.ZoneHover=u,"function"==typeof define&&define.amd?define(function(){return c}):"undefined"!=typeof module&&module.exports?module.exports=c:a.Fingers=c}(window);
//# sourceMappingURL=fingers.min.map