@leafer/layouter 1.6.1 → 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 +3 -3
- package/src/Layouter.ts +8 -10
- package/src/LayouterHelper.ts +2 -8
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leafer/layouter",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.3",
|
|
4
4
|
"description": "@leafer/layouter",
|
|
5
5
|
"author": "Chao (Leafer) Wan",
|
|
6
6
|
"license": "MIT",
|
|
@@ -22,9 +22,9 @@
|
|
|
22
22
|
"leaferjs"
|
|
23
23
|
],
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@leafer/core": "1.6.
|
|
25
|
+
"@leafer/core": "1.6.3"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"@leafer/interface": "1.6.
|
|
28
|
+
"@leafer/interface": "1.6.3"
|
|
29
29
|
}
|
|
30
30
|
}
|
package/src/Layouter.ts
CHANGED
|
@@ -52,7 +52,7 @@ export class Layouter implements ILayouter {
|
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
public layout(): void {
|
|
55
|
-
if (!this.running) return
|
|
55
|
+
if (this.layouting || !this.running) return
|
|
56
56
|
const { target } = this
|
|
57
57
|
this.times = 0
|
|
58
58
|
|
|
@@ -153,11 +153,8 @@ export class Layouter implements ILayouter {
|
|
|
153
153
|
static fullLayout(target: ILeaf): void {
|
|
154
154
|
updateAllMatrix(target, true)
|
|
155
155
|
|
|
156
|
-
if (target.isBranch)
|
|
157
|
-
|
|
158
|
-
} else {
|
|
159
|
-
LeafHelper.updateBounds(target)
|
|
160
|
-
}
|
|
156
|
+
if (target.isBranch) BranchHelper.updateBounds(target)
|
|
157
|
+
else LeafHelper.updateBounds(target)
|
|
161
158
|
|
|
162
159
|
updateAllChange(target)
|
|
163
160
|
}
|
|
@@ -187,11 +184,12 @@ export class Layouter implements ILayouter {
|
|
|
187
184
|
}
|
|
188
185
|
|
|
189
186
|
protected __listenEvents(): void {
|
|
190
|
-
const { target } = this
|
|
191
187
|
this.__eventIds = [
|
|
192
|
-
target.on_(
|
|
193
|
-
|
|
194
|
-
|
|
188
|
+
this.target.on_([
|
|
189
|
+
[LayoutEvent.REQUEST, this.layout, this],
|
|
190
|
+
[LayoutEvent.AGAIN, this.layoutAgain, this],
|
|
191
|
+
[WatchEvent.DATA, this.__onReceiveWatchData, this]
|
|
192
|
+
])
|
|
195
193
|
]
|
|
196
194
|
}
|
|
197
195
|
|
package/src/LayouterHelper.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { ILeafLayout, ILeafLevelList, ILeafList, ILeaf } from '@leafer/interface
|
|
|
2
2
|
import { BranchHelper, LeafHelper } from '@leafer/core'
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
const { updateAllMatrix, updateBounds: updateOneBounds,
|
|
5
|
+
const { updateAllMatrix, updateBounds: updateOneBounds, updateChange: updateOneChange } = LeafHelper
|
|
6
6
|
const { pushAllChildBranch, pushAllParent } = BranchHelper
|
|
7
7
|
|
|
8
8
|
|
|
@@ -56,11 +56,5 @@ export function updateBounds(boundsList: ILeafLevelList): void {
|
|
|
56
56
|
|
|
57
57
|
|
|
58
58
|
export function updateChange(updateList: ILeafList): void {
|
|
59
|
-
|
|
60
|
-
updateList.list.forEach(leaf => {
|
|
61
|
-
layout = leaf.__layout
|
|
62
|
-
if (layout.opacityChanged) updateAllWorldOpacity(leaf)
|
|
63
|
-
if (layout.stateStyleChanged) setTimeout(() => layout.stateStyleChanged && leaf.updateState())
|
|
64
|
-
leaf.__updateChange()
|
|
65
|
-
})
|
|
59
|
+
updateList.list.forEach(updateOneChange)
|
|
66
60
|
}
|