@leafer/layouter 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.
Files changed (2) hide show
  1. package/package.json +3 -3
  2. package/src/Layouter.ts +8 -10
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leafer/layouter",
3
- "version": "1.6.2",
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.2"
25
+ "@leafer/core": "1.6.3"
26
26
  },
27
27
  "devDependencies": {
28
- "@leafer/interface": "1.6.2"
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
- BranchHelper.updateBounds(target)
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_(LayoutEvent.REQUEST, this.layout, this),
193
- target.on_(LayoutEvent.AGAIN, this.layoutAgain, this),
194
- target.on_(WatchEvent.DATA, this.__onReceiveWatchData, this)
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