You're Invited:Meet the Socket Team at RSAC and BSidesSF 2026, March 23–26.RSVP
Socket
Book a DemoSign in
Socket

@leafer/math

Package Overview
Dependencies
Maintainers
1
Versions
117
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.0.2
to
1.0.3
+2
-2
package.json
{
"name": "@leafer/math",
"version": "1.0.2",
"version": "1.0.3",
"description": "@leafer/math",

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

"devDependencies": {
"@leafer/interface": "1.0.2"
"@leafer/interface": "1.0.3"
}
}

@@ -26,5 +26,3 @@ import { IAround, IPointData, IBoundsData, IUnitPointData } from '@leafer/interface'

toPoint(around: IAround, bounds: IBoundsData, to?: IPointData, onlySize?: boolean, pointBounds?: IBoundsData) {
to || (to = {} as IPointData)
toPoint(around: IAround, bounds: IBoundsData, to: IPointData, onlySize?: boolean, pointBounds?: IBoundsData) {
const point = get(around)

@@ -31,0 +29,0 @@

@@ -70,7 +70,13 @@ import { IPointData, IBoundsData, IMatrixData, IRangeSize, IScaleData, ISizeData } from '@leafer/interface'

scaleData.scaleY = (typeof size === 'number' ? size : size.height) / originSize.height
} else if (scale) {
scaleData.scaleX = typeof scale === 'number' ? scale : scale.x
scaleData.scaleY = typeof scale === 'number' ? scale : scale.y
} else if (scale) MathHelper.assignScale(scaleData, scale)
return scaleData
},
assignScale(scaleData: IScaleData, scale: number | IPointData): void {
if (typeof scale === 'number') {
scaleData.scaleX = scaleData.scaleY = scale
} else {
scaleData.scaleX = scale.x
scaleData.scaleY = scale.y
}
return scaleData
}

@@ -77,0 +83,0 @@

@@ -172,3 +172,3 @@ import { INumberMap, IPoint, IPointData, IMatrixData, IBounds, IBoundsData, IMatrix, IFourNumber, ISide, IObject, IBoundsDataFn, IRadiusPointData, IMatrixWithLayoutData, IAutoBounds, IAutoBoundsData, ISizeData, IMatrixWithScaleData, ILayoutData, IUnitPointData, IAround, IAlign, IOffsetBoundsData, ITwoPointBoundsData, IRangeSize, IScaleData, IMatrixWithOptionScaleData, IScrollPointData } from '@leafer/interface';

get: typeof get;
toPoint(around: IAround, bounds: IBoundsData, to?: IPointData, onlySize?: boolean, pointBounds?: IBoundsData): void;
toPoint(around: IAround, bounds: IBoundsData, to: IPointData, onlySize?: boolean, pointBounds?: IBoundsData): void;
};

@@ -243,2 +243,3 @@ declare function get(around: IAround): IUnitPointData;

getScaleData(scale: number | IPointData, size: number | ISizeData, originSize: ISizeData, scaleData?: IScaleData): IScaleData;
assignScale(scaleData: IScaleData, scale: number | IPointData): void;
};

@@ -245,0 +246,0 @@ declare const OneRadian: number;