leafer-game 2.3.1 → 2.3.2

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
@@ -4596,6 +4596,8 @@ var LeaferUI = function(exports) {
4596
4596
  renderComplex(_leaf, _canvas, _options) {},
4597
4597
  updateComplex(_leaf) {},
4598
4598
  checkComplex(_leaf) {},
4599
+ updateFlowLayout(_leaf) {},
4600
+ updatePositionLayout(_leaf) {},
4599
4601
  moveWorld(t, x, y = 0, isInnerPoint, transition) {
4600
4602
  const local = isObject(x) ? Object.assign({}, x) : {
4601
4603
  x: x,
@@ -5802,6 +5804,7 @@ var LeaferUI = function(exports) {
5802
5804
  },
5803
5805
  __updateLocalBoxBounds() {
5804
5806
  if (this.__hasMotionPath) this.__updateMotionPath();
5807
+ if (this.__hasPosition) LeafHelper.updatePositionLayout(this);
5805
5808
  if (this.__hasAutoLayout) this.__updateAutoLayout();
5806
5809
  toOuterOf$2(this.__layout.boxBounds, this.__local, this.__local);
5807
5810
  },
@@ -5828,11 +5831,7 @@ var LeaferUI = function(exports) {
5828
5831
  if (this.isBranch) {
5829
5832
  this.__extraUpdate();
5830
5833
  if (this.__.flow) {
5831
- if (this.__layout.childrenSortChanged) this.__updateSortChildren();
5832
- if (this.__layout.boxChanged) this.__updateFlowLayout();
5833
- updateAllMatrix$3(this);
5834
- updateBounds$1(this, this);
5835
- if (this.__.__autoSide) this.__updateBoxBounds(true);
5834
+ LeafHelper.updateFlowLayout(this);
5836
5835
  } else {
5837
5836
  updateAllMatrix$3(this);
5838
5837
  updateBounds$1(this, this);
@@ -6653,7 +6652,7 @@ var LeaferUI = function(exports) {
6653
6652
  this.levelMap = null;
6654
6653
  }
6655
6654
  }
6656
- const version = "2.3.1";
6655
+ const version = "2.3.2";
6657
6656
  if (typeof globalThis !== "undefined") {
6658
6657
  const globalLeafer = globalThis.Leafer || (globalThis.Leafer = {});
6659
6658
  globalLeafer.version = version;
@@ -11461,18 +11460,20 @@ var LeaferUI = function(exports) {
11461
11460
  data.__removePaint(attrName, false);
11462
11461
  data["_" + attrName] = "";
11463
11462
  }
11463
+ recycleMap = undefined;
11464
11464
  }
11465
11465
  function getLeafPaint(attrName, paint, ui) {
11466
11466
  if (!isObject(paint) || paint.visible === false || paint.opacity === 0) return undefined;
11467
- let leafPaint;
11467
+ let leafPaint, oldPaint;
11468
11468
  const {boxBounds: boxBounds} = ui.__layout, {type: type} = paint;
11469
11469
  switch (type) {
11470
11470
  case "image":
11471
11471
  case "film":
11472
11472
  case "video":
11473
11473
  if (!paint.url) return undefined;
11474
- leafPaint = PaintImage.image(ui, attrName, paint, boxBounds, !recycleMap || !recycleMap[paint.url]);
11475
- if (type !== "image") PaintImage[type](leafPaint);
11474
+ oldPaint = recycleMap && recycleMap[paint.url];
11475
+ leafPaint = PaintImage.image(ui, attrName, paint, boxBounds, oldPaint);
11476
+ if (type !== "image") PaintImage[type](leafPaint, oldPaint);
11476
11477
  break;
11477
11478
 
11478
11479
  case "linear":
@@ -11526,9 +11527,9 @@ var LeaferUI = function(exports) {
11526
11527
  };
11527
11528
  let cache$1, box = new Bounds;
11528
11529
  const {isSame: isSame} = BoundsHelper;
11529
- function image(ui, attrName, paint, boxBounds, firstUse) {
11530
+ function image(ui, attrName, paint, boxBounds, oldPaint) {
11530
11531
  let leafPaint, event;
11531
- const image = ImageManager.get(paint, paint.type);
11532
+ const image = ImageManager.get(paint, paint.type), firstUse = !oldPaint;
11532
11533
  if (cache$1 && paint === cache$1.paint && isSame(boxBounds, cache$1.boxBounds)) {
11533
11534
  leafPaint = cache$1.leafPaint;
11534
11535
  } else {
@@ -11924,7 +11925,7 @@ var LeaferUI = function(exports) {
11924
11925
  url = image && image.url;
11925
11926
  if (url) {
11926
11927
  if (!recycleMap) recycleMap = {};
11927
- recycleMap[url] = true;
11928
+ recycleMap[url] = paint;
11928
11929
  ImageManager.recyclePaint(paint);
11929
11930
  if (paint.brush) PaintImage.recycleBrush(paint, ui);
11930
11931
  if (data.__willDestroy && image.parent) PaintImage.recycleFilter(image, ui);
@@ -14554,7 +14555,7 @@ var LeaferUI = function(exports) {
14554
14555
  if (!data.total) return {};
14555
14556
  const point = HighCurveHelper.getDistancePoint(data, motionDistance, pathElement.motionPrecision, offsetX);
14556
14557
  const {motionRotation: motionRotation} = this;
14557
- if (isNumber(motionRotation)) point.rotation += motionRotation;
14558
+ if (isNumber(motionRotation)) point.rotation += motionRotation; else if (motionRotation === false) point.rotation = 0;
14558
14559
  if (motionAround && motionAround !== "top-left") {
14559
14560
  AroundHelper.toPoint(motionAround, this.__layout.boxBounds, tempPoint);
14560
14561
  PointHelper.set(tempPoint, point.x - tempPoint.x * this.scaleX, point.y - tempPoint.y * this.scaleY);