Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@hscmap/inertial-wheel

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hscmap/inertial-wheel - npm Package Compare versions

Comparing version 0.6.2 to 0.6.3

1

lib/inertial_wheel.d.ts

@@ -18,2 +18,3 @@ import { Physics } from "./physics";

wheel: (e: WheelEvent) => void;
normalize: number;
private tick();

@@ -20,0 +21,0 @@ }

5

lib/inertial_wheel.js

@@ -21,2 +21,3 @@ "use strict";

};
this.normalize = 60 / 1000;
if (cb.setNextTick == undefined)

@@ -34,5 +35,5 @@ cb.setNextTick = defaultSetNextTick();

var _this = this;
var _a = this.physics.tick(performance.now()), v = _a.v, wheelstart = _a.wheelstart, wheelend = _a.wheelend;
var _a = this.physics.tick(performance.now()), v = _a.v, dt = _a.dt, wheelstart = _a.wheelstart, wheelend = _a.wheelend;
wheelstart && this.cb.wheelstart && this.cb.wheelstart(new InertialWheelStartEvent());
this.cb.wheel && this.cb.wheel(new InertialWheelEvent(v, this.lastNativeEvent));
this.cb.wheel && this.cb.wheel(new InertialWheelEvent(this.normalize * dt * v, this.lastNativeEvent));
wheelend && this.cb.wheelend && this.cb.wheelend(new InertialWheelEndEvent());

@@ -39,0 +40,0 @@ wheelend || this.cb.setNextTick(function () { return _this.tick(); });

@@ -20,2 +20,3 @@ export declare class Physics {

v: number;
dt: number;
wheelstart: boolean;

@@ -22,0 +23,0 @@ wheelend: boolean;

@@ -32,3 +32,4 @@ "use strict";

this.a = 0;
var DT = t - this.t;
var dt0 = t - this.t;
var DT = dt0;
while (DT > 0) {

@@ -46,2 +47,3 @@ var dt = Math.min(DT, this.maxDT);

v: this.v,
dt: Math.min(1000, dt0),
wheelstart: !moving0,

@@ -48,0 +50,0 @@ wheelend: !this.moving

{
"name": "@hscmap/inertial-wheel",
"version": "0.6.2",
"version": "0.6.3",
"main": "./lib/index.js",

@@ -5,0 +5,0 @@ "types": "./lib/index.d.ts",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc