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.
@@ -2992,7 +2992,7 @@ const PathCommandNodeHelper = {
2992
2992
  toCommand(_nodes) {
2993
2993
  return [];
2994
2994
  },
2995
- toNode(_data) {
2995
+ toNode(_data, _filterSamePoint) {
2996
2996
  return [];
2997
2997
  }
2998
2998
  };
@@ -4883,6 +4883,13 @@ const LeafHelper = {
4883
4883
  if (!fromWorld) fromWorld = leaf.__nowWorld;
4884
4884
  if (leaf.__worldFlipped || Platform.fullImageShadow) currentCanvas.copyWorldByReset(fromCanvas, fromWorld, leaf.__nowWorld, blendMode, onlyResetTransform); else currentCanvas.copyWorldToInner(fromCanvas, fromWorld, leaf.__layout.renderBounds, blendMode);
4885
4885
  },
4886
+ clip(leaf, canvas, options) {
4887
+ if (leaf.__worldOpacity) {
4888
+ canvas.setWorld(leaf.__nowWorld = leaf.__getNowWorld(options));
4889
+ leaf.__drawRenderPath(canvas);
4890
+ canvas.clipUI(leaf);
4891
+ }
4892
+ },
4886
4893
  renderComplex(_leaf, _canvas, _options) {},
4887
4894
  updateComplex(_leaf) {},
4888
4895
  checkComplex(_leaf) {},
@@ -6258,11 +6265,7 @@ const LeafRender = {
6258
6265
  }
6259
6266
  },
6260
6267
  __clip(canvas, options) {
6261
- if (this.__worldOpacity) {
6262
- canvas.setWorld(this.__nowWorld = this.__getNowWorld(options));
6263
- this.__drawRenderPath(canvas);
6264
- canvas.clipUI(this);
6265
- }
6268
+ LeafHelper.clip(this, canvas, options);
6266
6269
  },
6267
6270
  __updateWorldOpacity() {
6268
6271
  this.__worldOpacity = this.__.visible ? this.parent ? this.parent.__worldOpacity * this.__.opacity : this.__.opacity : 0;
@@ -7043,7 +7046,7 @@ class LeafLevelList {
7043
7046
  }
7044
7047
  }
7045
7048
 
7046
- const version = "2.2.7";
7049
+ const version = "2.2.9";
7047
7050
 
7048
7051
  const debug$5 = Debug.get("LeaferCanvas");
7049
7052
 
@@ -8140,7 +8143,17 @@ Platform.render = function(target, canvas, options) {
8140
8143
  });
8141
8144
  options.topList = new LeafList;
8142
8145
  target.__render(canvas, options);
8143
- if (options.topList.length) options.topList.forEach(item => item.__render(canvas, topOptions));
8146
+ if (options.topList.length) options.topList.forEach(item => {
8147
+ const {parent: parent} = item;
8148
+ if (parent && parent.isBranchLeaf && parent.overflow !== "show") {
8149
+ canvas.save();
8150
+ LeafHelper.clip(parent, canvas, topOptions);
8151
+ item.__render(canvas, topOptions);
8152
+ canvas.restore();
8153
+ } else {
8154
+ item.__render(canvas, topOptions);
8155
+ }
8156
+ });
8144
8157
  };
8145
8158
 
8146
8159
  function effectType(defaultValue) {
@@ -15403,6 +15416,7 @@ const HighCurveHelper = {
15403
15416
  motionDistance = UnitConvert.number(motionDistance, total);
15404
15417
  if (offsetX) motionDistance += offsetX;
15405
15418
  if (motionDistance > total) motionDistance = motionDistance % total;
15419
+ if (motionDistance < 0) motionDistance = total + motionDistance;
15406
15420
  let nowDistance = 0, distance, to = {};
15407
15421
  let i = 0, index = 0, x = 0, y = 0, startX = 0, startY = 0, toX, toY, command;
15408
15422
  let x1, y1, x2, y2, t;
@@ -15611,11 +15625,7 @@ ui$1.getMotionPathData = function() {
15611
15625
  return getMotionPathData(getMotionPath(this));
15612
15626
  };
15613
15627
 
15614
- ui$1.getMotionContentHeight = function() {
15615
- return this.__layout.boxBounds.height;
15616
- };
15617
-
15618
- ui$1.getMotionPoint = function(motionDistance, motionAround, motionVertical, offsetX = 0, offsetY = 0, pathElement) {
15628
+ ui$1.getMotionPoint = function(motionDistance, motionAround, offsetX = 0, offsetY = 0, pathElement) {
15619
15629
  if (!pathElement) pathElement = getMotionPath(this);
15620
15630
  const data = getMotionPathData(pathElement);
15621
15631
  if (!data.total) return {};
@@ -15628,25 +15638,7 @@ ui$1.getMotionPoint = function(motionDistance, motionAround, motionVertical, off
15628
15638
  if (point.rotation) PointHelper.rotate(tempPoint, point.rotation, point);
15629
15639
  PointHelper.copy(point, tempPoint);
15630
15640
  }
15631
- let verticalType, verticalOffset;
15632
- if (isObject(motionVertical)) verticalType = motionVertical.type, verticalOffset = motionVertical.offset; else if (isNumber(motionVertical)) verticalOffset = motionVertical; else verticalType = motionVertical;
15633
- if (verticalType !== "below" || offsetY) {
15634
- const {rotation: rotation} = point, height = this.getMotionContentHeight();
15635
- if (verticalOffset) offsetY += verticalType === "above" ? -verticalOffset : verticalOffset;
15636
- switch (verticalType) {
15637
- case "above":
15638
- toVertical(point, rotation, -height + offsetY);
15639
- break;
15640
-
15641
- case "center":
15642
- toVertical(point, rotation, -height / 2 + offsetY);
15643
- break;
15644
-
15645
- case "below":
15646
- default:
15647
- toVertical(point, rotation, offsetY);
15648
- }
15649
- }
15641
+ if (offsetY) toVertical(point, point.rotation, offsetY);
15650
15642
  MatrixHelper.toOuterPoint(pathElement.localTransform, point);
15651
15643
  return point;
15652
15644
  };