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.
@@ -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$5 = 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
  }
@@ -9875,8 +9876,7 @@ class InteractionBase {
9875
9876
  if (this.downData) {
9876
9877
  const canDrag = PointHelper.getDistance(this.downData, data) > this.p.dragDistance;
9877
9878
  if (canDrag) {
9878
- if (this.waitTap || this.longPressTimer)
9879
- this.pointerWaitCancel();
9879
+ this.pointerWaitCancel();
9880
9880
  this.waitRightTap = false;
9881
9881
  }
9882
9882
  this.dragger.checkDrag(data, canDrag);
@@ -10158,9 +10158,11 @@ class InteractionBase {
10158
10158
  this.waitTap = true;
10159
10159
  }
10160
10160
  tapWaitCancel() {
10161
- clearTimeout(this.tapTimer);
10162
- this.waitTap = false;
10163
- this.tapCount = 0;
10161
+ if (this.waitTap) {
10162
+ clearTimeout(this.tapTimer);
10163
+ this.waitTap = false;
10164
+ this.tapCount = 0;
10165
+ }
10164
10166
  }
10165
10167
  longPressWait(data) {
10166
10168
  clearTimeout(this.longPressTimer);
@@ -10180,8 +10182,10 @@ class InteractionBase {
10180
10182
  return hasLong;
10181
10183
  }
10182
10184
  longPressWaitCancel() {
10183
- clearTimeout(this.longPressTimer);
10184
- this.longPressed = false;
10185
+ if (this.longPressTimer) {
10186
+ clearTimeout(this.longPressTimer);
10187
+ this.longPressed = false;
10188
+ }
10185
10189
  }
10186
10190
  __onResize() {
10187
10191
  const { dragOut } = this.m;