Latest Threat Research:SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains.Details
Socket
Book a DemoInstallSign in
Socket

@leafer/math

Package Overview
Dependencies
Maintainers
1
Versions
116
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@leafer/math - npm Package Compare versions

Comparing version
1.9.12
to
1.10.0
+3
-3
package.json
{
"name": "@leafer/math",
"version": "1.9.12",
"version": "1.10.0",
"description": "@leafer/math",

@@ -25,5 +25,5 @@ "author": "Chao (Leafer) Wan",

"devDependencies": {
"@leafer/interface": "1.9.12",
"@leafer/data": "1.9.12"
"@leafer/interface": "1.10.0",
"@leafer/data": "1.10.0"
}
}

@@ -125,9 +125,9 @@ import { IPointData, IBoundsData, IMatrixData, IFourNumber, IBoundsDataFn, IObject, IMatrix, IOffsetBoundsData, IRadiusPointData, IMatrixWithScaleData, ISide, IAlign, ISizeData, IScrollPointData } from '@leafer/interface'

const { a, d } = matrix
const { a, d, e, f } = matrix
if (a > 0) {
to.width = t.width * a
to.x = matrix.e + t.x * a
to.x = e + t.x * a
} else {
to.width = t.width * -a
to.x = matrix.e + t.x * a - to.width
to.x = e + t.x * a - to.width
}

@@ -137,6 +137,6 @@

to.height = t.height * d
to.y = matrix.f + t.y * d
to.y = f + t.y * d
} else {
to.height = t.height * -d
to.y = matrix.f + t.y * d - to.height
to.y = f + t.y * d - to.height
}

@@ -143,0 +143,0 @@

@@ -6,3 +6,3 @@ import { IPointData, IBoundsData, IMatrixData, IRangeSize, IScaleData, ISizeData, IOptionSizeData } from '@leafer/interface'

const { round, pow, PI } = Math
const { round, pow, max, floor, PI } = Math

@@ -69,2 +69,6 @@ export const MathHelper = {

getFloorScale(num: number, min = 1): number {
return max(floor(num), min) / num
},
randInt,

@@ -71,0 +75,0 @@

@@ -253,2 +253,3 @@ import * as _leafer_interface from '@leafer/interface';

assignScale(scaleData: IScaleData, scale: number | IPointData): void;
getFloorScale(num: number, min?: number): number;
randInt: typeof randInt;

@@ -255,0 +256,0 @@ randColor(opacity?: number): string;