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.js CHANGED
@@ -6128,7 +6128,7 @@ var LeaferUI = (function (exports) {
6128
6128
  }
6129
6129
  }
6130
6130
 
6131
- const version = "1.6.0";
6131
+ const version = "1.6.1";
6132
6132
 
6133
6133
  const debug$5 = Debug.get('LeaferCanvas');
6134
6134
  class LeaferCanvas extends LeaferCanvasBase {
@@ -6766,6 +6766,15 @@ var LeaferUI = (function (exports) {
6766
6766
  }
6767
6767
  checkRender() {
6768
6768
  if (this.running) {
6769
+ const { target } = this;
6770
+ if (target.isApp) {
6771
+ target.emit(RenderEvent.CHILD_START, target);
6772
+ target.children.forEach(leafer => {
6773
+ leafer.renderer.FPS = this.FPS;
6774
+ leafer.renderer.checkRender();
6775
+ });
6776
+ target.emit(RenderEvent.CHILD_END, target);
6777
+ }
6769
6778
  if (this.changed && this.canvas.view)
6770
6779
  this.render();
6771
6780
  this.target.emit(RenderEvent.NEXT);
@@ -6851,7 +6860,7 @@ var LeaferUI = (function (exports) {
6851
6860
  bounds.spread(Renderer.clipSpread).ceil();
6852
6861
  canvas.clearWorld(bounds, true);
6853
6862
  canvas.clipWorld(bounds, true);
6854
- this.__render(bounds, block.includes(this.target.__world), realBounds);
6863
+ this.__render(bounds, realBounds);
6855
6864
  canvas.restore();
6856
6865
  Run.end(t);
6857
6866
  }
@@ -6860,12 +6869,12 @@ var LeaferUI = (function (exports) {
6860
6869
  const { canvas } = this;
6861
6870
  canvas.save();
6862
6871
  canvas.clear();
6863
- this.__render(canvas.bounds, true);
6872
+ this.__render(canvas.bounds);
6864
6873
  canvas.restore();
6865
6874
  Run.end(t);
6866
6875
  }
6867
- __render(bounds, includes, realBounds) {
6868
- const { canvas } = this, options = includes ? { includes } : { bounds, includes };
6876
+ __render(bounds, realBounds) {
6877
+ const { canvas } = this, includes = bounds.includes(this.target.__world), options = includes ? { includes } : { bounds, includes };
6869
6878
  if (this.needFill)
6870
6879
  canvas.fillWorld(bounds, this.config.fill);
6871
6880
  if (Debug.showRepaint)
@@ -6892,22 +6901,14 @@ var LeaferUI = (function (exports) {
6892
6901
  }
6893
6902
  __requestRender() {
6894
6903
  const target = this.target;
6895
- if (target.parentApp)
6896
- return target.parentApp.renderer.update(false);
6897
- if (this.requestTime)
6904
+ if (this.requestTime || !target)
6898
6905
  return;
6906
+ if (target.parentApp)
6907
+ return target.parentApp.requestRender(false);
6899
6908
  const requestTime = this.requestTime = Date.now();
6900
6909
  Platform.requestRender(() => {
6901
6910
  this.FPS = Math.min(60, Math.ceil(1000 / (Date.now() - requestTime)));
6902
6911
  this.requestTime = 0;
6903
- if (target.isApp) {
6904
- target.emit(RenderEvent.CHILD_START, target);
6905
- target.children.forEach(leafer => {
6906
- leafer.renderer.FPS = this.FPS;
6907
- leafer.renderer.checkRender();
6908
- });
6909
- target.emit(RenderEvent.CHILD_END, target);
6910
- }
6911
6912
  this.checkRender();
6912
6913
  });
6913
6914
  }
@@ -9878,8 +9879,7 @@ var LeaferUI = (function (exports) {
9878
9879
  if (this.downData) {
9879
9880
  const canDrag = PointHelper.getDistance(this.downData, data) > this.p.dragDistance;
9880
9881
  if (canDrag) {
9881
- if (this.waitTap || this.longPressTimer)
9882
- this.pointerWaitCancel();
9882
+ this.pointerWaitCancel();
9883
9883
  this.waitRightTap = false;
9884
9884
  }
9885
9885
  this.dragger.checkDrag(data, canDrag);
@@ -10161,9 +10161,11 @@ var LeaferUI = (function (exports) {
10161
10161
  this.waitTap = true;
10162
10162
  }
10163
10163
  tapWaitCancel() {
10164
- clearTimeout(this.tapTimer);
10165
- this.waitTap = false;
10166
- this.tapCount = 0;
10164
+ if (this.waitTap) {
10165
+ clearTimeout(this.tapTimer);
10166
+ this.waitTap = false;
10167
+ this.tapCount = 0;
10168
+ }
10167
10169
  }
10168
10170
  longPressWait(data) {
10169
10171
  clearTimeout(this.longPressTimer);
@@ -10183,8 +10185,10 @@ var LeaferUI = (function (exports) {
10183
10185
  return hasLong;
10184
10186
  }
10185
10187
  longPressWaitCancel() {
10186
- clearTimeout(this.longPressTimer);
10187
- this.longPressed = false;
10188
+ if (this.longPressTimer) {
10189
+ clearTimeout(this.longPressTimer);
10190
+ this.longPressed = false;
10191
+ }
10188
10192
  }
10189
10193
  __onResize() {
10190
10194
  const { dragOut } = this.m;