3 lines
715 B
JavaScript
3 lines
715 B
JavaScript
import{createPluginContext as t,resetState as e,isDisabled as n,flow as o,isMoveOrEndOrCancel as a,getStatusName as s}from"@any-touch/shared";import{ComputeVectorForMutli as c,ComputeScale as h}from"@any-touch/compute";const i={name:"pinch",threshold:0,pointLength:2};function r(r,m){const p=t(i,m);return r.compute([c,h],(t=>{if(e(p),n(p))return;const c=function(){const{pointLength:e,scale:n,deltaScale:o,phase:a}=t;return p.pointLength===e&&p.threshold<Math.abs(n-1)}();p.state=o(c,p.state,t.phase);const{name:h}=p;if(c||a(p.state)){r.emit2(h,t,p);const{deltaScale:e}=t;1!==e&&r.emit2(h+(1<e?"in":"out"),t,p)}const i=s(p.state);i&&r.emit2(h+i,t,p)})),p}export{r as default};
|
|
//# sourceMappingURL=index.es.js.map
|