@leafer/renderer 2.0.0 → 2.0.2
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/Renderer.ts +4 -3
- package/types/index.d.ts +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leafer/renderer",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.2",
|
|
4
4
|
"description": "@leafer/renderer",
|
|
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": "2.0.
|
|
25
|
+
"@leafer/core": "2.0.2"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"@leafer/interface": "2.0.
|
|
28
|
+
"@leafer/interface": "2.0.2"
|
|
29
29
|
}
|
|
30
30
|
}
|
package/src/Renderer.ts
CHANGED
|
@@ -217,7 +217,7 @@ export class Renderer implements IRenderer {
|
|
|
217
217
|
return undefined
|
|
218
218
|
}
|
|
219
219
|
|
|
220
|
-
public addBlock(block: IBounds): void {
|
|
220
|
+
public addBlock(block: IBounds, _leafList?: ILeafList): void {
|
|
221
221
|
if (!this.updateBlocks) this.updateBlocks = []
|
|
222
222
|
this.updateBlocks.push(block)
|
|
223
223
|
}
|
|
@@ -279,7 +279,8 @@ export class Renderer implements IRenderer {
|
|
|
279
279
|
protected __onLayoutEnd(event: LayoutEvent): void {
|
|
280
280
|
if (event.data) event.data.map(item => {
|
|
281
281
|
let empty: boolean
|
|
282
|
-
|
|
282
|
+
const { updatedList } = item
|
|
283
|
+
if (updatedList) updatedList.list.some(leaf => {
|
|
283
284
|
empty = (!leaf.__world.width || !leaf.__world.height)
|
|
284
285
|
if (empty) {
|
|
285
286
|
if (!leaf.isLeafer) debug.tip(leaf.innerName, ': empty')
|
|
@@ -287,7 +288,7 @@ export class Renderer implements IRenderer {
|
|
|
287
288
|
}
|
|
288
289
|
return empty
|
|
289
290
|
})
|
|
290
|
-
this.addBlock(empty ? this.canvas.bounds : item.updatedBounds)
|
|
291
|
+
this.addBlock(empty ? this.canvas.bounds : item.updatedBounds, updatedList)
|
|
291
292
|
})
|
|
292
293
|
}
|
|
293
294
|
|
package/types/index.d.ts
CHANGED
|
@@ -37,7 +37,7 @@ declare class Renderer implements IRenderer {
|
|
|
37
37
|
fullRender(): void;
|
|
38
38
|
protected __render(bounds: IBounds, realBounds?: IBounds): void;
|
|
39
39
|
getCellList(): ILeafList;
|
|
40
|
-
addBlock(block: IBounds): void;
|
|
40
|
+
addBlock(block: IBounds, _leafList?: ILeafList): void;
|
|
41
41
|
mergeBlocks(): void;
|
|
42
42
|
protected __requestRender(): void;
|
|
43
43
|
protected __onResize(e: ResizeEvent): void;
|