@leafer/math
Advanced tools
+3
-3
| { | ||
| "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 @@ |
+1
-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; |
72414
0.2%1710
0.23%