@leafer/math
Advanced tools
+2
-2
| { | ||
| "name": "@leafer/math", | ||
| "version": "1.0.0-rc.21", | ||
| "version": "1.0.0-rc.22", | ||
| "description": "@leafer/math", | ||
@@ -25,4 +25,4 @@ "author": "Chao (Leafer) Wan", | ||
| "devDependencies": { | ||
| "@leafer/interface": "1.0.0-rc.21" | ||
| "@leafer/interface": "1.0.0-rc.22" | ||
| } | ||
| } |
@@ -25,3 +25,3 @@ import { IAround, IPointData, IBoundsData } from '@leafer/interface' | ||
| toPoint(around: IAround, bounds: IBoundsData, to?: IPointData, onlySize?: boolean) { | ||
| toPoint(around: IAround, bounds: IBoundsData, to?: IPointData, onlySize?: boolean, pointBounds?: IBoundsData) { | ||
| to || (to = {} as IPointData) | ||
@@ -33,2 +33,9 @@ | ||
| if (pointBounds) { | ||
| to.x -= pointBounds.x | ||
| to.y -= pointBounds.y | ||
| if (point.x) to.x -= (point.x === 1) ? pointBounds.width : (point.x === 0.5 ? point.x * pointBounds.width : 0) | ||
| if (point.y) to.y -= (point.y === 1) ? pointBounds.height : (point.y === 0.5 ? point.y * pointBounds.height : 0) | ||
| } | ||
| if (!onlySize) { | ||
@@ -35,0 +42,0 @@ to.x += bounds.x |
+1
-1
@@ -171,3 +171,3 @@ import { INumberMap, IPoint, IPointData, IMatrixData, IBounds, IBoundsData, IMatrix, IFourNumber, IObject, IBoundsDataFn, IRadiusPointData, IMatrixWithLayoutData, IAutoBounds, IAutoBoundsData, ISizeData, IMatrixWithScaleData, ILayoutData, IAround, IOffsetBoundsData, ITwoPointBoundsData, IMatrixWithOptionScaleData, IScaleData } from '@leafer/interface'; | ||
| get: typeof get; | ||
| toPoint(around: IAround, bounds: IBoundsData, to?: IPointData, onlySize?: boolean): void; | ||
| toPoint(around: IAround, bounds: IBoundsData, to?: IPointData, onlySize?: boolean, pointBounds?: IBoundsData): void; | ||
| }; | ||
@@ -174,0 +174,0 @@ declare function get(around: IAround): IPointData; |
62284
0.66%1506
0.4%