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.
- package/dist/web.cjs +26 -15
- package/dist/web.esm.js +27 -16
- package/dist/web.esm.min.js +1 -1
- package/dist/web.esm.min.js.map +1 -1
- package/dist/web.js +138 -99
- package/dist/web.min.cjs +1 -1
- package/dist/web.min.cjs.map +1 -1
- package/dist/web.min.js +1 -1
- package/dist/web.min.js.map +1 -1
- package/dist/web.module.js +153 -112
- package/dist/web.module.min.js +1 -1
- package/dist/web.module.min.js.map +1 -1
- package/package.json +11 -11
package/dist/web.js
CHANGED
|
@@ -344,7 +344,7 @@ var LeaferUI = function(exports) {
|
|
|
344
344
|
};
|
|
345
345
|
}
|
|
346
346
|
const {sin: sin$5, cos: cos$5, acos: acos, sqrt: sqrt$3} = Math;
|
|
347
|
-
const {float: float$
|
|
347
|
+
const {float: float$2} = MathHelper;
|
|
348
348
|
const tempPoint$3 = {};
|
|
349
349
|
function getWorld() {
|
|
350
350
|
return Object.assign(Object.assign(Object.assign({}, getMatrixData()), getBoundsData()), {
|
|
@@ -583,12 +583,12 @@ var LeaferUI = function(exports) {
|
|
|
583
583
|
const cosR = c / scaleY;
|
|
584
584
|
rotation = PI_2 - (d > 0 ? acos(-cosR) : -acos(cosR));
|
|
585
585
|
}
|
|
586
|
-
const cosR = float$
|
|
586
|
+
const cosR = float$2(cos$5(rotation));
|
|
587
587
|
const sinR = sin$5(rotation);
|
|
588
|
-
scaleX = float$
|
|
589
|
-
skewX = cosR ? float$
|
|
590
|
-
skewY = cosR ? float$
|
|
591
|
-
rotation = float$
|
|
588
|
+
scaleX = float$2(scaleX), scaleY = float$2(scaleY);
|
|
589
|
+
skewX = cosR ? float$2((c / scaleY + sinR) / cosR / OneRadian, 9) : 0;
|
|
590
|
+
skewY = cosR ? float$2((b / scaleX - sinR) / cosR / OneRadian, 9) : 0;
|
|
591
|
+
rotation = float$2(rotation / OneRadian);
|
|
592
592
|
} else {
|
|
593
593
|
scaleX = a;
|
|
594
594
|
scaleY = d;
|
|
@@ -1085,7 +1085,7 @@ var LeaferUI = function(exports) {
|
|
|
1085
1085
|
};
|
|
1086
1086
|
const {tempPointBounds: tempPointBounds$1, setPoint: setPoint$2, addPoint: addPoint$2, toBounds: toBounds$2} = TwoPointBoundsHelper;
|
|
1087
1087
|
const {toOuterPoint: toOuterPoint$2} = MatrixHelper;
|
|
1088
|
-
const {float: float, fourNumber: fourNumber} = MathHelper;
|
|
1088
|
+
const {float: float$1, fourNumber: fourNumber} = MathHelper;
|
|
1089
1089
|
const {floor: floor$2, ceil: ceil$2} = Math;
|
|
1090
1090
|
let right$1, bottom$1, boundsRight, boundsBottom;
|
|
1091
1091
|
const point = {};
|
|
@@ -1262,10 +1262,10 @@ var LeaferUI = function(exports) {
|
|
|
1262
1262
|
}
|
|
1263
1263
|
},
|
|
1264
1264
|
float(t, maxLength) {
|
|
1265
|
-
t.x = float(t.x, maxLength);
|
|
1266
|
-
t.y = float(t.y, maxLength);
|
|
1267
|
-
t.width = float(t.width, maxLength);
|
|
1268
|
-
t.height = float(t.height, maxLength);
|
|
1265
|
+
t.x = float$1(t.x, maxLength);
|
|
1266
|
+
t.y = float$1(t.y, maxLength);
|
|
1267
|
+
t.width = float$1(t.width, maxLength);
|
|
1268
|
+
t.height = float$1(t.height, maxLength);
|
|
1269
1269
|
},
|
|
1270
1270
|
add(t, bounds, isPoint) {
|
|
1271
1271
|
right$1 = t.x + t.width;
|
|
@@ -5105,6 +5105,7 @@ var LeaferUI = function(exports) {
|
|
|
5105
5105
|
LeaferEvent.STOP = "leafer.stop";
|
|
5106
5106
|
LeaferEvent.RESTART = "leafer.restart";
|
|
5107
5107
|
LeaferEvent.END = "leafer.end";
|
|
5108
|
+
LeaferEvent.UPDATE_MODE = "leafer.update_mode";
|
|
5108
5109
|
LeaferEvent.TRANSFORM = "leafer.transform";
|
|
5109
5110
|
LeaferEvent.MOVE = "leafer.move";
|
|
5110
5111
|
LeaferEvent.SCALE = "leafer.scale";
|
|
@@ -6350,7 +6351,7 @@ var LeaferUI = function(exports) {
|
|
|
6350
6351
|
this.levelMap = null;
|
|
6351
6352
|
}
|
|
6352
6353
|
}
|
|
6353
|
-
const version = "1.9.
|
|
6354
|
+
const version = "1.9.6";
|
|
6354
6355
|
const debug$5 = Debug.get("LeaferCanvas");
|
|
6355
6356
|
class LeaferCanvas extends LeaferCanvasBase {
|
|
6356
6357
|
set zIndex(zIndex) {
|
|
@@ -7252,7 +7253,7 @@ var LeaferUI = function(exports) {
|
|
|
7252
7253
|
item = path.list[i];
|
|
7253
7254
|
if (!item.__.hittable) break;
|
|
7254
7255
|
hittablePath.addAt(item, 0);
|
|
7255
|
-
if (!item.__.hitChildren) break;
|
|
7256
|
+
if (!item.__.hitChildren || item.isLeafer && item.mode === "draw") break;
|
|
7256
7257
|
}
|
|
7257
7258
|
return hittablePath;
|
|
7258
7259
|
}
|
|
@@ -7670,8 +7671,6 @@ var LeaferUI = function(exports) {
|
|
|
7670
7671
|
if (!boxStyle) box.parent = t, box.__world = t.__world, boxLayout.boxBounds = layout.boxBounds;
|
|
7671
7672
|
box.set(value);
|
|
7672
7673
|
if (boxLayout.strokeChanged) layout.strokeChange();
|
|
7673
|
-
if (boxLayout.renderChanged) layout.renderChange();
|
|
7674
|
-
box.__updateChange();
|
|
7675
7674
|
} else if (box) {
|
|
7676
7675
|
t.__box = box.parent = null;
|
|
7677
7676
|
box.destroy();
|
|
@@ -7738,7 +7737,7 @@ var LeaferUI = function(exports) {
|
|
|
7738
7737
|
__updateRenderSpread() {
|
|
7739
7738
|
let width = 0;
|
|
7740
7739
|
const {shadow: shadow, innerShadow: innerShadow, blur: blur, backgroundBlur: backgroundBlur, filter: filter, renderSpread: renderSpread} = this.__;
|
|
7741
|
-
if (shadow)
|
|
7740
|
+
if (shadow) width = Effect.getShadowSpread(this, shadow);
|
|
7742
7741
|
if (blur) width = Math.max(width, blur);
|
|
7743
7742
|
if (filter) width += Filter.getSpread(filter);
|
|
7744
7743
|
if (renderSpread) width += renderSpread;
|
|
@@ -7750,36 +7749,67 @@ var LeaferUI = function(exports) {
|
|
|
7750
7749
|
return this.__box ? Math.max(this.__box.__updateRenderSpread(), width) : width;
|
|
7751
7750
|
}
|
|
7752
7751
|
};
|
|
7752
|
+
const {float: float} = MathHelper;
|
|
7753
|
+
const tempContent = new Bounds, tempMerge = new Bounds, tempIntersect = new Bounds;
|
|
7753
7754
|
const DragBoundsHelper = {
|
|
7755
|
+
limitMove(leaf, move) {
|
|
7756
|
+
const {dragBounds: dragBounds, dragBoundsType: dragBoundsType} = leaf;
|
|
7757
|
+
if (dragBounds) D.getValidMove(leaf.__localBoxBounds, D.getDragBounds(leaf), dragBoundsType, move, true);
|
|
7758
|
+
D.axisMove(leaf, move);
|
|
7759
|
+
},
|
|
7760
|
+
limitScaleOf(leaf, origin, scale) {
|
|
7761
|
+
const {dragBounds: dragBounds, dragBoundsType: dragBoundsType} = leaf;
|
|
7762
|
+
if (dragBounds) D.getValidScaleOf(leaf.__localBoxBounds, D.getDragBounds(leaf), dragBoundsType, leaf.getLocalPointByInner(leaf.getInnerPointByBox(origin)), scale, true);
|
|
7763
|
+
},
|
|
7764
|
+
axisMove(leaf, move) {
|
|
7765
|
+
const {draggable: draggable} = leaf;
|
|
7766
|
+
if (draggable === "x") move.y = 0;
|
|
7767
|
+
if (draggable === "y") move.x = 0;
|
|
7768
|
+
},
|
|
7769
|
+
getDragBounds(leaf) {
|
|
7770
|
+
const {dragBounds: dragBounds} = leaf;
|
|
7771
|
+
return dragBounds === "parent" ? leaf.parent.boxBounds : dragBounds;
|
|
7772
|
+
},
|
|
7773
|
+
isInnerMode(content, dragBounds, dragBoundsType, sideType) {
|
|
7774
|
+
return dragBoundsType === "inner" || dragBoundsType === "auto" && content[sideType] > dragBounds[sideType];
|
|
7775
|
+
},
|
|
7754
7776
|
getValidMove(content, dragBounds, dragBoundsType, move, change) {
|
|
7755
7777
|
const x = content.x + move.x, y = content.y + move.y, right = x + content.width, bottom = y + content.height;
|
|
7756
7778
|
const boundsRight = dragBounds.x + dragBounds.width, boundsBottom = dragBounds.y + dragBounds.height;
|
|
7757
7779
|
if (!change) move = Object.assign({}, move);
|
|
7758
|
-
|
|
7759
|
-
const isBiggerHeight = content.height > dragBounds.height;
|
|
7760
|
-
if (isBiggerWidth && dragBoundsType !== "outer") {
|
|
7780
|
+
if (D.isInnerMode(content, dragBounds, dragBoundsType, "width")) {
|
|
7761
7781
|
if (x > dragBounds.x) move.x += dragBounds.x - x; else if (right < boundsRight) move.x += boundsRight - right;
|
|
7762
7782
|
} else {
|
|
7763
7783
|
if (x < dragBounds.x) move.x += dragBounds.x - x; else if (right > boundsRight) move.x += boundsRight - right;
|
|
7764
7784
|
}
|
|
7765
|
-
if (
|
|
7785
|
+
if (D.isInnerMode(content, dragBounds, dragBoundsType, "height")) {
|
|
7766
7786
|
if (y > dragBounds.y) move.y += dragBounds.y - y; else if (bottom < boundsBottom) move.y += boundsBottom - bottom;
|
|
7767
7787
|
} else {
|
|
7768
7788
|
if (y < dragBounds.y) move.y += dragBounds.y - y; else if (bottom > boundsBottom) move.y += boundsBottom - bottom;
|
|
7769
7789
|
}
|
|
7770
|
-
move.x =
|
|
7771
|
-
move.y =
|
|
7790
|
+
move.x = float(move.x);
|
|
7791
|
+
move.y = float(move.y);
|
|
7772
7792
|
return move;
|
|
7773
7793
|
},
|
|
7774
|
-
|
|
7775
|
-
|
|
7776
|
-
|
|
7777
|
-
|
|
7778
|
-
|
|
7779
|
-
|
|
7780
|
-
|
|
7781
|
-
|
|
7782
|
-
|
|
7794
|
+
getValidScaleOf(content, dragBounds, dragBoundsType, origin, scale, change) {
|
|
7795
|
+
if (!change) scale = Object.assign({}, scale);
|
|
7796
|
+
let fitScaleX, fitScaleY;
|
|
7797
|
+
tempContent.set(content).scaleOf(origin, scale.x, scale.y).unsign();
|
|
7798
|
+
tempMerge.set(tempContent).add(dragBounds);
|
|
7799
|
+
tempIntersect.set(tempContent).intersect(dragBounds);
|
|
7800
|
+
if (D.isInnerMode(content, dragBounds, dragBoundsType, "width")) {
|
|
7801
|
+
fitScaleX = tempMerge.width / tempContent.width;
|
|
7802
|
+
} else {
|
|
7803
|
+
fitScaleX = tempIntersect.width / tempContent.width;
|
|
7804
|
+
}
|
|
7805
|
+
if (D.isInnerMode(content, dragBounds, dragBoundsType, "height")) {
|
|
7806
|
+
fitScaleY = tempMerge.height / tempContent.height;
|
|
7807
|
+
} else {
|
|
7808
|
+
fitScaleY = tempIntersect.height / tempContent.height;
|
|
7809
|
+
}
|
|
7810
|
+
scale.x = float(tempIntersect.width) ? scale.x * fitScaleX : 1;
|
|
7811
|
+
scale.y = float(tempIntersect.height) ? scale.y * fitScaleY : 1;
|
|
7812
|
+
return scale;
|
|
7783
7813
|
}
|
|
7784
7814
|
};
|
|
7785
7815
|
const D = DragBoundsHelper;
|
|
@@ -7794,7 +7824,7 @@ var LeaferUI = function(exports) {
|
|
|
7794
7824
|
}
|
|
7795
7825
|
if (data.__useEffect) {
|
|
7796
7826
|
const {shadow: shadow, fill: fill, stroke: stroke} = data, otherEffect = data.innerShadow || data.blur || data.backgroundBlur || data.filter;
|
|
7797
|
-
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"));
|
|
7827
|
+
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"));
|
|
7798
7828
|
data.__useEffect = !!(shadow || otherEffect);
|
|
7799
7829
|
}
|
|
7800
7830
|
data.__checkSingle();
|
|
@@ -8346,7 +8376,9 @@ var LeaferUI = function(exports) {
|
|
|
8346
8376
|
} else if (attrName === "zIndex") {
|
|
8347
8377
|
this.canvas.zIndex = newValue;
|
|
8348
8378
|
setTimeout(() => this.parent && this.parent.__updateSortChildren());
|
|
8349
|
-
}
|
|
8379
|
+
} else if (attrName === "mode") this.emit(LeaferEvent.UPDATE_MODE, {
|
|
8380
|
+
mode: newValue
|
|
8381
|
+
});
|
|
8350
8382
|
}
|
|
8351
8383
|
return super.__setAttr(attrName, newValue);
|
|
8352
8384
|
}
|
|
@@ -8525,6 +8557,7 @@ var LeaferUI = function(exports) {
|
|
|
8525
8557
|
exports.Leafer.list = new LeafList;
|
|
8526
8558
|
__decorate([ dataProcessor(LeaferData) ], exports.Leafer.prototype, "__", void 0);
|
|
8527
8559
|
__decorate([ boundsType() ], exports.Leafer.prototype, "pixelRatio", void 0);
|
|
8560
|
+
__decorate([ dataType("normal") ], exports.Leafer.prototype, "mode", void 0);
|
|
8528
8561
|
exports.Leafer = Leafer_1 = __decorate([ registerUI() ], exports.Leafer);
|
|
8529
8562
|
exports.Rect = class Rect extends exports.UI {
|
|
8530
8563
|
get __tag() {
|
|
@@ -8684,45 +8717,8 @@ var LeaferUI = function(exports) {
|
|
|
8684
8717
|
__decorate([ pathType(0) ], exports.Ellipse.prototype, "startAngle", void 0);
|
|
8685
8718
|
__decorate([ pathType(0) ], exports.Ellipse.prototype, "endAngle", void 0);
|
|
8686
8719
|
exports.Ellipse = __decorate([ registerUI() ], exports.Ellipse);
|
|
8687
|
-
const {moveTo: moveTo$2, lineTo: lineTo$2, drawPoints: drawPoints$1} = PathCommandDataHelper;
|
|
8688
|
-
const {rotate: rotate$1, getAngle: getAngle$1, getDistance: getDistance$2, defaultPoint: defaultPoint} = PointHelper;
|
|
8689
|
-
exports.Line = class Line extends exports.UI {
|
|
8690
|
-
get __tag() {
|
|
8691
|
-
return "Line";
|
|
8692
|
-
}
|
|
8693
|
-
get toPoint() {
|
|
8694
|
-
const {width: width, rotation: rotation} = this.__;
|
|
8695
|
-
const to = getPointData();
|
|
8696
|
-
if (width) to.x = width;
|
|
8697
|
-
if (rotation) rotate$1(to, rotation);
|
|
8698
|
-
return to;
|
|
8699
|
-
}
|
|
8700
|
-
set toPoint(value) {
|
|
8701
|
-
this.width = getDistance$2(defaultPoint, value);
|
|
8702
|
-
this.rotation = getAngle$1(defaultPoint, value);
|
|
8703
|
-
if (this.height) this.height = 0;
|
|
8704
|
-
}
|
|
8705
|
-
__updatePath() {
|
|
8706
|
-
const data = this.__;
|
|
8707
|
-
const path = data.path = [];
|
|
8708
|
-
if (data.points) {
|
|
8709
|
-
drawPoints$1(path, data.points, data.curve, data.closed);
|
|
8710
|
-
} else {
|
|
8711
|
-
moveTo$2(path, 0, 0);
|
|
8712
|
-
lineTo$2(path, this.width, 0);
|
|
8713
|
-
}
|
|
8714
|
-
}
|
|
8715
|
-
};
|
|
8716
|
-
__decorate([ dataProcessor(LineData) ], exports.Line.prototype, "__", void 0);
|
|
8717
|
-
__decorate([ affectStrokeBoundsType("center") ], exports.Line.prototype, "strokeAlign", void 0);
|
|
8718
|
-
__decorate([ boundsType(0) ], exports.Line.prototype, "height", void 0);
|
|
8719
|
-
__decorate([ pathType() ], exports.Line.prototype, "points", void 0);
|
|
8720
|
-
__decorate([ pathType(0) ], exports.Line.prototype, "curve", void 0);
|
|
8721
|
-
__decorate([ pathType(false) ], exports.Line.prototype, "closed", void 0);
|
|
8722
|
-
exports.Line = __decorate([ registerUI() ], exports.Line);
|
|
8723
8720
|
const {sin: sin$1, cos: cos$1, PI: PI$1} = Math;
|
|
8724
|
-
const {moveTo: moveTo$
|
|
8725
|
-
const line = exports.Line.prototype;
|
|
8721
|
+
const {moveTo: moveTo$2, lineTo: lineTo$2, closePath: closePath$1, drawPoints: drawPoints$1} = PathCommandDataHelper;
|
|
8726
8722
|
exports.Polygon = class Polygon extends exports.UI {
|
|
8727
8723
|
get __tag() {
|
|
8728
8724
|
return "Polygon";
|
|
@@ -8731,29 +8727,25 @@ var LeaferUI = function(exports) {
|
|
|
8731
8727
|
const data = this.__;
|
|
8732
8728
|
const path = data.path = [];
|
|
8733
8729
|
if (data.points) {
|
|
8734
|
-
drawPoints(path, data.points, data.curve, true);
|
|
8730
|
+
drawPoints$1(path, data.points, data.curve, true);
|
|
8735
8731
|
} else {
|
|
8736
8732
|
const {width: width, height: height, sides: sides} = data;
|
|
8737
8733
|
const rx = width / 2, ry = height / 2;
|
|
8738
|
-
moveTo$
|
|
8734
|
+
moveTo$2(path, rx, 0);
|
|
8739
8735
|
for (let i = 1; i < sides; i++) {
|
|
8740
|
-
lineTo$
|
|
8736
|
+
lineTo$2(path, rx + rx * sin$1(i * 2 * PI$1 / sides), ry - ry * cos$1(i * 2 * PI$1 / sides));
|
|
8741
8737
|
}
|
|
8742
8738
|
closePath$1(path);
|
|
8743
8739
|
}
|
|
8744
8740
|
}
|
|
8745
|
-
__updateRenderPath() {}
|
|
8746
|
-
__updateBoxBounds() {}
|
|
8747
8741
|
};
|
|
8748
8742
|
__decorate([ dataProcessor(PolygonData) ], exports.Polygon.prototype, "__", void 0);
|
|
8749
8743
|
__decorate([ pathType(3) ], exports.Polygon.prototype, "sides", void 0);
|
|
8750
8744
|
__decorate([ pathType() ], exports.Polygon.prototype, "points", void 0);
|
|
8751
8745
|
__decorate([ pathType(0) ], exports.Polygon.prototype, "curve", void 0);
|
|
8752
|
-
__decorate([ rewrite(line.__updateRenderPath) ], exports.Polygon.prototype, "__updateRenderPath", null);
|
|
8753
|
-
__decorate([ rewrite(line.__updateBoxBounds) ], exports.Polygon.prototype, "__updateBoxBounds", null);
|
|
8754
8746
|
exports.Polygon = __decorate([ rewriteAble(), registerUI() ], exports.Polygon);
|
|
8755
8747
|
const {sin: sin, cos: cos, PI: PI} = Math;
|
|
8756
|
-
const {moveTo: moveTo, lineTo: lineTo, closePath: closePath} = PathCommandDataHelper;
|
|
8748
|
+
const {moveTo: moveTo$1, lineTo: lineTo$1, closePath: closePath} = PathCommandDataHelper;
|
|
8757
8749
|
exports.Star = class Star extends exports.UI {
|
|
8758
8750
|
get __tag() {
|
|
8759
8751
|
return "Star";
|
|
@@ -8762,9 +8754,9 @@ var LeaferUI = function(exports) {
|
|
|
8762
8754
|
const {width: width, height: height, corners: corners, innerRadius: innerRadius} = this.__;
|
|
8763
8755
|
const rx = width / 2, ry = height / 2;
|
|
8764
8756
|
const path = this.__.path = [];
|
|
8765
|
-
moveTo(path, rx, 0);
|
|
8757
|
+
moveTo$1(path, rx, 0);
|
|
8766
8758
|
for (let i = 1; i < corners * 2; i++) {
|
|
8767
|
-
lineTo(path, rx + (i % 2 === 0 ? rx : rx * innerRadius) * sin(i * PI / corners), ry - (i % 2 === 0 ? ry : ry * innerRadius) * cos(i * PI / corners));
|
|
8759
|
+
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));
|
|
8768
8760
|
}
|
|
8769
8761
|
closePath(path);
|
|
8770
8762
|
}
|
|
@@ -8773,6 +8765,42 @@ var LeaferUI = function(exports) {
|
|
|
8773
8765
|
__decorate([ pathType(5) ], exports.Star.prototype, "corners", void 0);
|
|
8774
8766
|
__decorate([ pathType(.382) ], exports.Star.prototype, "innerRadius", void 0);
|
|
8775
8767
|
exports.Star = __decorate([ registerUI() ], exports.Star);
|
|
8768
|
+
const {moveTo: moveTo, lineTo: lineTo, drawPoints: drawPoints} = PathCommandDataHelper;
|
|
8769
|
+
const {rotate: rotate$1, getAngle: getAngle$1, getDistance: getDistance$2, defaultPoint: defaultPoint} = PointHelper;
|
|
8770
|
+
exports.Line = class Line extends exports.UI {
|
|
8771
|
+
get __tag() {
|
|
8772
|
+
return "Line";
|
|
8773
|
+
}
|
|
8774
|
+
get toPoint() {
|
|
8775
|
+
const {width: width, rotation: rotation} = this.__;
|
|
8776
|
+
const to = getPointData();
|
|
8777
|
+
if (width) to.x = width;
|
|
8778
|
+
if (rotation) rotate$1(to, rotation);
|
|
8779
|
+
return to;
|
|
8780
|
+
}
|
|
8781
|
+
set toPoint(value) {
|
|
8782
|
+
this.width = getDistance$2(defaultPoint, value);
|
|
8783
|
+
this.rotation = getAngle$1(defaultPoint, value);
|
|
8784
|
+
if (this.height) this.height = 0;
|
|
8785
|
+
}
|
|
8786
|
+
__updatePath() {
|
|
8787
|
+
const data = this.__;
|
|
8788
|
+
const path = data.path = [];
|
|
8789
|
+
if (data.points) {
|
|
8790
|
+
drawPoints(path, data.points, data.curve, data.closed);
|
|
8791
|
+
} else {
|
|
8792
|
+
moveTo(path, 0, 0);
|
|
8793
|
+
lineTo(path, this.width, 0);
|
|
8794
|
+
}
|
|
8795
|
+
}
|
|
8796
|
+
};
|
|
8797
|
+
__decorate([ dataProcessor(LineData) ], exports.Line.prototype, "__", void 0);
|
|
8798
|
+
__decorate([ affectStrokeBoundsType("center") ], exports.Line.prototype, "strokeAlign", void 0);
|
|
8799
|
+
__decorate([ boundsType(0) ], exports.Line.prototype, "height", void 0);
|
|
8800
|
+
__decorate([ pathType() ], exports.Line.prototype, "points", void 0);
|
|
8801
|
+
__decorate([ pathType(0) ], exports.Line.prototype, "curve", void 0);
|
|
8802
|
+
__decorate([ pathType(false) ], exports.Line.prototype, "closed", void 0);
|
|
8803
|
+
exports.Line = __decorate([ registerUI() ], exports.Line);
|
|
8776
8804
|
exports.Image = class Image extends exports.Rect {
|
|
8777
8805
|
get __tag() {
|
|
8778
8806
|
return "Image";
|
|
@@ -8905,10 +8933,6 @@ var LeaferUI = function(exports) {
|
|
|
8905
8933
|
DataHelper.stintSet(this, "isOverflow", !includes(b, contentBounds));
|
|
8906
8934
|
if (this.isOverflow) setList(data.__textBoxBounds = {}, [ b, contentBounds ]), layout.renderChanged = true; else data.__textBoxBounds = b;
|
|
8907
8935
|
}
|
|
8908
|
-
__onUpdateSize() {
|
|
8909
|
-
if (this.__box) this.__box.__onUpdateSize();
|
|
8910
|
-
super.__onUpdateSize();
|
|
8911
|
-
}
|
|
8912
8936
|
__updateRenderSpread() {
|
|
8913
8937
|
let width = super.__updateRenderSpread();
|
|
8914
8938
|
if (!width) width = this.isOverflow ? 1 : 0;
|
|
@@ -8919,6 +8943,11 @@ var LeaferUI = function(exports) {
|
|
|
8919
8943
|
copyAndSpread(renderBounds, this.__.__textBoxBounds, renderSpread);
|
|
8920
8944
|
if (this.__box) this.__box.__layout.renderBounds = renderBounds;
|
|
8921
8945
|
}
|
|
8946
|
+
__updateChange() {
|
|
8947
|
+
super.__updateChange();
|
|
8948
|
+
const box = this.__box;
|
|
8949
|
+
if (box) box.__onUpdateSize(), box.__updateChange();
|
|
8950
|
+
}
|
|
8922
8951
|
__drawRenderPath(canvas) {
|
|
8923
8952
|
canvas.font = this.__.__font;
|
|
8924
8953
|
}
|
|
@@ -10323,10 +10352,10 @@ var LeaferUI = function(exports) {
|
|
|
10323
10352
|
};
|
|
10324
10353
|
const PointerEventHelper = {
|
|
10325
10354
|
convert(e, local) {
|
|
10326
|
-
const base = InteractionHelper.getBase(e);
|
|
10355
|
+
const base = InteractionHelper.getBase(e), {x: x, y: y} = local;
|
|
10327
10356
|
const data = Object.assign(Object.assign({}, base), {
|
|
10328
|
-
x:
|
|
10329
|
-
y:
|
|
10357
|
+
x: x,
|
|
10358
|
+
y: y,
|
|
10330
10359
|
width: e.width,
|
|
10331
10360
|
height: e.height,
|
|
10332
10361
|
pointerType: e.pointerType,
|
|
@@ -10341,10 +10370,10 @@ var LeaferUI = function(exports) {
|
|
|
10341
10370
|
return data;
|
|
10342
10371
|
},
|
|
10343
10372
|
convertMouse(e, local) {
|
|
10344
|
-
const base = InteractionHelper.getBase(e);
|
|
10373
|
+
const base = InteractionHelper.getBase(e), {x: x, y: y} = local;
|
|
10345
10374
|
return Object.assign(Object.assign({}, base), {
|
|
10346
|
-
x:
|
|
10347
|
-
y:
|
|
10375
|
+
x: x,
|
|
10376
|
+
y: y,
|
|
10348
10377
|
width: 1,
|
|
10349
10378
|
height: 1,
|
|
10350
10379
|
pointerType: "mouse",
|
|
@@ -10353,10 +10382,10 @@ var LeaferUI = function(exports) {
|
|
|
10353
10382
|
},
|
|
10354
10383
|
convertTouch(e, local) {
|
|
10355
10384
|
const touch = PointerEventHelper.getTouch(e);
|
|
10356
|
-
const base = InteractionHelper.getBase(e);
|
|
10385
|
+
const base = InteractionHelper.getBase(e), {x: x, y: y} = local;
|
|
10357
10386
|
return Object.assign(Object.assign({}, base), {
|
|
10358
|
-
x:
|
|
10359
|
-
y:
|
|
10387
|
+
x: x,
|
|
10388
|
+
y: y,
|
|
10360
10389
|
width: 1,
|
|
10361
10390
|
height: 1,
|
|
10362
10391
|
pointerType: "touch",
|
|
@@ -11494,11 +11523,16 @@ var LeaferUI = function(exports) {
|
|
|
11494
11523
|
}
|
|
11495
11524
|
worldCanvas ? other.copyWorld(worldCanvas, nowWorld, nowWorld, "destination-out") : other.copyWorld(shape.canvas, shapeBounds, bounds, "destination-out");
|
|
11496
11525
|
}
|
|
11497
|
-
LeafHelper.copyCanvasByWorld(ui, current, other, copyBounds, item.blendMode);
|
|
11526
|
+
if (Effect.isTransformShadow(item)) Effect.renderTransformShadow(ui, current, other, copyBounds, item); else LeafHelper.copyCanvasByWorld(ui, current, other, copyBounds, item.blendMode);
|
|
11498
11527
|
if (end && index < end) other.clearWorld(copyBounds);
|
|
11499
11528
|
});
|
|
11500
11529
|
other.recycle(copyBounds);
|
|
11501
11530
|
}
|
|
11531
|
+
function getShadowSpread(_ui, shadow) {
|
|
11532
|
+
let width = 0;
|
|
11533
|
+
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));
|
|
11534
|
+
return width;
|
|
11535
|
+
}
|
|
11502
11536
|
function drawWorldShadow(canvas, outBounds, spreadScale, shape) {
|
|
11503
11537
|
const {bounds: bounds, shapeBounds: shapeBounds} = shape;
|
|
11504
11538
|
if (Platform.fullImageShadow) {
|
|
@@ -11570,7 +11604,11 @@ var LeaferUI = function(exports) {
|
|
|
11570
11604
|
shadow: shadow,
|
|
11571
11605
|
innerShadow: innerShadow,
|
|
11572
11606
|
blur: blur,
|
|
11573
|
-
backgroundBlur: backgroundBlur
|
|
11607
|
+
backgroundBlur: backgroundBlur,
|
|
11608
|
+
getShadowSpread: getShadowSpread,
|
|
11609
|
+
isTransformShadow(_shadow) {
|
|
11610
|
+
return undefined;
|
|
11611
|
+
}
|
|
11574
11612
|
};
|
|
11575
11613
|
const {excludeRenderBounds: excludeRenderBounds} = LeafBoundsHelper;
|
|
11576
11614
|
let usedGrayscaleAlpha;
|
|
@@ -12026,16 +12064,17 @@ var LeaferUI = function(exports) {
|
|
|
12026
12064
|
row.data = null;
|
|
12027
12065
|
}
|
|
12028
12066
|
function decorationText(drawData, style) {
|
|
12029
|
-
let type;
|
|
12067
|
+
let type, offset = 0;
|
|
12030
12068
|
const {fontSize: fontSize, textDecoration: textDecoration} = style;
|
|
12031
12069
|
drawData.decorationHeight = fontSize / 11;
|
|
12032
12070
|
if (isObject(textDecoration)) {
|
|
12033
12071
|
type = textDecoration.type;
|
|
12034
12072
|
if (textDecoration.color) drawData.decorationColor = ColorConvert.string(textDecoration.color);
|
|
12073
|
+
if (textDecoration.offset) offset = Math.min(fontSize * .3, Math.max(textDecoration.offset, -fontSize * .15));
|
|
12035
12074
|
} else type = textDecoration;
|
|
12036
12075
|
switch (type) {
|
|
12037
12076
|
case "under":
|
|
12038
|
-
drawData.decorationY = [ fontSize * .15 ];
|
|
12077
|
+
drawData.decorationY = [ fontSize * .15 + offset ];
|
|
12039
12078
|
break;
|
|
12040
12079
|
|
|
12041
12080
|
case "delete":
|
|
@@ -12043,7 +12082,7 @@ var LeaferUI = function(exports) {
|
|
|
12043
12082
|
break;
|
|
12044
12083
|
|
|
12045
12084
|
case "under-delete":
|
|
12046
|
-
drawData.decorationY = [ fontSize * .15, -fontSize * .35 ];
|
|
12085
|
+
drawData.decorationY = [ fontSize * .15 + offset, -fontSize * .35 ];
|
|
12047
12086
|
}
|
|
12048
12087
|
}
|
|
12049
12088
|
const {top: top, right: right, bottom: bottom, left: left} = exports.Direction4;
|