@hscmap/inertial-wheel
Advanced tools
Comparing version 0.5.0 to 0.5.1
@@ -22,2 +22,3 @@ export interface Callbacks { | ||
t2: number; | ||
baseInterval: number; | ||
constructor(target: HTMLElement, cb: Callbacks); | ||
@@ -24,0 +25,0 @@ teardown(): void; |
@@ -18,2 +18,3 @@ "use strict"; | ||
this.t2 = defaults.t2; | ||
this.baseInterval = 1000 / 60; | ||
this.magicTrackpadDetector = new magic_trackpad_detector_1.MagicTrackpadDetector(); | ||
@@ -67,3 +68,3 @@ this.wheel = function (e) { | ||
this.v = clamp(this.v, -1, 1); | ||
this.cb.wheel && this.cb.wheel(new InertialWheelEvent(this.v, this.lastNativeEvent)); | ||
this.cb.wheel && this.cb.wheel(new InertialWheelEvent(dt / this.baseInterval * this.v, this.lastNativeEvent)); | ||
this.lastT = now; | ||
@@ -70,0 +71,0 @@ }; |
{ | ||
"name": "@hscmap/inertial-wheel", | ||
"version": "0.5.0", | ||
"version": "0.5.1", | ||
"main": "./lib/index.js", | ||
@@ -5,0 +5,0 @@ "types": "./lib/index.d.ts", |
@@ -28,2 +28,3 @@ import { MagicTrackpadDetector } from "@hscmap/magic-trackpad-detector" | ||
t2 = defaults.t2 | ||
baseInterval = 1000 / 60 | ||
@@ -93,3 +94,3 @@ constructor(readonly target: HTMLElement, private cb: Callbacks) { | ||
this.v = clamp(this.v, -1, 1) | ||
this.cb.wheel && this.cb.wheel(new InertialWheelEvent(this.v, this.lastNativeEvent)) | ||
this.cb.wheel && this.cb.wheel(new InertialWheelEvent(dt / this.baseInterval * this.v, this.lastNativeEvent)) | ||
@@ -96,0 +97,0 @@ this.lastT = now |
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
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
16568
335