@leafer/layout 1.0.3 → 1.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leafer/layout",
3
- "version": "1.0.3",
3
+ "version": "1.0.5",
4
4
  "description": "@leafer/layout",
5
5
  "author": "Chao (Leafer) Wan",
6
6
  "license": "MIT",
@@ -22,11 +22,11 @@
22
22
  "leaferjs"
23
23
  ],
24
24
  "dependencies": {
25
- "@leafer/math": "1.0.3",
26
- "@leafer/helper": "1.0.3",
27
- "@leafer/platform": "1.0.3"
25
+ "@leafer/math": "1.0.5",
26
+ "@leafer/helper": "1.0.5",
27
+ "@leafer/platform": "1.0.5"
28
28
  },
29
29
  "devDependencies": {
30
- "@leafer/interface": "1.0.3"
30
+ "@leafer/interface": "1.0.5"
31
31
  }
32
32
  }
package/src/LeafLayout.ts CHANGED
@@ -203,7 +203,7 @@ export class LeafLayout implements ILeafLayout {
203
203
 
204
204
  public getLayoutBounds(type?: IBoundsType, relative: ILocationType | ILeaf = 'world', unscale?: boolean): ILayoutBoundsData {
205
205
  const { leaf } = this
206
- let point: IPointData, matrix: IMatrixData, bounds: IBoundsData = this.getInnerBounds(type)
206
+ let point: IPointData, matrix: IMatrixData, layoutBounds: ILayoutBoundsData, bounds: IBoundsData = this.getInnerBounds(type)
207
207
 
208
208
  switch (relative) {
209
209
  case 'world':
@@ -211,8 +211,9 @@ export class LeafLayout implements ILeafLayout {
211
211
  matrix = leaf.__world
212
212
  break
213
213
  case 'local':
214
+ const { scaleX, scaleY, rotation, skewX, skewY } = leaf.__
215
+ layoutBounds = { scaleX, scaleY, rotation, skewX, skewY } as ILayoutBoundsData // 更精准,务必保留
214
216
  point = leaf.getLocalPointByInner(bounds)
215
- matrix = leaf.__localMatrix
216
217
  break
217
218
  case 'inner':
218
219
  point = bounds
@@ -225,7 +226,7 @@ export class LeafLayout implements ILeafLayout {
225
226
  matrix = getRelativeWorld(leaf, relative, true)
226
227
  }
227
228
 
228
- const layoutBounds = MatrixHelper.getLayout(matrix) as ILayoutBoundsData
229
+ if (!layoutBounds) layoutBounds = MatrixHelper.getLayout(matrix) as ILayoutBoundsData
229
230
  copy(layoutBounds, bounds)
230
231
  PointHelper.copy(layoutBounds, point)
231
232