@leafer/renderer 1.11.1 → 1.12.0

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leafer/renderer",
3
- "version": "1.11.1",
3
+ "version": "1.12.0",
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": "1.11.1"
25
+ "@leafer/core": "1.12.0"
26
26
  },
27
27
  "devDependencies": {
28
- "@leafer/interface": "1.11.1"
28
+ "@leafer/interface": "1.12.0"
29
29
  }
30
30
  }
package/src/Renderer.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { ILeaf, ILeaferBase, ILeaferCanvas, IRenderer, IRendererConfig, IEventListenerId, IBounds, IFunction, IRenderOptions } from '@leafer/interface'
1
+ import { ILeaf, ILeaferBase, ILeaferCanvas, IRenderer, IRendererConfig, IEventListenerId, IBounds, IFunction, IRenderOptions, ILeafList } from '@leafer/interface'
2
2
  import { LayoutEvent, RenderEvent, ResizeEvent, ImageManager, Bounds, DataHelper, Platform, Debug, Run } from '@leafer/core'
3
3
 
4
4
 
@@ -57,7 +57,7 @@ export class Renderer implements IRenderer {
57
57
 
58
58
  public update(change = true): void {
59
59
  if (!this.changed) this.changed = change
60
- this.__requestRender()
60
+ if (!this.requestTime) this.__requestRender()
61
61
  }
62
62
 
63
63
  public requestLayout(): void {
@@ -193,12 +193,14 @@ export class Renderer implements IRenderer {
193
193
  }
194
194
 
195
195
  protected __render(bounds: IBounds, realBounds?: IBounds): void {
196
- const { canvas } = this, includes = bounds.includes(this.target.__world), options: IRenderOptions = includes ? { includes } : { bounds, includes }
196
+ const { canvas, target } = this, includes = bounds.includes(target.__world), options: IRenderOptions = includes ? { includes } : { bounds, includes }
197
197
 
198
198
  if (this.needFill) canvas.fillWorld(bounds, this.config.fill)
199
199
  if (Debug.showRepaint) Debug.drawRepaint(canvas, bounds)
200
200
 
201
- Platform.render(this.target, canvas, options)
201
+ if (this.config.useCellRender) options.cellList = this.getCellList()
202
+
203
+ Platform.render(target, canvas, options)
202
204
 
203
205
  this.renderBounds = realBounds = realBounds || bounds
204
206
  this.renderOptions = options
@@ -207,6 +209,11 @@ export class Renderer implements IRenderer {
207
209
  canvas.updateRender(realBounds)
208
210
  }
209
211
 
212
+ // need rewrite
213
+ getCellList(): ILeafList {
214
+ return undefined
215
+ }
216
+
210
217
  public addBlock(block: IBounds): void {
211
218
  if (!this.updateBlocks) this.updateBlocks = []
212
219
  this.updateBlocks.push(block)
package/types/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { IRenderer, ILeaf, ILeaferCanvas, IBounds, IRendererConfig, IRenderOptions, IEventListenerId, IFunction } from '@leafer/interface';
1
+ import { IRenderer, ILeaf, ILeaferCanvas, IBounds, IRendererConfig, IRenderOptions, IEventListenerId, IFunction, ILeafList } from '@leafer/interface';
2
2
  import { ResizeEvent, LayoutEvent } from '@leafer/core';
3
3
 
4
4
  declare class Renderer implements IRenderer {
@@ -36,6 +36,7 @@ declare class Renderer implements IRenderer {
36
36
  clipRender(block: IBounds): void;
37
37
  fullRender(): void;
38
38
  protected __render(bounds: IBounds, realBounds?: IBounds): void;
39
+ getCellList(): ILeafList;
39
40
  addBlock(block: IBounds): void;
40
41
  mergeBlocks(): void;
41
42
  protected __requestRender(): void;