@leafer/core 2.1.5 → 2.1.6

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
@@ -3715,7 +3715,7 @@ const {arcTo: arcTo} = PathCommandDataHelper;
3715
3715
 
3716
3716
  const PathCorner = {
3717
3717
  smooth(data, cornerRadius, _cornerSmoothing) {
3718
- let command, lastCommand, commandLen;
3718
+ let command, lastCommand, commandLen, startXIndex, startYIndex, smoothLen;
3719
3719
  let i = 0, x = 0, y = 0, startX = 0, startY = 0, secondX = 0, secondY = 0, lastX = 0, lastY = 0;
3720
3720
  if (isArray(cornerRadius)) cornerRadius = cornerRadius[0] || 0;
3721
3721
  const len = data.length, three = len === 9;
@@ -3724,6 +3724,11 @@ const PathCorner = {
3724
3724
  command = data[i];
3725
3725
  switch (command) {
3726
3726
  case M:
3727
+ smoothLen = smooth.length;
3728
+ if (smoothLen && lastCommand !== Z) {
3729
+ smooth[startXIndex] = startX;
3730
+ smooth[startYIndex] = startY;
3731
+ }
3727
3732
  startX = lastX = data[i + 1];
3728
3733
  startY = lastY = data[i + 2];
3729
3734
  i += 3;
@@ -3734,6 +3739,8 @@ const PathCorner = {
3734
3739
  } else {
3735
3740
  smooth.push(M, startX, startY);
3736
3741
  }
3742
+ startXIndex = smoothLen + 1;
3743
+ startYIndex = smoothLen + 2;
3737
3744
  break;
3738
3745
 
3739
3746
  case L$1:
@@ -3772,8 +3779,8 @@ const PathCorner = {
3772
3779
  lastCommand = command;
3773
3780
  }
3774
3781
  if (command !== Z) {
3775
- smooth[1] = startX;
3776
- smooth[2] = startY;
3782
+ smooth[startXIndex] = startX;
3783
+ smooth[startYIndex] = startY;
3777
3784
  }
3778
3785
  return smooth;
3779
3786
  }
@@ -6969,7 +6976,7 @@ class LeafLevelList {
6969
6976
  }
6970
6977
  }
6971
6978
 
6972
- const version = "2.1.5";
6979
+ const version = "2.1.6";
6973
6980
 
6974
6981
  exports.AlignHelper = AlignHelper;
6975
6982
 
package/lib/core.esm.js CHANGED
@@ -3713,7 +3713,7 @@ const {arcTo: arcTo} = PathCommandDataHelper;
3713
3713
 
3714
3714
  const PathCorner = {
3715
3715
  smooth(data, cornerRadius, _cornerSmoothing) {
3716
- let command, lastCommand, commandLen;
3716
+ let command, lastCommand, commandLen, startXIndex, startYIndex, smoothLen;
3717
3717
  let i = 0, x = 0, y = 0, startX = 0, startY = 0, secondX = 0, secondY = 0, lastX = 0, lastY = 0;
3718
3718
  if (isArray(cornerRadius)) cornerRadius = cornerRadius[0] || 0;
3719
3719
  const len = data.length, three = len === 9;
@@ -3722,6 +3722,11 @@ const PathCorner = {
3722
3722
  command = data[i];
3723
3723
  switch (command) {
3724
3724
  case M:
3725
+ smoothLen = smooth.length;
3726
+ if (smoothLen && lastCommand !== Z) {
3727
+ smooth[startXIndex] = startX;
3728
+ smooth[startYIndex] = startY;
3729
+ }
3725
3730
  startX = lastX = data[i + 1];
3726
3731
  startY = lastY = data[i + 2];
3727
3732
  i += 3;
@@ -3732,6 +3737,8 @@ const PathCorner = {
3732
3737
  } else {
3733
3738
  smooth.push(M, startX, startY);
3734
3739
  }
3740
+ startXIndex = smoothLen + 1;
3741
+ startYIndex = smoothLen + 2;
3735
3742
  break;
3736
3743
 
3737
3744
  case L$1:
@@ -3770,8 +3777,8 @@ const PathCorner = {
3770
3777
  lastCommand = command;
3771
3778
  }
3772
3779
  if (command !== Z) {
3773
- smooth[1] = startX;
3774
- smooth[2] = startY;
3780
+ smooth[startXIndex] = startX;
3781
+ smooth[startYIndex] = startY;
3775
3782
  }
3776
3783
  return smooth;
3777
3784
  }
@@ -6967,6 +6974,6 @@ class LeafLevelList {
6967
6974
  }
6968
6975
  }
6969
6976
 
6970
- const version = "2.1.5";
6977
+ const version = "2.1.6";
6971
6978
 
6972
6979
  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 };