@leafer/core 2.1.0 → 2.1.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/lib/core.cjs CHANGED
@@ -3063,7 +3063,7 @@ const PathConvert = {
3063
3063
  return needConvert ? PathConvert.toCanvasData(data, curveMode) : data;
3064
3064
  },
3065
3065
  toCanvasData(old, curveMode) {
3066
- let x = 0, y = 0, x1 = 0, y1 = 0, i = 0, len = old.length, controlX, controlY, command, lastCommand, smooth;
3066
+ let x = 0, y = 0, x1 = 0, y1 = 0, startX = 0, startY = 0, i = 0, len = old.length, controlX, controlY, command, lastCommand, smooth;
3067
3067
  const data = [];
3068
3068
  while (i < len) {
3069
3069
  command = old[i];
@@ -3075,7 +3075,8 @@ const PathConvert = {
3075
3075
  case M$4:
3076
3076
  x = old[i + 1];
3077
3077
  y = old[i + 2];
3078
- data.push(M$4, x, y);
3078
+ if (lastCommand === command) data.push(L$5, x, y); else data.push(M$4, x, y), startX = x,
3079
+ startY = y;
3079
3080
  i += 3;
3080
3081
  break;
3081
3082
 
@@ -3190,6 +3191,8 @@ const PathConvert = {
3190
3191
  case z:
3191
3192
  case Z$4:
3192
3193
  data.push(Z$4);
3194
+ x = startX;
3195
+ y = startY;
3193
3196
  i++;
3194
3197
  break;
3195
3198
 
@@ -6068,12 +6071,13 @@ const LeafBounds = {
6068
6071
  if (this.__hasWorldEvent) BoundsEvent.emitWorld(this);
6069
6072
  },
6070
6073
  __updateLocalBounds() {
6071
- const layout = this.__layout;
6074
+ const layout = this.__layout, data = this.__;
6072
6075
  if (layout.boxChanged) {
6073
- if (!this.__.__pathInputed) this.__updatePath();
6076
+ if (!data.__pathInputed) this.__updatePath();
6074
6077
  this.__updateRenderPath();
6075
6078
  this.__updateBoxBounds();
6076
6079
  layout.resized = "inner";
6080
+ if (data.__strokeGeometry) data.__strokeGeometry = undefined;
6077
6081
  }
6078
6082
  if (layout.localBoxChanged) {
6079
6083
  if (this.__local) this.__updateLocalBoxBounds();
@@ -6096,6 +6100,7 @@ const LeafBounds = {
6096
6100
  if (layout.renderSpread || layout.strokeSpread !== layout.strokeBoxSpread) layout.renderChanged = true;
6097
6101
  if (this.parent) this.parent.__layout.strokeChange();
6098
6102
  layout.resized = "inner";
6103
+ if (data.__strokeGeometry) data.__strokeGeometry = undefined;
6099
6104
  }
6100
6105
  if (layout.renderChanged) {
6101
6106
  layout.renderSpread = this.__updateRenderSpread();
@@ -7072,7 +7077,7 @@ class LeafLevelList {
7072
7077
  }
7073
7078
  }
7074
7079
 
7075
- const version = "2.1.0";
7080
+ const version = "2.1.2";
7076
7081
 
7077
7082
  exports.AlignHelper = AlignHelper;
7078
7083
 
package/lib/core.esm.js CHANGED
@@ -3061,7 +3061,7 @@ const PathConvert = {
3061
3061
  return needConvert ? PathConvert.toCanvasData(data, curveMode) : data;
3062
3062
  },
3063
3063
  toCanvasData(old, curveMode) {
3064
- let x = 0, y = 0, x1 = 0, y1 = 0, i = 0, len = old.length, controlX, controlY, command, lastCommand, smooth;
3064
+ let x = 0, y = 0, x1 = 0, y1 = 0, startX = 0, startY = 0, i = 0, len = old.length, controlX, controlY, command, lastCommand, smooth;
3065
3065
  const data = [];
3066
3066
  while (i < len) {
3067
3067
  command = old[i];
@@ -3073,7 +3073,8 @@ const PathConvert = {
3073
3073
  case M$4:
3074
3074
  x = old[i + 1];
3075
3075
  y = old[i + 2];
3076
- data.push(M$4, x, y);
3076
+ if (lastCommand === command) data.push(L$5, x, y); else data.push(M$4, x, y), startX = x,
3077
+ startY = y;
3077
3078
  i += 3;
3078
3079
  break;
3079
3080
 
@@ -3188,6 +3189,8 @@ const PathConvert = {
3188
3189
  case z:
3189
3190
  case Z$4:
3190
3191
  data.push(Z$4);
3192
+ x = startX;
3193
+ y = startY;
3191
3194
  i++;
3192
3195
  break;
3193
3196
 
@@ -6066,12 +6069,13 @@ const LeafBounds = {
6066
6069
  if (this.__hasWorldEvent) BoundsEvent.emitWorld(this);
6067
6070
  },
6068
6071
  __updateLocalBounds() {
6069
- const layout = this.__layout;
6072
+ const layout = this.__layout, data = this.__;
6070
6073
  if (layout.boxChanged) {
6071
- if (!this.__.__pathInputed) this.__updatePath();
6074
+ if (!data.__pathInputed) this.__updatePath();
6072
6075
  this.__updateRenderPath();
6073
6076
  this.__updateBoxBounds();
6074
6077
  layout.resized = "inner";
6078
+ if (data.__strokeGeometry) data.__strokeGeometry = undefined;
6075
6079
  }
6076
6080
  if (layout.localBoxChanged) {
6077
6081
  if (this.__local) this.__updateLocalBoxBounds();
@@ -6094,6 +6098,7 @@ const LeafBounds = {
6094
6098
  if (layout.renderSpread || layout.strokeSpread !== layout.strokeBoxSpread) layout.renderChanged = true;
6095
6099
  if (this.parent) this.parent.__layout.strokeChange();
6096
6100
  layout.resized = "inner";
6101
+ if (data.__strokeGeometry) data.__strokeGeometry = undefined;
6097
6102
  }
6098
6103
  if (layout.renderChanged) {
6099
6104
  layout.renderSpread = this.__updateRenderSpread();
@@ -7070,6 +7075,6 @@ class LeafLevelList {
7070
7075
  }
7071
7076
  }
7072
7077
 
7073
- const version = "2.1.0";
7078
+ const version = "2.1.2";
7074
7079
 
7075
7080
  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 };