@leafer/layouter 1.0.0-rc.12 → 1.0.0-rc.17

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 +5 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leafer/layouter",
3
- "version": "1.0.0-rc.12",
3
+ "version": "1.0.0-rc.17",
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.0.0-rc.12"
25
+ "@leafer/core": "1.0.0-rc.17"
26
26
  },
27
27
  "devDependencies": {
28
- "@leafer/interface": "1.0.0-rc.12"
28
+ "@leafer/interface": "1.0.0-rc.17"
29
29
  }
30
30
  }
package/src/Layouter.ts CHANGED
@@ -163,9 +163,11 @@ export class Layouter implements ILayouter {
163
163
  }
164
164
 
165
165
  public addExtra(leaf: ILeaf): void {
166
- const block = this.extraBlock || (this.extraBlock = new LayoutBlockData([]))
167
- block.updatedList.add(leaf)
168
- block.beforeBounds.add(leaf.__world)
166
+ if (!this.__updatedList.has(leaf)) {
167
+ const { updatedList, beforeBounds } = this.extraBlock || (this.extraBlock = new LayoutBlockData([]))
168
+ updatedList.length ? beforeBounds.add(leaf.__world) : beforeBounds.set(leaf.__world)
169
+ updatedList.add(leaf)
170
+ }
169
171
  }
170
172
 
171
173
  public createBlock(data: ILeafList | ILeaf[]): ILayoutBlockData {