leafer-draw 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.
@@ -6125,7 +6125,7 @@ class LeafLevelList {
6125
6125
  }
6126
6126
  }
6127
6127
 
6128
- const version = "1.6.0";
6128
+ const version = "1.6.1";
6129
6129
 
6130
6130
  const debug$4 = Debug.get('LeaferCanvas');
6131
6131
  class LeaferCanvas extends LeaferCanvasBase {
@@ -6763,6 +6763,15 @@ class Renderer {
6763
6763
  }
6764
6764
  checkRender() {
6765
6765
  if (this.running) {
6766
+ const { target } = this;
6767
+ if (target.isApp) {
6768
+ target.emit(RenderEvent.CHILD_START, target);
6769
+ target.children.forEach(leafer => {
6770
+ leafer.renderer.FPS = this.FPS;
6771
+ leafer.renderer.checkRender();
6772
+ });
6773
+ target.emit(RenderEvent.CHILD_END, target);
6774
+ }
6766
6775
  if (this.changed && this.canvas.view)
6767
6776
  this.render();
6768
6777
  this.target.emit(RenderEvent.NEXT);
@@ -6848,7 +6857,7 @@ class Renderer {
6848
6857
  bounds.spread(Renderer.clipSpread).ceil();
6849
6858
  canvas.clearWorld(bounds, true);
6850
6859
  canvas.clipWorld(bounds, true);
6851
- this.__render(bounds, block.includes(this.target.__world), realBounds);
6860
+ this.__render(bounds, realBounds);
6852
6861
  canvas.restore();
6853
6862
  Run.end(t);
6854
6863
  }
@@ -6857,12 +6866,12 @@ class Renderer {
6857
6866
  const { canvas } = this;
6858
6867
  canvas.save();
6859
6868
  canvas.clear();
6860
- this.__render(canvas.bounds, true);
6869
+ this.__render(canvas.bounds);
6861
6870
  canvas.restore();
6862
6871
  Run.end(t);
6863
6872
  }
6864
- __render(bounds, includes, realBounds) {
6865
- const { canvas } = this, options = includes ? { includes } : { bounds, includes };
6873
+ __render(bounds, realBounds) {
6874
+ const { canvas } = this, includes = bounds.includes(this.target.__world), options = includes ? { includes } : { bounds, includes };
6866
6875
  if (this.needFill)
6867
6876
  canvas.fillWorld(bounds, this.config.fill);
6868
6877
  if (Debug.showRepaint)
@@ -6889,22 +6898,14 @@ class Renderer {
6889
6898
  }
6890
6899
  __requestRender() {
6891
6900
  const target = this.target;
6892
- if (target.parentApp)
6893
- return target.parentApp.renderer.update(false);
6894
- if (this.requestTime)
6901
+ if (this.requestTime || !target)
6895
6902
  return;
6903
+ if (target.parentApp)
6904
+ return target.parentApp.requestRender(false);
6896
6905
  const requestTime = this.requestTime = Date.now();
6897
6906
  Platform.requestRender(() => {
6898
6907
  this.FPS = Math.min(60, Math.ceil(1000 / (Date.now() - requestTime)));
6899
6908
  this.requestTime = 0;
6900
- if (target.isApp) {
6901
- target.emit(RenderEvent.CHILD_START, target);
6902
- target.children.forEach(leafer => {
6903
- leafer.renderer.FPS = this.FPS;
6904
- leafer.renderer.checkRender();
6905
- });
6906
- target.emit(RenderEvent.CHILD_END, target);
6907
- }
6908
6909
  this.checkRender();
6909
6910
  });
6910
6911
  }