@hscmap/magic-trackpad-detector
Advanced tools
Comparing version 0.0.5 to 0.0.6
{ | ||
"extends": "../src/tsconfig", | ||
"compilerOptions": { | ||
"noUnusedLocals": true | ||
"noUnusedLocals": true, | ||
"declaration": false | ||
} | ||
} |
{ | ||
"name": "@hscmap/magic-trackpad-detector", | ||
"version": "0.0.5", | ||
"version": "0.0.6", | ||
"main": "./lib/index.js", | ||
@@ -5,0 +5,0 @@ "types": "./lib/index.d.ts", |
export class MagicTrackpadDetector { | ||
tolerance = 5 // ms | ||
interval = 1000 / 60 // events per second | ||
minN1 = 5 | ||
@@ -21,8 +19,7 @@ minN2 = 15 | ||
const n = h.at(-i + 1) | ||
// const dt = n[0] - o[0] | ||
// if (dt < this.interval - this.tolerance) | ||
// return false | ||
if (n[1] * o[1] < 0 || n[1] / o[1] > 1) | ||
return false | ||
} | ||
if (h.at(-1)[1] == h.at(-this.minN1 + 1)[1]) | ||
return false | ||
} | ||
@@ -40,5 +37,2 @@ else { // |deltaY| == 1 | ||
const n = h.at(-i + 1) | ||
// const dt = n[0] - o[0] | ||
// if (dt < this.interval - this.tolerance) | ||
// return false | ||
if (n[1] * o[1] < 0 || n[1] / o[1] > 1) | ||
@@ -45,0 +39,0 @@ return false |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
287331
4776
13
1