leafer-game 2.2.7 → 2.2.9

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
@@ -2800,7 +2800,7 @@ var LeaferUI = function(exports) {
2800
2800
  toCommand(_nodes) {
2801
2801
  return [];
2802
2802
  },
2803
- toNode(_data) {
2803
+ toNode(_data, _filterSamePoint) {
2804
2804
  return [];
2805
2805
  }
2806
2806
  };
@@ -4582,6 +4582,13 @@ var LeaferUI = function(exports) {
4582
4582
  if (!fromWorld) fromWorld = leaf.__nowWorld;
4583
4583
  if (leaf.__worldFlipped || Platform.fullImageShadow) currentCanvas.copyWorldByReset(fromCanvas, fromWorld, leaf.__nowWorld, blendMode, onlyResetTransform); else currentCanvas.copyWorldToInner(fromCanvas, fromWorld, leaf.__layout.renderBounds, blendMode);
4584
4584
  },
4585
+ clip(leaf, canvas, options) {
4586
+ if (leaf.__worldOpacity) {
4587
+ canvas.setWorld(leaf.__nowWorld = leaf.__getNowWorld(options));
4588
+ leaf.__drawRenderPath(canvas);
4589
+ canvas.clipUI(leaf);
4590
+ }
4591
+ },
4585
4592
  renderComplex(_leaf, _canvas, _options) {},
4586
4593
  updateComplex(_leaf) {},
4587
4594
  checkComplex(_leaf) {},
@@ -5858,11 +5865,7 @@ var LeaferUI = function(exports) {
5858
5865
  }
5859
5866
  },
5860
5867
  __clip(canvas, options) {
5861
- if (this.__worldOpacity) {
5862
- canvas.setWorld(this.__nowWorld = this.__getNowWorld(options));
5863
- this.__drawRenderPath(canvas);
5864
- canvas.clipUI(this);
5865
- }
5868
+ LeafHelper.clip(this, canvas, options);
5866
5869
  },
5867
5870
  __updateWorldOpacity() {
5868
5871
  this.__worldOpacity = this.__.visible ? this.parent ? this.parent.__worldOpacity * this.__.opacity : this.__.opacity : 0;
@@ -6623,7 +6626,7 @@ var LeaferUI = function(exports) {
6623
6626
  this.levelMap = null;
6624
6627
  }
6625
6628
  }
6626
- const version = "2.2.7";
6629
+ const version = "2.2.9";
6627
6630
  const debug$5 = Debug.get("LeaferCanvas");
6628
6631
  class LeaferCanvas extends LeaferCanvasBase {
6629
6632
  set zIndex(zIndex) {
@@ -7686,7 +7689,17 @@ var LeaferUI = function(exports) {
7686
7689
  });
7687
7690
  options.topList = new LeafList;
7688
7691
  target.__render(canvas, options);
7689
- if (options.topList.length) options.topList.forEach(item => item.__render(canvas, topOptions));
7692
+ if (options.topList.length) options.topList.forEach(item => {
7693
+ const {parent: parent} = item;
7694
+ if (parent && parent.isBranchLeaf && parent.overflow !== "show") {
7695
+ canvas.save();
7696
+ LeafHelper.clip(parent, canvas, topOptions);
7697
+ item.__render(canvas, topOptions);
7698
+ canvas.restore();
7699
+ } else {
7700
+ item.__render(canvas, topOptions);
7701
+ }
7702
+ });
7690
7703
  };
7691
7704
  function effectType(defaultValue) {
7692
7705
  return decorateLeafAttr(defaultValue, key => attr({
@@ -14258,6 +14271,7 @@ var LeaferUI = function(exports) {
14258
14271
  motionDistance = UnitConvert.number(motionDistance, total);
14259
14272
  if (offsetX) motionDistance += offsetX;
14260
14273
  if (motionDistance > total) motionDistance = motionDistance % total;
14274
+ if (motionDistance < 0) motionDistance = total + motionDistance;
14261
14275
  let nowDistance = 0, distance, to = {};
14262
14276
  let i = 0, index = 0, x = 0, y = 0, startX = 0, startY = 0, toX, toY, command;
14263
14277
  let x1, y1, x2, y2, t;
@@ -14448,10 +14462,7 @@ var LeaferUI = function(exports) {
14448
14462
  ui$1.getMotionPathData = function() {
14449
14463
  return getMotionPathData(getMotionPath(this));
14450
14464
  };
14451
- ui$1.getMotionContentHeight = function() {
14452
- return this.__layout.boxBounds.height;
14453
- };
14454
- ui$1.getMotionPoint = function(motionDistance, motionAround, motionVertical, offsetX = 0, offsetY = 0, pathElement) {
14465
+ ui$1.getMotionPoint = function(motionDistance, motionAround, offsetX = 0, offsetY = 0, pathElement) {
14455
14466
  if (!pathElement) pathElement = getMotionPath(this);
14456
14467
  const data = getMotionPathData(pathElement);
14457
14468
  if (!data.total) return {};
@@ -14464,25 +14475,7 @@ var LeaferUI = function(exports) {
14464
14475
  if (point.rotation) PointHelper.rotate(tempPoint, point.rotation, point);
14465
14476
  PointHelper.copy(point, tempPoint);
14466
14477
  }
14467
- let verticalType, verticalOffset;
14468
- if (isObject(motionVertical)) verticalType = motionVertical.type, verticalOffset = motionVertical.offset; else if (isNumber(motionVertical)) verticalOffset = motionVertical; else verticalType = motionVertical;
14469
- if (verticalType !== "below" || offsetY) {
14470
- const {rotation: rotation} = point, height = this.getMotionContentHeight();
14471
- if (verticalOffset) offsetY += verticalType === "above" ? -verticalOffset : verticalOffset;
14472
- switch (verticalType) {
14473
- case "above":
14474
- toVertical(point, rotation, -height + offsetY);
14475
- break;
14476
-
14477
- case "center":
14478
- toVertical(point, rotation, -height / 2 + offsetY);
14479
- break;
14480
-
14481
- case "below":
14482
- default:
14483
- toVertical(point, rotation, offsetY);
14484
- }
14485
- }
14478
+ if (offsetY) toVertical(point, point.rotation, offsetY);
14486
14479
  MatrixHelper.toOuterPoint(pathElement.localTransform, point);
14487
14480
  return point;
14488
14481
  };