@leafer/core 2.1.3 → 2.1.4

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/lib/core.cjs CHANGED
@@ -3041,7 +3041,8 @@ const PathConvert = {
3041
3041
  current.length = PathCommandLengthMap[char];
3042
3042
  current.index = 0;
3043
3043
  pushData(data, current.name);
3044
- if (char === "m") current.name = PathCommandMap["l"]; else if (char === "M") current.name = PathCommandMap["L"]; else if (!needConvert && convertCommand[char]) needConvert = true;
3044
+ if (char === "m") current.name = PathCommandMap["l"]; else if (char === "M") current.name = PathCommandMap["L"];
3045
+ if (!needConvert && convertCommand[char]) needConvert = true;
3045
3046
  } else {
3046
3047
  if (char === "-" || char === "+") {
3047
3048
  if (lastChar === "e" || lastChar === "E") {
@@ -3117,8 +3118,8 @@ const PathConvert = {
3117
3118
 
3118
3119
  case S:
3119
3120
  smooth = lastCommand === C$3 || lastCommand === S;
3120
- x1 = smooth ? x * 2 - controlX : old[i + 1];
3121
- y1 = smooth ? y * 2 - controlY : old[i + 2];
3121
+ x1 = smooth ? x * 2 - controlX : x;
3122
+ y1 = smooth ? y * 2 - controlY : y;
3122
3123
  controlX = old[i + 1];
3123
3124
  controlY = old[i + 2];
3124
3125
  x = old[i + 3];
@@ -3152,8 +3153,8 @@ const PathConvert = {
3152
3153
 
3153
3154
  case T:
3154
3155
  smooth = lastCommand === Q$3 || lastCommand === T;
3155
- controlX = smooth ? x * 2 - controlX : old[i + 1];
3156
- controlY = smooth ? y * 2 - controlY : old[i + 2];
3156
+ controlX = smooth ? x * 2 - controlX : x;
3157
+ controlY = smooth ? y * 2 - controlY : y;
3157
3158
  curveMode ? quadraticCurveTo$1(data, x, y, controlX, controlY, old[i + 1], old[i + 2]) : data.push(Q$3, controlX, controlY, old[i + 1], old[i + 2]);
3158
3159
  x = old[i + 1];
3159
3160
  y = old[i + 2];
@@ -4858,10 +4859,10 @@ const LeafHelper = {
4858
4859
  y: y
4859
4860
  }, transition) : (t.x = x, t.y = y);
4860
4861
  },
4861
- zoomOfWorld(t, origin, scaleX, scaleY, resize, transition) {
4862
- L.zoomOfLocal(t, getTempLocal(t, origin), scaleX, scaleY, resize, transition);
4862
+ zoomOfWorld(t, origin, scaleX, scaleY, resize, transition, boundsType) {
4863
+ L.zoomOfLocal(t, getTempLocal(t, origin), scaleX, scaleY, resize, transition, boundsType);
4863
4864
  },
4864
- zoomOfLocal(t, origin, scaleX, scaleY = scaleX, resize, transition) {
4865
+ zoomOfLocal(t, origin, scaleX, scaleY = scaleX, resize, transition, boundsType) {
4865
4866
  const o = t.__localMatrix;
4866
4867
  if (!isNumber(scaleY)) {
4867
4868
  if (scaleY) transition = scaleY;
@@ -4870,7 +4871,7 @@ const LeafHelper = {
4870
4871
  copy$3(matrix, o);
4871
4872
  scaleOfOuter(matrix, origin, scaleX, scaleY);
4872
4873
  if (L.hasHighPosition(t)) {
4873
- L.setTransform(t, matrix, resize, transition);
4874
+ L.setTransform(t, matrix, resize, transition, boundsType);
4874
4875
  } else {
4875
4876
  const x = t.x + matrix.e - o.e, y = t.y + matrix.f - o.f;
4876
4877
  if (transition && !resize) t.animate({
@@ -4878,7 +4879,7 @@ const LeafHelper = {
4878
4879
  y: y,
4879
4880
  scaleX: t.scaleX * scaleX,
4880
4881
  scaleY: t.scaleY * scaleY
4881
- }, transition); else t.x = x, t.y = y, t.scaleResize(scaleX, scaleY, resize !== true);
4882
+ }, transition); else t.x = x, t.y = y, t.scaleResize(scaleX, scaleY, resize !== true, boundsType);
4882
4883
  }
4883
4884
  },
4884
4885
  rotateOfWorld(t, origin, angle, transition) {
@@ -4902,18 +4903,18 @@ const LeafHelper = {
4902
4903
  skewOfOuter(matrix, origin, skewX, skewY);
4903
4904
  L.setTransform(t, matrix, resize, transition);
4904
4905
  },
4905
- transformWorld(t, transform, resize, transition) {
4906
+ transformWorld(t, transform, resize, transition, boundsType) {
4906
4907
  copy$3(matrix, t.worldTransform);
4907
4908
  multiplyParent$2(matrix, transform);
4908
4909
  if (t.parent) divideParent(matrix, t.parent.scrollWorldTransform);
4909
- L.setTransform(t, matrix, resize, transition);
4910
+ L.setTransform(t, matrix, resize, transition, boundsType);
4910
4911
  },
4911
- transform(t, transform, resize, transition) {
4912
+ transform(t, transform, resize, transition, boundsType) {
4912
4913
  copy$3(matrix, t.localTransform);
4913
4914
  multiplyParent$2(matrix, transform);
4914
- L.setTransform(t, matrix, resize, transition);
4915
+ L.setTransform(t, matrix, resize, transition, boundsType);
4915
4916
  },
4916
- setTransform(t, transform, resize, transition) {
4917
+ setTransform(t, transform, resize, transition, boundsType) {
4917
4918
  const data = t.__, originPoint = data.origin && L.getInnerOrigin(t, data.origin);
4918
4919
  const layout = getLayout(transform, originPoint, data.around && L.getInnerOrigin(t, data.around));
4919
4920
  if (L.hasOffset(t)) {
@@ -4929,7 +4930,7 @@ const LeafHelper = {
4929
4930
  PointHelper.move(layout, originPoint.x - changedPoint.x, originPoint.y - changedPoint.y);
4930
4931
  }
4931
4932
  t.set(layout);
4932
- t.scaleResize(scaleX, scaleY, false);
4933
+ t.scaleResize(scaleX, scaleY, false, boundsType);
4933
4934
  } else t.set(layout, transition);
4934
4935
  },
4935
4936
  getFlipTransform(t, axis) {
@@ -6668,11 +6669,11 @@ exports.Leaf = class Leaf {
6668
6669
  const layer = this.leafer ? this.leafer.zoomLayer : this;
6669
6670
  return layer.getWorldPoint(page, relative, distance, change);
6670
6671
  }
6671
- setTransform(matrix, resize, transition) {
6672
- setTransform(this, matrix, resize, transition);
6672
+ setTransform(matrix, resize, transition, boundsType) {
6673
+ setTransform(this, matrix, resize, transition, boundsType);
6673
6674
  }
6674
- transform(matrix, resize, transition) {
6675
- transform(this, matrix, resize, transition);
6675
+ transform(matrix, resize, transition, boundsType) {
6676
+ transform(this, matrix, resize, transition, boundsType);
6676
6677
  }
6677
6678
  move(x, y, transition) {
6678
6679
  moveLocal(this, x, y, transition);
@@ -6680,8 +6681,8 @@ exports.Leaf = class Leaf {
6680
6681
  moveInner(x, y, transition) {
6681
6682
  moveWorld(this, x, y, true, transition);
6682
6683
  }
6683
- scaleOf(origin, scaleX, scaleY, resize, transition) {
6684
- zoomOfLocal(this, getLocalOrigin(this, origin), scaleX, scaleY, resize, transition);
6684
+ scaleOf(origin, scaleX, scaleY, resize, transition, boundsType) {
6685
+ zoomOfLocal(this, getLocalOrigin(this, origin), scaleX, scaleY, resize, transition, boundsType);
6685
6686
  }
6686
6687
  rotateOf(origin, rotation, transition) {
6687
6688
  rotateOfLocal(this, getLocalOrigin(this, origin), rotation, transition);
@@ -6689,14 +6690,14 @@ exports.Leaf = class Leaf {
6689
6690
  skewOf(origin, skewX, skewY, resize, transition) {
6690
6691
  skewOfLocal(this, getLocalOrigin(this, origin), skewX, skewY, resize, transition);
6691
6692
  }
6692
- transformWorld(worldTransform, resize, transition) {
6693
- transformWorld(this, worldTransform, resize, transition);
6693
+ transformWorld(worldTransform, resize, transition, boundsType) {
6694
+ transformWorld(this, worldTransform, resize, transition, boundsType);
6694
6695
  }
6695
6696
  moveWorld(x, y, transition) {
6696
6697
  moveWorld(this, x, y, false, transition);
6697
6698
  }
6698
- scaleOfWorld(worldOrigin, scaleX, scaleY, resize, transition) {
6699
- zoomOfWorld(this, worldOrigin, scaleX, scaleY, resize, transition);
6699
+ scaleOfWorld(worldOrigin, scaleX, scaleY, resize, transition, boundsType) {
6700
+ zoomOfWorld(this, worldOrigin, scaleX, scaleY, resize, transition, boundsType);
6700
6701
  }
6701
6702
  rotateOfWorld(worldOrigin, rotation) {
6702
6703
  rotateOfWorld(this, worldOrigin, rotation);
@@ -6707,7 +6708,7 @@ exports.Leaf = class Leaf {
6707
6708
  flip(axis, transition) {
6708
6709
  transform(this, getFlipTransform(this, axis), false, transition);
6709
6710
  }
6710
- scaleResize(scaleX, scaleY = scaleX, _noResize) {
6711
+ scaleResize(scaleX, scaleY = scaleX, _noResize, _boundsType) {
6711
6712
  this.scaleX *= scaleX;
6712
6713
  this.scaleY *= scaleY;
6713
6714
  }
@@ -7082,7 +7083,7 @@ class LeafLevelList {
7082
7083
  }
7083
7084
  }
7084
7085
 
7085
- const version = "2.1.3";
7086
+ const version = "2.1.4";
7086
7087
 
7087
7088
  exports.AlignHelper = AlignHelper;
7088
7089
 
package/lib/core.esm.js CHANGED
@@ -3039,7 +3039,8 @@ const PathConvert = {
3039
3039
  current.length = PathCommandLengthMap[char];
3040
3040
  current.index = 0;
3041
3041
  pushData(data, current.name);
3042
- if (char === "m") current.name = PathCommandMap["l"]; else if (char === "M") current.name = PathCommandMap["L"]; else if (!needConvert && convertCommand[char]) needConvert = true;
3042
+ if (char === "m") current.name = PathCommandMap["l"]; else if (char === "M") current.name = PathCommandMap["L"];
3043
+ if (!needConvert && convertCommand[char]) needConvert = true;
3043
3044
  } else {
3044
3045
  if (char === "-" || char === "+") {
3045
3046
  if (lastChar === "e" || lastChar === "E") {
@@ -3115,8 +3116,8 @@ const PathConvert = {
3115
3116
 
3116
3117
  case S:
3117
3118
  smooth = lastCommand === C$3 || lastCommand === S;
3118
- x1 = smooth ? x * 2 - controlX : old[i + 1];
3119
- y1 = smooth ? y * 2 - controlY : old[i + 2];
3119
+ x1 = smooth ? x * 2 - controlX : x;
3120
+ y1 = smooth ? y * 2 - controlY : y;
3120
3121
  controlX = old[i + 1];
3121
3122
  controlY = old[i + 2];
3122
3123
  x = old[i + 3];
@@ -3150,8 +3151,8 @@ const PathConvert = {
3150
3151
 
3151
3152
  case T:
3152
3153
  smooth = lastCommand === Q$3 || lastCommand === T;
3153
- controlX = smooth ? x * 2 - controlX : old[i + 1];
3154
- controlY = smooth ? y * 2 - controlY : old[i + 2];
3154
+ controlX = smooth ? x * 2 - controlX : x;
3155
+ controlY = smooth ? y * 2 - controlY : y;
3155
3156
  curveMode ? quadraticCurveTo$1(data, x, y, controlX, controlY, old[i + 1], old[i + 2]) : data.push(Q$3, controlX, controlY, old[i + 1], old[i + 2]);
3156
3157
  x = old[i + 1];
3157
3158
  y = old[i + 2];
@@ -4856,10 +4857,10 @@ const LeafHelper = {
4856
4857
  y: y
4857
4858
  }, transition) : (t.x = x, t.y = y);
4858
4859
  },
4859
- zoomOfWorld(t, origin, scaleX, scaleY, resize, transition) {
4860
- L.zoomOfLocal(t, getTempLocal(t, origin), scaleX, scaleY, resize, transition);
4860
+ zoomOfWorld(t, origin, scaleX, scaleY, resize, transition, boundsType) {
4861
+ L.zoomOfLocal(t, getTempLocal(t, origin), scaleX, scaleY, resize, transition, boundsType);
4861
4862
  },
4862
- zoomOfLocal(t, origin, scaleX, scaleY = scaleX, resize, transition) {
4863
+ zoomOfLocal(t, origin, scaleX, scaleY = scaleX, resize, transition, boundsType) {
4863
4864
  const o = t.__localMatrix;
4864
4865
  if (!isNumber(scaleY)) {
4865
4866
  if (scaleY) transition = scaleY;
@@ -4868,7 +4869,7 @@ const LeafHelper = {
4868
4869
  copy$3(matrix, o);
4869
4870
  scaleOfOuter(matrix, origin, scaleX, scaleY);
4870
4871
  if (L.hasHighPosition(t)) {
4871
- L.setTransform(t, matrix, resize, transition);
4872
+ L.setTransform(t, matrix, resize, transition, boundsType);
4872
4873
  } else {
4873
4874
  const x = t.x + matrix.e - o.e, y = t.y + matrix.f - o.f;
4874
4875
  if (transition && !resize) t.animate({
@@ -4876,7 +4877,7 @@ const LeafHelper = {
4876
4877
  y: y,
4877
4878
  scaleX: t.scaleX * scaleX,
4878
4879
  scaleY: t.scaleY * scaleY
4879
- }, transition); else t.x = x, t.y = y, t.scaleResize(scaleX, scaleY, resize !== true);
4880
+ }, transition); else t.x = x, t.y = y, t.scaleResize(scaleX, scaleY, resize !== true, boundsType);
4880
4881
  }
4881
4882
  },
4882
4883
  rotateOfWorld(t, origin, angle, transition) {
@@ -4900,18 +4901,18 @@ const LeafHelper = {
4900
4901
  skewOfOuter(matrix, origin, skewX, skewY);
4901
4902
  L.setTransform(t, matrix, resize, transition);
4902
4903
  },
4903
- transformWorld(t, transform, resize, transition) {
4904
+ transformWorld(t, transform, resize, transition, boundsType) {
4904
4905
  copy$3(matrix, t.worldTransform);
4905
4906
  multiplyParent$2(matrix, transform);
4906
4907
  if (t.parent) divideParent(matrix, t.parent.scrollWorldTransform);
4907
- L.setTransform(t, matrix, resize, transition);
4908
+ L.setTransform(t, matrix, resize, transition, boundsType);
4908
4909
  },
4909
- transform(t, transform, resize, transition) {
4910
+ transform(t, transform, resize, transition, boundsType) {
4910
4911
  copy$3(matrix, t.localTransform);
4911
4912
  multiplyParent$2(matrix, transform);
4912
- L.setTransform(t, matrix, resize, transition);
4913
+ L.setTransform(t, matrix, resize, transition, boundsType);
4913
4914
  },
4914
- setTransform(t, transform, resize, transition) {
4915
+ setTransform(t, transform, resize, transition, boundsType) {
4915
4916
  const data = t.__, originPoint = data.origin && L.getInnerOrigin(t, data.origin);
4916
4917
  const layout = getLayout(transform, originPoint, data.around && L.getInnerOrigin(t, data.around));
4917
4918
  if (L.hasOffset(t)) {
@@ -4927,7 +4928,7 @@ const LeafHelper = {
4927
4928
  PointHelper.move(layout, originPoint.x - changedPoint.x, originPoint.y - changedPoint.y);
4928
4929
  }
4929
4930
  t.set(layout);
4930
- t.scaleResize(scaleX, scaleY, false);
4931
+ t.scaleResize(scaleX, scaleY, false, boundsType);
4931
4932
  } else t.set(layout, transition);
4932
4933
  },
4933
4934
  getFlipTransform(t, axis) {
@@ -6666,11 +6667,11 @@ let Leaf = class Leaf {
6666
6667
  const layer = this.leafer ? this.leafer.zoomLayer : this;
6667
6668
  return layer.getWorldPoint(page, relative, distance, change);
6668
6669
  }
6669
- setTransform(matrix, resize, transition) {
6670
- setTransform(this, matrix, resize, transition);
6670
+ setTransform(matrix, resize, transition, boundsType) {
6671
+ setTransform(this, matrix, resize, transition, boundsType);
6671
6672
  }
6672
- transform(matrix, resize, transition) {
6673
- transform(this, matrix, resize, transition);
6673
+ transform(matrix, resize, transition, boundsType) {
6674
+ transform(this, matrix, resize, transition, boundsType);
6674
6675
  }
6675
6676
  move(x, y, transition) {
6676
6677
  moveLocal(this, x, y, transition);
@@ -6678,8 +6679,8 @@ let Leaf = class Leaf {
6678
6679
  moveInner(x, y, transition) {
6679
6680
  moveWorld(this, x, y, true, transition);
6680
6681
  }
6681
- scaleOf(origin, scaleX, scaleY, resize, transition) {
6682
- zoomOfLocal(this, getLocalOrigin(this, origin), scaleX, scaleY, resize, transition);
6682
+ scaleOf(origin, scaleX, scaleY, resize, transition, boundsType) {
6683
+ zoomOfLocal(this, getLocalOrigin(this, origin), scaleX, scaleY, resize, transition, boundsType);
6683
6684
  }
6684
6685
  rotateOf(origin, rotation, transition) {
6685
6686
  rotateOfLocal(this, getLocalOrigin(this, origin), rotation, transition);
@@ -6687,14 +6688,14 @@ let Leaf = class Leaf {
6687
6688
  skewOf(origin, skewX, skewY, resize, transition) {
6688
6689
  skewOfLocal(this, getLocalOrigin(this, origin), skewX, skewY, resize, transition);
6689
6690
  }
6690
- transformWorld(worldTransform, resize, transition) {
6691
- transformWorld(this, worldTransform, resize, transition);
6691
+ transformWorld(worldTransform, resize, transition, boundsType) {
6692
+ transformWorld(this, worldTransform, resize, transition, boundsType);
6692
6693
  }
6693
6694
  moveWorld(x, y, transition) {
6694
6695
  moveWorld(this, x, y, false, transition);
6695
6696
  }
6696
- scaleOfWorld(worldOrigin, scaleX, scaleY, resize, transition) {
6697
- zoomOfWorld(this, worldOrigin, scaleX, scaleY, resize, transition);
6697
+ scaleOfWorld(worldOrigin, scaleX, scaleY, resize, transition, boundsType) {
6698
+ zoomOfWorld(this, worldOrigin, scaleX, scaleY, resize, transition, boundsType);
6698
6699
  }
6699
6700
  rotateOfWorld(worldOrigin, rotation) {
6700
6701
  rotateOfWorld(this, worldOrigin, rotation);
@@ -6705,7 +6706,7 @@ let Leaf = class Leaf {
6705
6706
  flip(axis, transition) {
6706
6707
  transform(this, getFlipTransform(this, axis), false, transition);
6707
6708
  }
6708
- scaleResize(scaleX, scaleY = scaleX, _noResize) {
6709
+ scaleResize(scaleX, scaleY = scaleX, _noResize, _boundsType) {
6709
6710
  this.scaleX *= scaleX;
6710
6711
  this.scaleY *= scaleY;
6711
6712
  }
@@ -7080,6 +7081,6 @@ class LeafLevelList {
7080
7081
  }
7081
7082
  }
7082
7083
 
7083
- const version = "2.1.3";
7084
+ const version = "2.1.4";
7084
7085
 
7085
7086
  export { AlignHelper, Answer, AroundHelper, AutoBounds, BezierHelper, Bounds, BoundsEvent, BoundsHelper, Branch, BranchHelper, BranchRender, CanvasManager, ChildEvent, Creator, DataHelper, Debug, Direction4, Direction9, EllipseHelper, Event, EventCreator, Eventer, FileHelper, FourNumberHelper, ImageEvent, ImageManager, IncrementId, LayoutEvent, Leaf, LeafBounds, LeafBoundsHelper, LeafData, LeafDataProxy, LeafEventer, LeafHelper, LeafLayout, LeafLevelList, LeafList, LeafMatrix, LeafRender, LeaferCanvasBase, LeaferEvent, LeaferFilm, LeaferImage, LeaferVideo, MathHelper, Matrix, MatrixHelper, NeedConvertToCanvasCommandMap, OneRadian, PI2, PI_2, PathBounds, PathCommandDataHelper, PathCommandMap, PathCommandNodeHelper, PathConvert, PathCorner, PathCreator, PathDrawer, PathHelper, PathNumberCommandLengthMap, PathNumberCommandMap, Platform, Plugin, Point, PointHelper, PropertyEvent, RectHelper, RenderEvent, ResizeEvent, Resource, Run, StringNumberMap, TaskItem, TaskProcessor, TwoPointBoundsHelper, UICreator, UnitConvertHelper, WaitHelper, WatchEvent, affectRenderBoundsType, affectStrokeBoundsType, attr, autoLayoutType, boundsType, canvasPatch, canvasSizeAttrs, createDescriptor, cursorType, dataProcessor, dataType, decorateLeafAttr, defineDataProcessor, defineKey, defineLeafAttr, dimType, doBoundsType, doStrokeType, emptyData, eraserType, extraPropertyEventMap, getBoundsData, getDescriptor, getMatrixData, getPointData, hitType, isArray, isData, isEmptyData, isFinite, isNull, isNumber, isObject, isString, isUndefined, layoutProcessor, leaferTransformAttrMap, maskType, naturalBoundsType, opacityType, path, pathInputType, pathType, pen, positionType, registerUI, registerUIEvent, rewrite, rewriteAble, rotationType, scaleType, scrollType, sortType, strokeType, surfaceType, tempBounds, tempMatrix, tempPoint$2 as tempPoint, tryToNumber, useModule, version, visibleType };