leafer-ui 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/web.esm.js CHANGED
@@ -641,6 +641,15 @@ class Renderer {
641
641
  }
642
642
  checkRender() {
643
643
  if (this.running) {
644
+ const { target } = this;
645
+ if (target.isApp) {
646
+ target.emit(RenderEvent.CHILD_START, target);
647
+ target.children.forEach(leafer => {
648
+ leafer.renderer.FPS = this.FPS;
649
+ leafer.renderer.checkRender();
650
+ });
651
+ target.emit(RenderEvent.CHILD_END, target);
652
+ }
644
653
  if (this.changed && this.canvas.view)
645
654
  this.render();
646
655
  this.target.emit(RenderEvent.NEXT);
@@ -726,7 +735,7 @@ class Renderer {
726
735
  bounds.spread(Renderer.clipSpread).ceil();
727
736
  canvas.clearWorld(bounds, true);
728
737
  canvas.clipWorld(bounds, true);
729
- this.__render(bounds, block.includes(this.target.__world), realBounds);
738
+ this.__render(bounds, realBounds);
730
739
  canvas.restore();
731
740
  Run.end(t);
732
741
  }
@@ -735,12 +744,12 @@ class Renderer {
735
744
  const { canvas } = this;
736
745
  canvas.save();
737
746
  canvas.clear();
738
- this.__render(canvas.bounds, true);
747
+ this.__render(canvas.bounds);
739
748
  canvas.restore();
740
749
  Run.end(t);
741
750
  }
742
- __render(bounds, includes, realBounds) {
743
- const { canvas } = this, options = includes ? { includes } : { bounds, includes };
751
+ __render(bounds, realBounds) {
752
+ const { canvas } = this, includes = bounds.includes(this.target.__world), options = includes ? { includes } : { bounds, includes };
744
753
  if (this.needFill)
745
754
  canvas.fillWorld(bounds, this.config.fill);
746
755
  if (Debug.showRepaint)
@@ -767,22 +776,14 @@ class Renderer {
767
776
  }
768
777
  __requestRender() {
769
778
  const target = this.target;
770
- if (target.parentApp)
771
- return target.parentApp.renderer.update(false);
772
- if (this.requestTime)
779
+ if (this.requestTime || !target)
773
780
  return;
781
+ if (target.parentApp)
782
+ return target.parentApp.requestRender(false);
774
783
  const requestTime = this.requestTime = Date.now();
775
784
  Platform.requestRender(() => {
776
785
  this.FPS = Math.min(60, Math.ceil(1000 / (Date.now() - requestTime)));
777
786
  this.requestTime = 0;
778
- if (target.isApp) {
779
- target.emit(RenderEvent.CHILD_START, target);
780
- target.children.forEach(leafer => {
781
- leafer.renderer.FPS = this.FPS;
782
- leafer.renderer.checkRender();
783
- });
784
- target.emit(RenderEvent.CHILD_END, target);
785
- }
786
787
  this.checkRender();
787
788
  });
788
789
  }