@leafer-ui/node 1.6.0 → 1.6.1
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/dist/node.cjs +16 -15
- package/dist/node.cjs.map +1 -1
- package/dist/node.esm.js +16 -15
- package/dist/node.esm.js.map +1 -1
- package/dist/node.esm.min.js +1 -1
- package/dist/node.esm.min.js.map +1 -1
- package/dist/node.min.cjs +1 -1
- package/dist/node.min.cjs.map +1 -1
- package/package.json +12 -12
package/dist/node.esm.js
CHANGED
|
@@ -473,6 +473,15 @@ class Renderer {
|
|
|
473
473
|
}
|
|
474
474
|
checkRender() {
|
|
475
475
|
if (this.running) {
|
|
476
|
+
const { target } = this;
|
|
477
|
+
if (target.isApp) {
|
|
478
|
+
target.emit(RenderEvent.CHILD_START, target);
|
|
479
|
+
target.children.forEach(leafer => {
|
|
480
|
+
leafer.renderer.FPS = this.FPS;
|
|
481
|
+
leafer.renderer.checkRender();
|
|
482
|
+
});
|
|
483
|
+
target.emit(RenderEvent.CHILD_END, target);
|
|
484
|
+
}
|
|
476
485
|
if (this.changed && this.canvas.view)
|
|
477
486
|
this.render();
|
|
478
487
|
this.target.emit(RenderEvent.NEXT);
|
|
@@ -558,7 +567,7 @@ class Renderer {
|
|
|
558
567
|
bounds.spread(Renderer.clipSpread).ceil();
|
|
559
568
|
canvas.clearWorld(bounds, true);
|
|
560
569
|
canvas.clipWorld(bounds, true);
|
|
561
|
-
this.__render(bounds,
|
|
570
|
+
this.__render(bounds, realBounds);
|
|
562
571
|
canvas.restore();
|
|
563
572
|
Run.end(t);
|
|
564
573
|
}
|
|
@@ -567,12 +576,12 @@ class Renderer {
|
|
|
567
576
|
const { canvas } = this;
|
|
568
577
|
canvas.save();
|
|
569
578
|
canvas.clear();
|
|
570
|
-
this.__render(canvas.bounds
|
|
579
|
+
this.__render(canvas.bounds);
|
|
571
580
|
canvas.restore();
|
|
572
581
|
Run.end(t);
|
|
573
582
|
}
|
|
574
|
-
__render(bounds,
|
|
575
|
-
const { canvas } = this, options = includes ? { includes } : { bounds, includes };
|
|
583
|
+
__render(bounds, realBounds) {
|
|
584
|
+
const { canvas } = this, includes = bounds.includes(this.target.__world), options = includes ? { includes } : { bounds, includes };
|
|
576
585
|
if (this.needFill)
|
|
577
586
|
canvas.fillWorld(bounds, this.config.fill);
|
|
578
587
|
if (Debug.showRepaint)
|
|
@@ -599,22 +608,14 @@ class Renderer {
|
|
|
599
608
|
}
|
|
600
609
|
__requestRender() {
|
|
601
610
|
const target = this.target;
|
|
602
|
-
if (target
|
|
603
|
-
return target.parentApp.renderer.update(false);
|
|
604
|
-
if (this.requestTime)
|
|
611
|
+
if (this.requestTime || !target)
|
|
605
612
|
return;
|
|
613
|
+
if (target.parentApp)
|
|
614
|
+
return target.parentApp.requestRender(false);
|
|
606
615
|
const requestTime = this.requestTime = Date.now();
|
|
607
616
|
Platform.requestRender(() => {
|
|
608
617
|
this.FPS = Math.min(60, Math.ceil(1000 / (Date.now() - requestTime)));
|
|
609
618
|
this.requestTime = 0;
|
|
610
|
-
if (target.isApp) {
|
|
611
|
-
target.emit(RenderEvent.CHILD_START, target);
|
|
612
|
-
target.children.forEach(leafer => {
|
|
613
|
-
leafer.renderer.FPS = this.FPS;
|
|
614
|
-
leafer.renderer.checkRender();
|
|
615
|
-
});
|
|
616
|
-
target.emit(RenderEvent.CHILD_END, target);
|
|
617
|
-
}
|
|
618
619
|
this.checkRender();
|
|
619
620
|
});
|
|
620
621
|
}
|