@leafer/core 2.1.2 → 2.1.3

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,7 @@ const PathConvert = {
3041
3041
  current.length = PathCommandLengthMap[char];
3042
3042
  current.index = 0;
3043
3043
  pushData(data, current.name);
3044
- if (!needConvert && convertCommand[char]) needConvert = true;
3044
+ if (char === "m") current.name = PathCommandMap["l"]; else if (char === "M") current.name = PathCommandMap["L"]; else if (!needConvert && convertCommand[char]) needConvert = true;
3045
3045
  } else {
3046
3046
  if (char === "-" || char === "+") {
3047
3047
  if (lastChar === "e" || lastChar === "E") {
@@ -3073,10 +3073,9 @@ const PathConvert = {
3073
3073
  old[i + 2] += y;
3074
3074
 
3075
3075
  case M$4:
3076
- x = old[i + 1];
3077
- y = old[i + 2];
3078
- if (lastCommand === command) data.push(L$5, x, y); else data.push(M$4, x, y), startX = x,
3079
- startY = y;
3076
+ x = startX = old[i + 1];
3077
+ y = startY = old[i + 2];
3078
+ data.push(M$4, x, y);
3080
3079
  i += 3;
3081
3080
  break;
3082
3081
 
@@ -6077,39 +6076,45 @@ const LeafBounds = {
6077
6076
  this.__updateRenderPath();
6078
6077
  this.__updateBoxBounds();
6079
6078
  layout.resized = "inner";
6080
- if (data.__strokeGeometry) data.__strokeGeometry = undefined;
6081
6079
  }
6082
6080
  if (layout.localBoxChanged) {
6083
6081
  if (this.__local) this.__updateLocalBoxBounds();
6084
6082
  layout.localBoxChanged = undefined;
6085
- if (layout.strokeSpread) layout.strokeChanged = true;
6086
- if (layout.renderSpread) layout.renderChanged = true;
6083
+ if (layout.strokeSpread && !layout.strokeChanged) layout.strokeChanged = layout.boxChanged ? true : 2;
6084
+ if (layout.renderSpread && !layout.renderChanged) layout.renderChanged = layout.boxChanged ? true : 2;
6087
6085
  if (this.parent) this.parent.__layout.boxChange();
6088
6086
  }
6089
6087
  layout.boxChanged = undefined;
6090
6088
  if (layout.strokeChanged) {
6091
- layout.strokeSpread = this.__updateStrokeSpread();
6092
- if (layout.strokeSpread) {
6093
- if (layout.strokeBounds === layout.boxBounds) layout.spreadStroke();
6094
- this.__updateStrokeBounds();
6089
+ if (layout.strokeChanged === 2) {
6095
6090
  this.__updateLocalStrokeBounds();
6096
6091
  } else {
6097
- layout.spreadStrokeCancel();
6092
+ layout.strokeSpread = this.__updateStrokeSpread();
6093
+ if (layout.strokeSpread) {
6094
+ if (layout.strokeBounds === layout.boxBounds) layout.spreadStroke();
6095
+ this.__updateStrokeBounds();
6096
+ this.__updateLocalStrokeBounds();
6097
+ } else {
6098
+ layout.spreadStrokeCancel();
6099
+ }
6100
+ layout.resized = "inner";
6101
+ if (layout.renderSpread || layout.strokeSpread !== layout.strokeBoxSpread) layout.renderChanged = true;
6098
6102
  }
6099
6103
  layout.strokeChanged = undefined;
6100
- if (layout.renderSpread || layout.strokeSpread !== layout.strokeBoxSpread) layout.renderChanged = true;
6101
6104
  if (this.parent) this.parent.__layout.strokeChange();
6102
- layout.resized = "inner";
6103
- if (data.__strokeGeometry) data.__strokeGeometry = undefined;
6104
6105
  }
6105
6106
  if (layout.renderChanged) {
6106
- layout.renderSpread = this.__updateRenderSpread();
6107
- if (layout.renderSpread) {
6108
- if (layout.renderBounds === layout.boxBounds || layout.renderBounds === layout.strokeBounds) layout.spreadRender();
6109
- this.__updateRenderBounds();
6107
+ if (layout.renderChanged === 2) {
6110
6108
  this.__updateLocalRenderBounds();
6111
6109
  } else {
6112
- layout.spreadRenderCancel();
6110
+ layout.renderSpread = this.__updateRenderSpread();
6111
+ if (layout.renderSpread) {
6112
+ if (layout.renderBounds === layout.boxBounds || layout.renderBounds === layout.strokeBounds) layout.spreadRender();
6113
+ this.__updateRenderBounds();
6114
+ this.__updateLocalRenderBounds();
6115
+ } else {
6116
+ layout.spreadRenderCancel();
6117
+ }
6113
6118
  }
6114
6119
  layout.renderChanged = undefined;
6115
6120
  if (this.parent) this.parent.__layout.renderChange();
@@ -7077,7 +7082,7 @@ class LeafLevelList {
7077
7082
  }
7078
7083
  }
7079
7084
 
7080
- const version = "2.1.2";
7085
+ const version = "2.1.3";
7081
7086
 
7082
7087
  exports.AlignHelper = AlignHelper;
7083
7088
 
package/lib/core.esm.js CHANGED
@@ -3039,7 +3039,7 @@ const PathConvert = {
3039
3039
  current.length = PathCommandLengthMap[char];
3040
3040
  current.index = 0;
3041
3041
  pushData(data, current.name);
3042
- if (!needConvert && convertCommand[char]) needConvert = true;
3042
+ if (char === "m") current.name = PathCommandMap["l"]; else if (char === "M") current.name = PathCommandMap["L"]; else if (!needConvert && convertCommand[char]) needConvert = true;
3043
3043
  } else {
3044
3044
  if (char === "-" || char === "+") {
3045
3045
  if (lastChar === "e" || lastChar === "E") {
@@ -3071,10 +3071,9 @@ const PathConvert = {
3071
3071
  old[i + 2] += y;
3072
3072
 
3073
3073
  case M$4:
3074
- x = old[i + 1];
3075
- y = old[i + 2];
3076
- if (lastCommand === command) data.push(L$5, x, y); else data.push(M$4, x, y), startX = x,
3077
- startY = y;
3074
+ x = startX = old[i + 1];
3075
+ y = startY = old[i + 2];
3076
+ data.push(M$4, x, y);
3078
3077
  i += 3;
3079
3078
  break;
3080
3079
 
@@ -6075,39 +6074,45 @@ const LeafBounds = {
6075
6074
  this.__updateRenderPath();
6076
6075
  this.__updateBoxBounds();
6077
6076
  layout.resized = "inner";
6078
- if (data.__strokeGeometry) data.__strokeGeometry = undefined;
6079
6077
  }
6080
6078
  if (layout.localBoxChanged) {
6081
6079
  if (this.__local) this.__updateLocalBoxBounds();
6082
6080
  layout.localBoxChanged = undefined;
6083
- if (layout.strokeSpread) layout.strokeChanged = true;
6084
- if (layout.renderSpread) layout.renderChanged = true;
6081
+ if (layout.strokeSpread && !layout.strokeChanged) layout.strokeChanged = layout.boxChanged ? true : 2;
6082
+ if (layout.renderSpread && !layout.renderChanged) layout.renderChanged = layout.boxChanged ? true : 2;
6085
6083
  if (this.parent) this.parent.__layout.boxChange();
6086
6084
  }
6087
6085
  layout.boxChanged = undefined;
6088
6086
  if (layout.strokeChanged) {
6089
- layout.strokeSpread = this.__updateStrokeSpread();
6090
- if (layout.strokeSpread) {
6091
- if (layout.strokeBounds === layout.boxBounds) layout.spreadStroke();
6092
- this.__updateStrokeBounds();
6087
+ if (layout.strokeChanged === 2) {
6093
6088
  this.__updateLocalStrokeBounds();
6094
6089
  } else {
6095
- layout.spreadStrokeCancel();
6090
+ layout.strokeSpread = this.__updateStrokeSpread();
6091
+ if (layout.strokeSpread) {
6092
+ if (layout.strokeBounds === layout.boxBounds) layout.spreadStroke();
6093
+ this.__updateStrokeBounds();
6094
+ this.__updateLocalStrokeBounds();
6095
+ } else {
6096
+ layout.spreadStrokeCancel();
6097
+ }
6098
+ layout.resized = "inner";
6099
+ if (layout.renderSpread || layout.strokeSpread !== layout.strokeBoxSpread) layout.renderChanged = true;
6096
6100
  }
6097
6101
  layout.strokeChanged = undefined;
6098
- if (layout.renderSpread || layout.strokeSpread !== layout.strokeBoxSpread) layout.renderChanged = true;
6099
6102
  if (this.parent) this.parent.__layout.strokeChange();
6100
- layout.resized = "inner";
6101
- if (data.__strokeGeometry) data.__strokeGeometry = undefined;
6102
6103
  }
6103
6104
  if (layout.renderChanged) {
6104
- layout.renderSpread = this.__updateRenderSpread();
6105
- if (layout.renderSpread) {
6106
- if (layout.renderBounds === layout.boxBounds || layout.renderBounds === layout.strokeBounds) layout.spreadRender();
6107
- this.__updateRenderBounds();
6105
+ if (layout.renderChanged === 2) {
6108
6106
  this.__updateLocalRenderBounds();
6109
6107
  } else {
6110
- layout.spreadRenderCancel();
6108
+ layout.renderSpread = this.__updateRenderSpread();
6109
+ if (layout.renderSpread) {
6110
+ if (layout.renderBounds === layout.boxBounds || layout.renderBounds === layout.strokeBounds) layout.spreadRender();
6111
+ this.__updateRenderBounds();
6112
+ this.__updateLocalRenderBounds();
6113
+ } else {
6114
+ layout.spreadRenderCancel();
6115
+ }
6111
6116
  }
6112
6117
  layout.renderChanged = undefined;
6113
6118
  if (this.parent) this.parent.__layout.renderChange();
@@ -7075,6 +7080,6 @@ class LeafLevelList {
7075
7080
  }
7076
7081
  }
7077
7082
 
7078
- const version = "2.1.2";
7083
+ const version = "2.1.3";
7079
7084
 
7080
7085
  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 };