@leafer/renderer 1.0.0-beta.6 → 1.0.0-beta.8
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 +7 -7
- package/src/Renderer.ts +5 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leafer/renderer",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.8",
|
|
4
4
|
"description": "@leafer/renderer",
|
|
5
5
|
"author": "Chao (Leafer) Wan",
|
|
6
6
|
"license": "MIT",
|
|
@@ -19,13 +19,13 @@
|
|
|
19
19
|
"leaferjs"
|
|
20
20
|
],
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@leafer/event": "1.0.0-beta.
|
|
23
|
-
"@leafer/math": "1.0.0-beta.
|
|
24
|
-
"@leafer/data": "1.0.0-beta.
|
|
25
|
-
"@leafer/platform": "1.0.0-beta.
|
|
26
|
-
"@leafer/debug": "1.0.0-beta.
|
|
22
|
+
"@leafer/event": "1.0.0-beta.8",
|
|
23
|
+
"@leafer/math": "1.0.0-beta.8",
|
|
24
|
+
"@leafer/data": "1.0.0-beta.8",
|
|
25
|
+
"@leafer/platform": "1.0.0-beta.8",
|
|
26
|
+
"@leafer/debug": "1.0.0-beta.8"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"@leafer/interface": "1.0.0-beta.
|
|
29
|
+
"@leafer/interface": "1.0.0-beta.8"
|
|
30
30
|
}
|
|
31
31
|
}
|
package/src/Renderer.ts
CHANGED
|
@@ -62,7 +62,10 @@ export class Renderer implements IRenderer {
|
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
public render(callback?: IFunction): void {
|
|
65
|
-
if (!(this.running))
|
|
65
|
+
if (!(this.running && this.canvas.view)) {
|
|
66
|
+
this.changed = true
|
|
67
|
+
return
|
|
68
|
+
}
|
|
66
69
|
|
|
67
70
|
const { target } = this
|
|
68
71
|
this.times = 0
|
|
@@ -212,7 +215,7 @@ export class Renderer implements IRenderer {
|
|
|
212
215
|
Platform.requestRender(() => {
|
|
213
216
|
this.FPS = Math.min(60, Math.ceil(1000 / (Date.now() - startTime)))
|
|
214
217
|
if (this.changed) {
|
|
215
|
-
if (this.running) this.render()
|
|
218
|
+
if (this.running && this.canvas.view) this.render()
|
|
216
219
|
}
|
|
217
220
|
if (this.running) this.target.emit(AnimateEvent.FRAME)
|
|
218
221
|
if (this.target) this.__requestRender()
|