@leafer/helper
Advanced tools
+5
-5
| { | ||
| "name": "@leafer/helper", | ||
| "version": "1.9.1", | ||
| "version": "1.9.2", | ||
| "description": "@leafer/helper", | ||
@@ -25,9 +25,9 @@ "author": "Chao (Leafer) Wan", | ||
| "dependencies": { | ||
| "@leafer/data": "1.9.1", | ||
| "@leafer/math": "1.9.1", | ||
| "@leafer/platform": "1.9.1" | ||
| "@leafer/data": "1.9.2", | ||
| "@leafer/math": "1.9.2", | ||
| "@leafer/platform": "1.9.2" | ||
| }, | ||
| "devDependencies": { | ||
| "@leafer/interface": "1.9.1" | ||
| "@leafer/interface": "1.9.2" | ||
| } | ||
| } |
+20
-7
@@ -97,3 +97,3 @@ import { IAlign, ILeaf, IMatrixData, IPointData, IAxis, ITransition, ILeaferCanvas, IBoundsData, IMatrixWithBoundsData } from '@leafer/interface' | ||
| const local = isObject(x) ? { ...x } : { x, y } | ||
| isInnerPoint ? toOuterPoint(t.localTransform, local, local, true) : (t.parent && toInnerPoint(t.parent.worldTransform, local, local, true)) | ||
| isInnerPoint ? toOuterPoint(t.localTransform, local, local, true) : (t.parent && toInnerPoint(t.parent.scrollWorldTransform, local, local, true)) | ||
| L.moveLocal(t, local.x, local.y, transition) | ||
@@ -122,3 +122,3 @@ }, | ||
| scaleOfOuter(matrix, origin, scaleX, scaleY) | ||
| if (t.origin || t.around) { | ||
| if (L.hasHighPosition(t)) { | ||
| L.setTransform(t, matrix, resize, transition) | ||
@@ -140,3 +140,3 @@ } else { | ||
| rotateOfOuter(matrix, origin, angle) | ||
| if (t.origin || t.around) L.setTransform(t, matrix, false, transition) | ||
| if (L.hasHighPosition(t)) L.setTransform(t, matrix, false, transition) | ||
| else t.set({ x: t.x + matrix.e - o.e, y: t.y + matrix.f - o.f, rotation: MathHelper.formatRotation(t.rotation + angle) }, transition) | ||
@@ -158,3 +158,3 @@ }, | ||
| multiplyParent(matrix, transform) | ||
| if (t.parent) divideParent(matrix, t.parent.worldTransform) | ||
| if (t.parent) divideParent(matrix, t.parent.scrollWorldTransform) | ||
| L.setTransform(t, matrix, resize, transition) | ||
@@ -172,2 +172,8 @@ }, | ||
| const layout = getLayout(transform, originPoint, data.around && L.getInnerOrigin(t, data.around)) | ||
| if (L.hasOffset(t)) { | ||
| layout.x -= data.offsetX | ||
| layout.y -= data.offsetY | ||
| } | ||
| if (resize) { | ||
@@ -208,3 +214,3 @@ const scaleX = layout.scaleX / t.scaleX, scaleY = layout.scaleY / t.scaleY | ||
| copy(matrix, t.worldTransform) | ||
| divideParent(matrix, relative.worldTransform) | ||
| divideParent(matrix, relative.scrollWorldTransform) | ||
| return temp ? matrix : { ...matrix } | ||
@@ -218,2 +224,10 @@ }, | ||
| hasHighPosition(t: ILeaf): boolean { | ||
| return (t.origin || t.around || L.hasOffset(t)) as unknown as boolean | ||
| }, | ||
| hasOffset(t: ILeaf): boolean { | ||
| return (t.offsetX || t.offsetY) as unknown as boolean | ||
| }, | ||
| hasParent(p: ILeaf, parent: ILeaf): boolean | void { | ||
@@ -247,4 +261,3 @@ if (!parent) return false | ||
| function getTempLocal(t: ILeaf, world: IPointData): IPointData { | ||
| t.__layout.update() | ||
| return t.parent ? PointHelper.tempToInnerOf(world, t.parent.__world) : world | ||
| return t.parent ? PointHelper.tempToInnerOf(world, t.parent.scrollWorldTransform) : world | ||
| } |
+2
-0
@@ -29,2 +29,4 @@ import { ILeaf, ILeaferCanvas, IBoundsData, IPointData, ITransition, IMatrixData, IAxis, IAlign, IRenderOptions, ILeafList, ILeafLevelList, IFunction } from '@leafer/interface'; | ||
| drop(t: ILeaf, parent: ILeaf, index?: number, resize?: boolean): void; | ||
| hasHighPosition(t: ILeaf): boolean; | ||
| hasOffset(t: ILeaf): boolean; | ||
| hasParent(p: ILeaf, parent: ILeaf): boolean | void; | ||
@@ -31,0 +33,0 @@ animateMove(t: ILeaf, move: IPointData, speed?: number): void; |
20790
2.11%380
2.98%+ Added
+ Added
+ Added
+ Added
- Removed
- Removed
- Removed
- Removed
Updated
Updated
Updated