leafer-ui 1.9.5 → 1.9.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.
@@ -372,7 +372,7 @@ function getMatrixData() {
372
372
 
373
373
  const {sin: sin$5, cos: cos$5, acos: acos, sqrt: sqrt$3} = Math;
374
374
 
375
- const {float: float$1} = MathHelper;
375
+ const {float: float$2} = MathHelper;
376
376
 
377
377
  const tempPoint$3 = {};
378
378
 
@@ -614,12 +614,12 @@ const MatrixHelper = {
614
614
  const cosR = c / scaleY;
615
615
  rotation = PI_2 - (d > 0 ? acos(-cosR) : -acos(cosR));
616
616
  }
617
- const cosR = float$1(cos$5(rotation));
617
+ const cosR = float$2(cos$5(rotation));
618
618
  const sinR = sin$5(rotation);
619
- scaleX = float$1(scaleX), scaleY = float$1(scaleY);
620
- skewX = cosR ? float$1((c / scaleY + sinR) / cosR / OneRadian, 9) : 0;
621
- skewY = cosR ? float$1((b / scaleX - sinR) / cosR / OneRadian, 9) : 0;
622
- rotation = float$1(rotation / OneRadian);
619
+ scaleX = float$2(scaleX), scaleY = float$2(scaleY);
620
+ skewX = cosR ? float$2((c / scaleY + sinR) / cosR / OneRadian, 9) : 0;
621
+ skewY = cosR ? float$2((b / scaleX - sinR) / cosR / OneRadian, 9) : 0;
622
+ rotation = float$2(rotation / OneRadian);
623
623
  } else {
624
624
  scaleX = a;
625
625
  scaleY = d;
@@ -1141,7 +1141,7 @@ const {tempPointBounds: tempPointBounds$1, setPoint: setPoint$2, addPoint: addPo
1141
1141
 
1142
1142
  const {toOuterPoint: toOuterPoint$2} = MatrixHelper;
1143
1143
 
1144
- const {float: float, fourNumber: fourNumber} = MathHelper;
1144
+ const {float: float$1, fourNumber: fourNumber} = MathHelper;
1145
1145
 
1146
1146
  const {floor: floor$2, ceil: ceil$2} = Math;
1147
1147
 
@@ -1324,10 +1324,10 @@ const BoundsHelper = {
1324
1324
  }
1325
1325
  },
1326
1326
  float(t, maxLength) {
1327
- t.x = float(t.x, maxLength);
1328
- t.y = float(t.y, maxLength);
1329
- t.width = float(t.width, maxLength);
1330
- t.height = float(t.height, maxLength);
1327
+ t.x = float$1(t.x, maxLength);
1328
+ t.y = float$1(t.y, maxLength);
1329
+ t.width = float$1(t.width, maxLength);
1330
+ t.height = float$1(t.height, maxLength);
1331
1331
  },
1332
1332
  add(t, bounds, isPoint) {
1333
1333
  right$1 = t.x + t.width;
@@ -5463,6 +5463,8 @@ LeaferEvent.RESTART = "leafer.restart";
5463
5463
 
5464
5464
  LeaferEvent.END = "leafer.end";
5465
5465
 
5466
+ LeaferEvent.UPDATE_MODE = "leafer.update_mode";
5467
+
5466
5468
  LeaferEvent.TRANSFORM = "leafer.transform";
5467
5469
 
5468
5470
  LeaferEvent.MOVE = "leafer.move";
@@ -6749,7 +6751,7 @@ class LeafLevelList {
6749
6751
  }
6750
6752
  }
6751
6753
 
6752
- const version = "1.9.5";
6754
+ const version = "1.9.6";
6753
6755
 
6754
6756
  const debug$5 = Debug.get("LeaferCanvas");
6755
6757
 
@@ -7681,7 +7683,7 @@ class Picker {
7681
7683
  item = path.list[i];
7682
7684
  if (!item.__.hittable) break;
7683
7685
  hittablePath.addAt(item, 0);
7684
- if (!item.__.hitChildren) break;
7686
+ if (!item.__.hitChildren || item.isLeafer && item.mode === "draw") break;
7685
7687
  }
7686
7688
  return hittablePath;
7687
7689
  }
@@ -8138,8 +8140,6 @@ class TextData extends UIData {
8138
8140
  if (!boxStyle) box.parent = t, box.__world = t.__world, boxLayout.boxBounds = layout.boxBounds;
8139
8141
  box.set(value);
8140
8142
  if (boxLayout.strokeChanged) layout.strokeChange();
8141
- if (boxLayout.renderChanged) layout.renderChange();
8142
- box.__updateChange();
8143
8143
  } else if (box) {
8144
8144
  t.__box = box.parent = null;
8145
8145
  box.destroy();
@@ -8209,7 +8209,7 @@ const UIBounds = {
8209
8209
  __updateRenderSpread() {
8210
8210
  let width = 0;
8211
8211
  const {shadow: shadow, innerShadow: innerShadow, blur: blur, backgroundBlur: backgroundBlur, filter: filter, renderSpread: renderSpread} = this.__;
8212
- if (shadow) shadow.forEach(item => width = Math.max(width, Math.max(Math.abs(item.y), Math.abs(item.x)) + (item.spread > 0 ? item.spread : 0) + item.blur * 1.5));
8212
+ if (shadow) width = Effect.getShadowSpread(this, shadow);
8213
8213
  if (blur) width = Math.max(width, blur);
8214
8214
  if (filter) width += Filter.getSpread(filter);
8215
8215
  if (renderSpread) width += renderSpread;
@@ -8222,36 +8222,69 @@ const UIBounds = {
8222
8222
  }
8223
8223
  };
8224
8224
 
8225
+ const {float: float} = MathHelper;
8226
+
8227
+ const tempContent = new Bounds, tempMerge = new Bounds, tempIntersect = new Bounds;
8228
+
8225
8229
  const DragBoundsHelper = {
8230
+ limitMove(leaf, move) {
8231
+ const {dragBounds: dragBounds, dragBoundsType: dragBoundsType} = leaf;
8232
+ if (dragBounds) D.getValidMove(leaf.__localBoxBounds, D.getDragBounds(leaf), dragBoundsType, move, true);
8233
+ D.axisMove(leaf, move);
8234
+ },
8235
+ limitScaleOf(leaf, origin, scale) {
8236
+ const {dragBounds: dragBounds, dragBoundsType: dragBoundsType} = leaf;
8237
+ if (dragBounds) D.getValidScaleOf(leaf.__localBoxBounds, D.getDragBounds(leaf), dragBoundsType, leaf.getLocalPointByInner(leaf.getInnerPointByBox(origin)), scale, true);
8238
+ },
8239
+ axisMove(leaf, move) {
8240
+ const {draggable: draggable} = leaf;
8241
+ if (draggable === "x") move.y = 0;
8242
+ if (draggable === "y") move.x = 0;
8243
+ },
8244
+ getDragBounds(leaf) {
8245
+ const {dragBounds: dragBounds} = leaf;
8246
+ return dragBounds === "parent" ? leaf.parent.boxBounds : dragBounds;
8247
+ },
8248
+ isInnerMode(content, dragBounds, dragBoundsType, sideType) {
8249
+ return dragBoundsType === "inner" || dragBoundsType === "auto" && content[sideType] > dragBounds[sideType];
8250
+ },
8226
8251
  getValidMove(content, dragBounds, dragBoundsType, move, change) {
8227
8252
  const x = content.x + move.x, y = content.y + move.y, right = x + content.width, bottom = y + content.height;
8228
8253
  const boundsRight = dragBounds.x + dragBounds.width, boundsBottom = dragBounds.y + dragBounds.height;
8229
8254
  if (!change) move = Object.assign({}, move);
8230
- const isBiggerWidth = content.width > dragBounds.width;
8231
- const isBiggerHeight = content.height > dragBounds.height;
8232
- if (isBiggerWidth && dragBoundsType !== "outer") {
8255
+ if (D.isInnerMode(content, dragBounds, dragBoundsType, "width")) {
8233
8256
  if (x > dragBounds.x) move.x += dragBounds.x - x; else if (right < boundsRight) move.x += boundsRight - right;
8234
8257
  } else {
8235
8258
  if (x < dragBounds.x) move.x += dragBounds.x - x; else if (right > boundsRight) move.x += boundsRight - right;
8236
8259
  }
8237
- if (isBiggerHeight && dragBoundsType !== "outer") {
8260
+ if (D.isInnerMode(content, dragBounds, dragBoundsType, "height")) {
8238
8261
  if (y > dragBounds.y) move.y += dragBounds.y - y; else if (bottom < boundsBottom) move.y += boundsBottom - bottom;
8239
8262
  } else {
8240
8263
  if (y < dragBounds.y) move.y += dragBounds.y - y; else if (bottom > boundsBottom) move.y += boundsBottom - bottom;
8241
8264
  }
8242
- move.x = MathHelper.float(move.x);
8243
- move.y = MathHelper.float(move.y);
8265
+ move.x = float(move.x);
8266
+ move.y = float(move.y);
8244
8267
  return move;
8245
8268
  },
8246
- axisMove(leaf, move) {
8247
- const {draggable: draggable} = leaf;
8248
- if (draggable === "x") move.y = 0;
8249
- if (draggable === "y") move.x = 0;
8250
- },
8251
- limitMove(leaf, move) {
8252
- const {dragBounds: dragBounds, dragBoundsType: dragBoundsType} = leaf;
8253
- if (dragBounds) D.getValidMove(leaf.__localBoxBounds, dragBounds === "parent" ? leaf.parent.boxBounds : dragBounds, dragBoundsType, move, true);
8254
- D.axisMove(leaf, move);
8269
+ getValidScaleOf(content, dragBounds, dragBoundsType, origin, scale, change) {
8270
+ if (!change) scale = Object.assign({}, scale);
8271
+ let fitScaleX, fitScaleY;
8272
+ tempContent.set(content).scaleOf(origin, scale.x, scale.y).unsign();
8273
+ tempMerge.set(tempContent).add(dragBounds);
8274
+ tempIntersect.set(tempContent).intersect(dragBounds);
8275
+ if (D.isInnerMode(content, dragBounds, dragBoundsType, "width")) {
8276
+ fitScaleX = tempMerge.width / tempContent.width;
8277
+ } else {
8278
+ fitScaleX = tempIntersect.width / tempContent.width;
8279
+ }
8280
+ if (D.isInnerMode(content, dragBounds, dragBoundsType, "height")) {
8281
+ fitScaleY = tempMerge.height / tempContent.height;
8282
+ } else {
8283
+ fitScaleY = tempIntersect.height / tempContent.height;
8284
+ }
8285
+ scale.x = float(tempIntersect.width) ? scale.x * fitScaleX : 1;
8286
+ scale.y = float(tempIntersect.height) ? scale.y * fitScaleY : 1;
8287
+ return scale;
8255
8288
  }
8256
8289
  };
8257
8290
 
@@ -8269,7 +8302,7 @@ const UIRender = {
8269
8302
  }
8270
8303
  if (data.__useEffect) {
8271
8304
  const {shadow: shadow, fill: fill, stroke: stroke} = data, otherEffect = data.innerShadow || data.blur || data.backgroundBlur || data.filter;
8272
- stintSet$1(data, "__isFastShadow", shadow && !otherEffect && shadow.length < 2 && !shadow[0].spread && fill && !data.__isTransparentFill && !(isArray(fill) && fill.length > 1) && (this.useFastShadow || !stroke || stroke && data.strokeAlign === "inside"));
8305
+ stintSet$1(data, "__isFastShadow", shadow && !otherEffect && shadow.length < 2 && !shadow[0].spread && !Effect.isTransformShadow(shadow[0]) && fill && !data.__isTransparentFill && !(isArray(fill) && fill.length > 1) && (this.useFastShadow || !stroke || stroke && data.strokeAlign === "inside"));
8273
8306
  data.__useEffect = !!(shadow || otherEffect);
8274
8307
  }
8275
8308
  data.__checkSingle();
@@ -8907,7 +8940,9 @@ let Leafer = Leafer_1 = class Leafer extends Group {
8907
8940
  } else if (attrName === "zIndex") {
8908
8941
  this.canvas.zIndex = newValue;
8909
8942
  setTimeout(() => this.parent && this.parent.__updateSortChildren());
8910
- }
8943
+ } else if (attrName === "mode") this.emit(LeaferEvent.UPDATE_MODE, {
8944
+ mode: newValue
8945
+ });
8911
8946
  }
8912
8947
  return super.__setAttr(attrName, newValue);
8913
8948
  }
@@ -9090,6 +9125,8 @@ __decorate([ dataProcessor(LeaferData) ], Leafer.prototype, "__", void 0);
9090
9125
 
9091
9126
  __decorate([ boundsType() ], Leafer.prototype, "pixelRatio", void 0);
9092
9127
 
9128
+ __decorate([ dataType("normal") ], Leafer.prototype, "mode", void 0);
9129
+
9093
9130
  Leafer = Leafer_1 = __decorate([ registerUI() ], Leafer);
9094
9131
 
9095
9132
  let Rect = class Rect extends UI {
@@ -9282,57 +9319,9 @@ __decorate([ pathType(0) ], Ellipse.prototype, "endAngle", void 0);
9282
9319
 
9283
9320
  Ellipse = __decorate([ registerUI() ], Ellipse);
9284
9321
 
9285
- const {moveTo: moveTo$2, lineTo: lineTo$2, drawPoints: drawPoints$1} = PathCommandDataHelper;
9286
-
9287
- const {rotate: rotate$1, getAngle: getAngle$1, getDistance: getDistance$2, defaultPoint: defaultPoint} = PointHelper;
9288
-
9289
- let Line = class Line extends UI {
9290
- get __tag() {
9291
- return "Line";
9292
- }
9293
- get toPoint() {
9294
- const {width: width, rotation: rotation} = this.__;
9295
- const to = getPointData();
9296
- if (width) to.x = width;
9297
- if (rotation) rotate$1(to, rotation);
9298
- return to;
9299
- }
9300
- set toPoint(value) {
9301
- this.width = getDistance$2(defaultPoint, value);
9302
- this.rotation = getAngle$1(defaultPoint, value);
9303
- if (this.height) this.height = 0;
9304
- }
9305
- __updatePath() {
9306
- const data = this.__;
9307
- const path = data.path = [];
9308
- if (data.points) {
9309
- drawPoints$1(path, data.points, data.curve, data.closed);
9310
- } else {
9311
- moveTo$2(path, 0, 0);
9312
- lineTo$2(path, this.width, 0);
9313
- }
9314
- }
9315
- };
9316
-
9317
- __decorate([ dataProcessor(LineData) ], Line.prototype, "__", void 0);
9318
-
9319
- __decorate([ affectStrokeBoundsType("center") ], Line.prototype, "strokeAlign", void 0);
9320
-
9321
- __decorate([ boundsType(0) ], Line.prototype, "height", void 0);
9322
-
9323
- __decorate([ pathType() ], Line.prototype, "points", void 0);
9324
-
9325
- __decorate([ pathType(0) ], Line.prototype, "curve", void 0);
9326
-
9327
- __decorate([ pathType(false) ], Line.prototype, "closed", void 0);
9328
-
9329
- Line = __decorate([ registerUI() ], Line);
9330
-
9331
9322
  const {sin: sin$1, cos: cos$1, PI: PI$1} = Math;
9332
9323
 
9333
- const {moveTo: moveTo$1, lineTo: lineTo$1, closePath: closePath$1, drawPoints: drawPoints} = PathCommandDataHelper;
9334
-
9335
- const line = Line.prototype;
9324
+ const {moveTo: moveTo$2, lineTo: lineTo$2, closePath: closePath$1, drawPoints: drawPoints$1} = PathCommandDataHelper;
9336
9325
 
9337
9326
  let Polygon = class Polygon extends UI {
9338
9327
  get __tag() {
@@ -9342,19 +9331,17 @@ let Polygon = class Polygon extends UI {
9342
9331
  const data = this.__;
9343
9332
  const path = data.path = [];
9344
9333
  if (data.points) {
9345
- drawPoints(path, data.points, data.curve, true);
9334
+ drawPoints$1(path, data.points, data.curve, true);
9346
9335
  } else {
9347
9336
  const {width: width, height: height, sides: sides} = data;
9348
9337
  const rx = width / 2, ry = height / 2;
9349
- moveTo$1(path, rx, 0);
9338
+ moveTo$2(path, rx, 0);
9350
9339
  for (let i = 1; i < sides; i++) {
9351
- lineTo$1(path, rx + rx * sin$1(i * 2 * PI$1 / sides), ry - ry * cos$1(i * 2 * PI$1 / sides));
9340
+ lineTo$2(path, rx + rx * sin$1(i * 2 * PI$1 / sides), ry - ry * cos$1(i * 2 * PI$1 / sides));
9352
9341
  }
9353
9342
  closePath$1(path);
9354
9343
  }
9355
9344
  }
9356
- __updateRenderPath() {}
9357
- __updateBoxBounds() {}
9358
9345
  };
9359
9346
 
9360
9347
  __decorate([ dataProcessor(PolygonData) ], Polygon.prototype, "__", void 0);
@@ -9365,15 +9352,11 @@ __decorate([ pathType() ], Polygon.prototype, "points", void 0);
9365
9352
 
9366
9353
  __decorate([ pathType(0) ], Polygon.prototype, "curve", void 0);
9367
9354
 
9368
- __decorate([ rewrite(line.__updateRenderPath) ], Polygon.prototype, "__updateRenderPath", null);
9369
-
9370
- __decorate([ rewrite(line.__updateBoxBounds) ], Polygon.prototype, "__updateBoxBounds", null);
9371
-
9372
9355
  Polygon = __decorate([ rewriteAble(), registerUI() ], Polygon);
9373
9356
 
9374
9357
  const {sin: sin, cos: cos, PI: PI} = Math;
9375
9358
 
9376
- const {moveTo: moveTo, lineTo: lineTo, closePath: closePath} = PathCommandDataHelper;
9359
+ const {moveTo: moveTo$1, lineTo: lineTo$1, closePath: closePath} = PathCommandDataHelper;
9377
9360
 
9378
9361
  let Star = class Star extends UI {
9379
9362
  get __tag() {
@@ -9383,9 +9366,9 @@ let Star = class Star extends UI {
9383
9366
  const {width: width, height: height, corners: corners, innerRadius: innerRadius} = this.__;
9384
9367
  const rx = width / 2, ry = height / 2;
9385
9368
  const path = this.__.path = [];
9386
- moveTo(path, rx, 0);
9369
+ moveTo$1(path, rx, 0);
9387
9370
  for (let i = 1; i < corners * 2; i++) {
9388
- lineTo(path, rx + (i % 2 === 0 ? rx : rx * innerRadius) * sin(i * PI / corners), ry - (i % 2 === 0 ? ry : ry * innerRadius) * cos(i * PI / corners));
9371
+ lineTo$1(path, rx + (i % 2 === 0 ? rx : rx * innerRadius) * sin(i * PI / corners), ry - (i % 2 === 0 ? ry : ry * innerRadius) * cos(i * PI / corners));
9389
9372
  }
9390
9373
  closePath(path);
9391
9374
  }
@@ -9399,6 +9382,52 @@ __decorate([ pathType(.382) ], Star.prototype, "innerRadius", void 0);
9399
9382
 
9400
9383
  Star = __decorate([ registerUI() ], Star);
9401
9384
 
9385
+ const {moveTo: moveTo, lineTo: lineTo, drawPoints: drawPoints} = PathCommandDataHelper;
9386
+
9387
+ const {rotate: rotate$1, getAngle: getAngle$1, getDistance: getDistance$2, defaultPoint: defaultPoint} = PointHelper;
9388
+
9389
+ let Line = class Line extends UI {
9390
+ get __tag() {
9391
+ return "Line";
9392
+ }
9393
+ get toPoint() {
9394
+ const {width: width, rotation: rotation} = this.__;
9395
+ const to = getPointData();
9396
+ if (width) to.x = width;
9397
+ if (rotation) rotate$1(to, rotation);
9398
+ return to;
9399
+ }
9400
+ set toPoint(value) {
9401
+ this.width = getDistance$2(defaultPoint, value);
9402
+ this.rotation = getAngle$1(defaultPoint, value);
9403
+ if (this.height) this.height = 0;
9404
+ }
9405
+ __updatePath() {
9406
+ const data = this.__;
9407
+ const path = data.path = [];
9408
+ if (data.points) {
9409
+ drawPoints(path, data.points, data.curve, data.closed);
9410
+ } else {
9411
+ moveTo(path, 0, 0);
9412
+ lineTo(path, this.width, 0);
9413
+ }
9414
+ }
9415
+ };
9416
+
9417
+ __decorate([ dataProcessor(LineData) ], Line.prototype, "__", void 0);
9418
+
9419
+ __decorate([ affectStrokeBoundsType("center") ], Line.prototype, "strokeAlign", void 0);
9420
+
9421
+ __decorate([ boundsType(0) ], Line.prototype, "height", void 0);
9422
+
9423
+ __decorate([ pathType() ], Line.prototype, "points", void 0);
9424
+
9425
+ __decorate([ pathType(0) ], Line.prototype, "curve", void 0);
9426
+
9427
+ __decorate([ pathType(false) ], Line.prototype, "closed", void 0);
9428
+
9429
+ Line = __decorate([ registerUI() ], Line);
9430
+
9402
9431
  let Image$1 = class Image extends Rect {
9403
9432
  get __tag() {
9404
9433
  return "Image";
@@ -9546,10 +9575,6 @@ let Text = class Text extends UI {
9546
9575
  DataHelper.stintSet(this, "isOverflow", !includes(b, contentBounds));
9547
9576
  if (this.isOverflow) setList(data.__textBoxBounds = {}, [ b, contentBounds ]), layout.renderChanged = true; else data.__textBoxBounds = b;
9548
9577
  }
9549
- __onUpdateSize() {
9550
- if (this.__box) this.__box.__onUpdateSize();
9551
- super.__onUpdateSize();
9552
- }
9553
9578
  __updateRenderSpread() {
9554
9579
  let width = super.__updateRenderSpread();
9555
9580
  if (!width) width = this.isOverflow ? 1 : 0;
@@ -9560,6 +9585,11 @@ let Text = class Text extends UI {
9560
9585
  copyAndSpread(renderBounds, this.__.__textBoxBounds, renderSpread);
9561
9586
  if (this.__box) this.__box.__layout.renderBounds = renderBounds;
9562
9587
  }
9588
+ __updateChange() {
9589
+ super.__updateChange();
9590
+ const box = this.__box;
9591
+ if (box) box.__onUpdateSize(), box.__updateChange();
9592
+ }
9563
9593
  __drawRenderPath(canvas) {
9564
9594
  canvas.font = this.__.__font;
9565
9595
  }
@@ -11118,10 +11148,10 @@ canvas.hitPixel = function(radiusPoint, offset, scale = 1) {
11118
11148
 
11119
11149
  const PointerEventHelper = {
11120
11150
  convert(e, local) {
11121
- const base = InteractionHelper.getBase(e);
11151
+ const base = InteractionHelper.getBase(e), {x: x, y: y} = local;
11122
11152
  const data = Object.assign(Object.assign({}, base), {
11123
- x: local.x,
11124
- y: local.y,
11153
+ x: x,
11154
+ y: y,
11125
11155
  width: e.width,
11126
11156
  height: e.height,
11127
11157
  pointerType: e.pointerType,
@@ -11136,10 +11166,10 @@ const PointerEventHelper = {
11136
11166
  return data;
11137
11167
  },
11138
11168
  convertMouse(e, local) {
11139
- const base = InteractionHelper.getBase(e);
11169
+ const base = InteractionHelper.getBase(e), {x: x, y: y} = local;
11140
11170
  return Object.assign(Object.assign({}, base), {
11141
- x: local.x,
11142
- y: local.y,
11171
+ x: x,
11172
+ y: y,
11143
11173
  width: 1,
11144
11174
  height: 1,
11145
11175
  pointerType: "mouse",
@@ -11148,10 +11178,10 @@ const PointerEventHelper = {
11148
11178
  },
11149
11179
  convertTouch(e, local) {
11150
11180
  const touch = PointerEventHelper.getTouch(e);
11151
- const base = InteractionHelper.getBase(e);
11181
+ const base = InteractionHelper.getBase(e), {x: x, y: y} = local;
11152
11182
  return Object.assign(Object.assign({}, base), {
11153
- x: local.x,
11154
- y: local.y,
11183
+ x: x,
11184
+ y: y,
11155
11185
  width: 1,
11156
11186
  height: 1,
11157
11187
  pointerType: "touch",
@@ -12365,12 +12395,18 @@ function shadow(ui, current, shape) {
12365
12395
  }
12366
12396
  worldCanvas ? other.copyWorld(worldCanvas, nowWorld, nowWorld, "destination-out") : other.copyWorld(shape.canvas, shapeBounds, bounds, "destination-out");
12367
12397
  }
12368
- LeafHelper.copyCanvasByWorld(ui, current, other, copyBounds, item.blendMode);
12398
+ if (Effect.isTransformShadow(item)) Effect.renderTransformShadow(ui, current, other, copyBounds, item); else LeafHelper.copyCanvasByWorld(ui, current, other, copyBounds, item.blendMode);
12369
12399
  if (end && index < end) other.clearWorld(copyBounds);
12370
12400
  });
12371
12401
  other.recycle(copyBounds);
12372
12402
  }
12373
12403
 
12404
+ function getShadowSpread(_ui, shadow) {
12405
+ let width = 0;
12406
+ shadow.forEach(item => width = Math.max(width, Math.max(Math.abs(item.y), Math.abs(item.x)) + (item.spread > 0 ? item.spread : 0) + item.blur * 1.5));
12407
+ return width;
12408
+ }
12409
+
12374
12410
  function drawWorldShadow(canvas, outBounds, spreadScale, shape) {
12375
12411
  const {bounds: bounds, shapeBounds: shapeBounds} = shape;
12376
12412
  if (Platform.fullImageShadow) {
@@ -12448,7 +12484,11 @@ const EffectModule = {
12448
12484
  shadow: shadow,
12449
12485
  innerShadow: innerShadow,
12450
12486
  blur: blur,
12451
- backgroundBlur: backgroundBlur
12487
+ backgroundBlur: backgroundBlur,
12488
+ getShadowSpread: getShadowSpread,
12489
+ isTransformShadow(_shadow) {
12490
+ return undefined;
12491
+ }
12452
12492
  };
12453
12493
 
12454
12494
  const {excludeRenderBounds: excludeRenderBounds} = LeafBoundsHelper;
@@ -12956,16 +12996,17 @@ function toTextChar(row) {
12956
12996
  }
12957
12997
 
12958
12998
  function decorationText(drawData, style) {
12959
- let type;
12999
+ let type, offset = 0;
12960
13000
  const {fontSize: fontSize, textDecoration: textDecoration} = style;
12961
13001
  drawData.decorationHeight = fontSize / 11;
12962
13002
  if (isObject(textDecoration)) {
12963
13003
  type = textDecoration.type;
12964
13004
  if (textDecoration.color) drawData.decorationColor = ColorConvert.string(textDecoration.color);
13005
+ if (textDecoration.offset) offset = Math.min(fontSize * .3, Math.max(textDecoration.offset, -fontSize * .15));
12965
13006
  } else type = textDecoration;
12966
13007
  switch (type) {
12967
13008
  case "under":
12968
- drawData.decorationY = [ fontSize * .15 ];
13009
+ drawData.decorationY = [ fontSize * .15 + offset ];
12969
13010
  break;
12970
13011
 
12971
13012
  case "delete":
@@ -12973,7 +13014,7 @@ function decorationText(drawData, style) {
12973
13014
  break;
12974
13015
 
12975
13016
  case "under-delete":
12976
- drawData.decorationY = [ fontSize * .15, -fontSize * .35 ];
13017
+ drawData.decorationY = [ fontSize * .15 + offset, -fontSize * .35 ];
12977
13018
  }
12978
13019
  }
12979
13020