@leafer/layout 1.6.2 → 1.6.3
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 +5 -5
- package/src/LeafLayout.ts +6 -5
- package/types/index.d.ts +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leafer/layout",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.3",
|
|
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.6.
|
|
26
|
-
"@leafer/helper": "1.6.
|
|
27
|
-
"@leafer/platform": "1.6.
|
|
25
|
+
"@leafer/math": "1.6.3",
|
|
26
|
+
"@leafer/helper": "1.6.3",
|
|
27
|
+
"@leafer/platform": "1.6.3"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@leafer/interface": "1.6.
|
|
30
|
+
"@leafer/interface": "1.6.3"
|
|
31
31
|
}
|
|
32
32
|
}
|
package/src/LeafLayout.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { LeafHelper } from '@leafer/helper'
|
|
|
4
4
|
import { Platform } from '@leafer/platform'
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
const { getRelativeWorld } = LeafHelper
|
|
7
|
+
const { getRelativeWorld, updateBounds } = LeafHelper
|
|
8
8
|
const { toOuterOf, getPoints, copy } = BoundsHelper
|
|
9
9
|
const localContent = '_localContentBounds'
|
|
10
10
|
const worldContent = '_worldContentBounds', worldBox = '_worldBoxBounds', worldStroke = '_worldStrokeBounds'
|
|
@@ -52,7 +52,7 @@ export class LeafLayout implements ILeafLayout {
|
|
|
52
52
|
|
|
53
53
|
// state
|
|
54
54
|
|
|
55
|
-
public resized:
|
|
55
|
+
public resized: 'scale' | 'inner' | 'local'
|
|
56
56
|
public waitAutoLayout: boolean
|
|
57
57
|
|
|
58
58
|
// matrix changed
|
|
@@ -118,12 +118,13 @@ export class LeafLayout implements ILeafLayout {
|
|
|
118
118
|
}
|
|
119
119
|
|
|
120
120
|
public update(): void {
|
|
121
|
-
const { leafer } =
|
|
121
|
+
const { leaf } = this, { leafer } = leaf
|
|
122
|
+
if (leaf.isApp) return updateBounds(leaf)
|
|
122
123
|
if (leafer) {
|
|
123
124
|
if (leafer.ready) leafer.watcher.changed && leafer.layouter.layout()
|
|
124
125
|
else leafer.start()
|
|
125
126
|
} else {
|
|
126
|
-
let root =
|
|
127
|
+
let root = leaf
|
|
127
128
|
while (root.parent && !root.parent.leafer) { root = root.parent }
|
|
128
129
|
const r = root as any
|
|
129
130
|
if (r.__fullLayouting) return // fix: 循环
|
|
@@ -371,7 +372,7 @@ export class LeafLayout implements ILeafLayout {
|
|
|
371
372
|
|
|
372
373
|
public childrenSortChange(): void {
|
|
373
374
|
if (!this.childrenSortChanged) {
|
|
374
|
-
this.childrenSortChanged = true
|
|
375
|
+
this.childrenSortChanged = this.affectChildrenSort = true
|
|
375
376
|
this.leaf.forceUpdate('surface')
|
|
376
377
|
}
|
|
377
378
|
}
|
package/types/index.d.ts
CHANGED
|
@@ -24,7 +24,7 @@ declare class LeafLayout implements ILeafLayout {
|
|
|
24
24
|
protected _worldContentBounds: IBoundsData;
|
|
25
25
|
protected _worldBoxBounds: IBoundsData;
|
|
26
26
|
protected _worldStrokeBounds: IBoundsData;
|
|
27
|
-
resized:
|
|
27
|
+
resized: 'scale' | 'inner' | 'local';
|
|
28
28
|
waitAutoLayout: boolean;
|
|
29
29
|
matrixChanged: boolean;
|
|
30
30
|
scaleChanged: boolean;
|