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

@hscmap/inertial-mouse

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hscmap/inertial-mouse - npm Package Compare versions

Comparing version 2.0.1 to 2.1.0

1

lib/index.d.ts

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

slick: boolean;
minV: number;
private anchor;

@@ -22,0 +23,0 @@ private r;

7

lib/index.js

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

this.slick = true;
this.minV = 0.5;
this.lastT = 0;

@@ -99,5 +100,5 @@ this.mousePressed = false;

InertialMouse.prototype.moving = function () {
var minPixel = 1;
var minV = this.minV = 1;
if (this.mousePressed || !this.slick) {
return Math.abs(this.anchor.x - this.r.x) > minPixel || Math.abs(this.anchor.y - this.r.y) > minPixel;
return Math.abs(this.anchor.x - this.r.x) > minV || Math.abs(this.anchor.y - this.r.y) > minV;
}

@@ -107,3 +108,3 @@ else {

var f = this.friction;
return Math.abs(v.x / f) >= minPixel || Math.abs(v.y / f) >= minPixel;
return Math.abs(v.x / f) >= minV || Math.abs(v.y / f) >= minV;
}

@@ -110,0 +111,0 @@ };

{
"name": "@hscmap/inertial-mouse",
"version": "2.0.1",
"version": "2.1.0",
"main": "./lib/index.js",

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

@@ -20,2 +20,3 @@ export class Coord {

slick = true
minV = 0.5

@@ -122,5 +123,5 @@ private anchor: Coord

private moving() {
const minPixel = 1
const minV = this.minV = 1
if (this.mousePressed || !this.slick) {
return Math.abs(this.anchor.x - this.r.x) > minPixel || Math.abs(this.anchor.y - this.r.y) > minPixel
return Math.abs(this.anchor.x - this.r.x) > minV || Math.abs(this.anchor.y - this.r.y) > minV
}

@@ -130,3 +131,3 @@ else {

const f = this.friction
return Math.abs(v.x / f) >= minPixel || Math.abs(v.y / f) >= minPixel
return Math.abs(v.x / f) >= minV || Math.abs(v.y / f) >= minV
}

@@ -133,0 +134,0 @@ }

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