@leafer/renderer 1.0.0-rc.4 → 1.0.0-rc.6

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.0.0-rc.4",
3
+ "version": "1.0.0-rc.6",
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.0.0-rc.4"
25
+ "@leafer/core": "1.0.0-rc.6"
26
26
  },
27
27
  "devDependencies": {
28
- "@leafer/interface": "1.0.0-rc.4"
28
+ "@leafer/interface": "1.0.0-rc.6"
29
29
  }
30
30
  }
package/src/Renderer.ts CHANGED
@@ -134,7 +134,7 @@ export class Renderer implements IRenderer {
134
134
  const { canvas, updateBlocks: list } = this
135
135
  if (!list) return debug.warn('PartRender: need update attr')
136
136
 
137
- if (list.some(block => block.includes(this.target.__world))) this.mergeBlocks()
137
+ this.mergeBlocks()
138
138
  list.forEach(block => { if (canvas.bounds.hit(block) && !block.isEmpty()) this.clipRender(block) })
139
139
  }
140
140
 
@@ -156,7 +156,7 @@ export class Renderer implements IRenderer {
156
156
  canvas.clipWorld(bounds, true)
157
157
  }
158
158
 
159
- this.__render(bounds, realBounds)
159
+ this.__render(bounds, includes, realBounds)
160
160
  canvas.restore()
161
161
 
162
162
  Run.end(t)
@@ -168,14 +168,14 @@ export class Renderer implements IRenderer {
168
168
 
169
169
  canvas.save()
170
170
  canvas.clear()
171
- this.__render(canvas.bounds)
171
+ this.__render(canvas.bounds, true)
172
172
  canvas.restore()
173
173
 
174
174
  Run.end(t)
175
175
  }
176
176
 
177
- protected __render(bounds: IBounds, realBounds?: IBounds): void {
178
- const options: IRenderOptions = bounds?.includes(this.target.__world) ? {} : { bounds }
177
+ protected __render(bounds: IBounds, includes?: boolean, realBounds?: IBounds,): void {
178
+ const options: IRenderOptions = bounds.includes(this.target.__world) ? { includes } : { bounds, includes }
179
179
 
180
180
  if (this.needFill) this.canvas.fillWorld(bounds, this.config.fill)
181
181
  if (Debug.showRepaint) this.canvas.strokeWorld(bounds, 'red')
package/types/index.d.ts CHANGED
@@ -29,7 +29,7 @@ declare class Renderer implements IRenderer {
29
29
  partRender(): void;
30
30
  clipRender(block: IBounds): void;
31
31
  fullRender(): void;
32
- protected __render(bounds: IBounds, realBounds?: IBounds): void;
32
+ protected __render(bounds: IBounds, includes?: boolean, realBounds?: IBounds): void;
33
33
  renderHitView(_options: IRenderOptions): void;
34
34
  renderBoundsView(_options: IRenderOptions): void;
35
35
  addBlock(block: IBounds): void;