@leafer-ui/miniapp 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
  class LeaferCanvas extends LeaferCanvasBase {
6131
6131
  get allowBackgroundColor() { return false; }
@@ -6721,6 +6721,15 @@ class Renderer {
6721
6721
  }
6722
6722
  checkRender() {
6723
6723
  if (this.running) {
6724
+ const { target } = this;
6725
+ if (target.isApp) {
6726
+ target.emit(RenderEvent.CHILD_START, target);
6727
+ target.children.forEach(leafer => {
6728
+ leafer.renderer.FPS = this.FPS;
6729
+ leafer.renderer.checkRender();
6730
+ });
6731
+ target.emit(RenderEvent.CHILD_END, target);
6732
+ }
6724
6733
  if (this.changed && this.canvas.view)
6725
6734
  this.render();
6726
6735
  this.target.emit(RenderEvent.NEXT);
@@ -6806,7 +6815,7 @@ class Renderer {
6806
6815
  bounds.spread(Renderer.clipSpread).ceil();
6807
6816
  canvas.clearWorld(bounds, true);
6808
6817
  canvas.clipWorld(bounds, true);
6809
- this.__render(bounds, block.includes(this.target.__world), realBounds);
6818
+ this.__render(bounds, realBounds);
6810
6819
  canvas.restore();
6811
6820
  Run.end(t);
6812
6821
  }
@@ -6815,12 +6824,12 @@ class Renderer {
6815
6824
  const { canvas } = this;
6816
6825
  canvas.save();
6817
6826
  canvas.clear();
6818
- this.__render(canvas.bounds, true);
6827
+ this.__render(canvas.bounds);
6819
6828
  canvas.restore();
6820
6829
  Run.end(t);
6821
6830
  }
6822
- __render(bounds, includes, realBounds) {
6823
- const { canvas } = this, options = includes ? { includes } : { bounds, includes };
6831
+ __render(bounds, realBounds) {
6832
+ const { canvas } = this, includes = bounds.includes(this.target.__world), options = includes ? { includes } : { bounds, includes };
6824
6833
  if (this.needFill)
6825
6834
  canvas.fillWorld(bounds, this.config.fill);
6826
6835
  if (Debug.showRepaint)
@@ -6847,22 +6856,14 @@ class Renderer {
6847
6856
  }
6848
6857
  __requestRender() {
6849
6858
  const target = this.target;
6850
- if (target.parentApp)
6851
- return target.parentApp.renderer.update(false);
6852
- if (this.requestTime)
6859
+ if (this.requestTime || !target)
6853
6860
  return;
6861
+ if (target.parentApp)
6862
+ return target.parentApp.requestRender(false);
6854
6863
  const requestTime = this.requestTime = Date.now();
6855
6864
  Platform.requestRender(() => {
6856
6865
  this.FPS = Math.min(60, Math.ceil(1000 / (Date.now() - requestTime)));
6857
6866
  this.requestTime = 0;
6858
- if (target.isApp) {
6859
- target.emit(RenderEvent.CHILD_START, target);
6860
- target.children.forEach(leafer => {
6861
- leafer.renderer.FPS = this.FPS;
6862
- leafer.renderer.checkRender();
6863
- });
6864
- target.emit(RenderEvent.CHILD_END, target);
6865
- }
6866
6867
  this.checkRender();
6867
6868
  });
6868
6869
  }
@@ -9833,8 +9834,7 @@ class InteractionBase {
9833
9834
  if (this.downData) {
9834
9835
  const canDrag = PointHelper.getDistance(this.downData, data) > this.p.dragDistance;
9835
9836
  if (canDrag) {
9836
- if (this.waitTap || this.longPressTimer)
9837
- this.pointerWaitCancel();
9837
+ this.pointerWaitCancel();
9838
9838
  this.waitRightTap = false;
9839
9839
  }
9840
9840
  this.dragger.checkDrag(data, canDrag);
@@ -10116,9 +10116,11 @@ class InteractionBase {
10116
10116
  this.waitTap = true;
10117
10117
  }
10118
10118
  tapWaitCancel() {
10119
- clearTimeout(this.tapTimer);
10120
- this.waitTap = false;
10121
- this.tapCount = 0;
10119
+ if (this.waitTap) {
10120
+ clearTimeout(this.tapTimer);
10121
+ this.waitTap = false;
10122
+ this.tapCount = 0;
10123
+ }
10122
10124
  }
10123
10125
  longPressWait(data) {
10124
10126
  clearTimeout(this.longPressTimer);
@@ -10138,8 +10140,10 @@ class InteractionBase {
10138
10140
  return hasLong;
10139
10141
  }
10140
10142
  longPressWaitCancel() {
10141
- clearTimeout(this.longPressTimer);
10142
- this.longPressed = false;
10143
+ if (this.longPressTimer) {
10144
+ clearTimeout(this.longPressTimer);
10145
+ this.longPressed = false;
10146
+ }
10143
10147
  }
10144
10148
  __onResize() {
10145
10149
  const { dragOut } = this.m;