@leafer-ui/worker 1.0.5 → 1.0.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/worker.cjs +1 -1
- package/dist/worker.esm.js +1 -1
- package/dist/worker.esm.min.js +1 -1
- package/dist/worker.js +117 -127
- package/dist/worker.min.cjs +1 -1
- package/dist/worker.min.js +1 -1
- package/dist/worker.module.js +117 -127
- package/dist/worker.module.min.js +1 -1
- package/package.json +9 -9
package/dist/worker.js
CHANGED
|
@@ -555,6 +555,12 @@ var LeaferUI = (function (exports) {
|
|
|
555
555
|
to.y = t.y + sin$4(r) * distance;
|
|
556
556
|
return to;
|
|
557
557
|
},
|
|
558
|
+
toNumberPoints(originPoints) {
|
|
559
|
+
let points = originPoints;
|
|
560
|
+
if (typeof originPoints[0] === 'object')
|
|
561
|
+
points = [], originPoints.forEach(p => points.push(p.x, p.y));
|
|
562
|
+
return points;
|
|
563
|
+
},
|
|
558
564
|
reset(t) {
|
|
559
565
|
P$5.reset(t);
|
|
560
566
|
}
|
|
@@ -1545,7 +1551,10 @@ var LeaferUI = (function (exports) {
|
|
|
1545
1551
|
|
|
1546
1552
|
class LeafData {
|
|
1547
1553
|
get __useNaturalRatio() { return true; }
|
|
1548
|
-
get __isLinePath() {
|
|
1554
|
+
get __isLinePath() {
|
|
1555
|
+
const { path } = this;
|
|
1556
|
+
return path && path.length === 6 && path[0] === 1;
|
|
1557
|
+
}
|
|
1549
1558
|
get __blendMode() {
|
|
1550
1559
|
if (this.eraser && this.eraser !== 'path')
|
|
1551
1560
|
return 'destination-out';
|
|
@@ -2308,11 +2317,12 @@ var LeaferUI = (function (exports) {
|
|
|
2308
2317
|
|
|
2309
2318
|
const { sin: sin$3, cos: cos$3, atan2: atan2$1, ceil: ceil$1, abs: abs$3, PI: PI$2, sqrt: sqrt$1, pow } = Math;
|
|
2310
2319
|
const { setPoint: setPoint$2, addPoint: addPoint$2 } = TwoPointBoundsHelper;
|
|
2311
|
-
const { set } = PointHelper;
|
|
2320
|
+
const { set, toNumberPoints } = PointHelper;
|
|
2312
2321
|
const { M: M$5, L: L$6, C: C$5, Q: Q$4, Z: Z$5 } = PathCommandMap;
|
|
2313
2322
|
const tempPoint$2 = {};
|
|
2314
2323
|
const BezierHelper = {
|
|
2315
|
-
points(data,
|
|
2324
|
+
points(data, originPoints, curve, close) {
|
|
2325
|
+
let points = toNumberPoints(originPoints);
|
|
2316
2326
|
data.push(M$5, points[0], points[1]);
|
|
2317
2327
|
if (curve && points.length > 5) {
|
|
2318
2328
|
let aX, aY, bX, bY, cX, cY, c1X, c1Y, c2X, c2Y;
|
|
@@ -2821,6 +2831,27 @@ var LeaferUI = (function (exports) {
|
|
|
2821
2831
|
}
|
|
2822
2832
|
return data;
|
|
2823
2833
|
},
|
|
2834
|
+
objectToCanvasData(list) {
|
|
2835
|
+
const data = [];
|
|
2836
|
+
list.forEach(item => {
|
|
2837
|
+
switch (item.name) {
|
|
2838
|
+
case 'M':
|
|
2839
|
+
data.push(M$4, item.x, item.y);
|
|
2840
|
+
break;
|
|
2841
|
+
case 'L':
|
|
2842
|
+
data.push(L$5, item.x, item.y);
|
|
2843
|
+
break;
|
|
2844
|
+
case 'C':
|
|
2845
|
+
data.push(C$4, item.x1, item.y1, item.x2, item.y2, item.x, item.y);
|
|
2846
|
+
break;
|
|
2847
|
+
case 'Q':
|
|
2848
|
+
data.push(Q$3, item.x1, item.y1, item.x, item.y);
|
|
2849
|
+
break;
|
|
2850
|
+
case 'Z': data.push(Z$4);
|
|
2851
|
+
}
|
|
2852
|
+
});
|
|
2853
|
+
return data;
|
|
2854
|
+
},
|
|
2824
2855
|
copyData(data, old, index, count) {
|
|
2825
2856
|
for (let i = index, end = index + count; i < end; i++) {
|
|
2826
2857
|
data.push(old[i]);
|
|
@@ -5162,7 +5193,7 @@ var LeaferUI = (function (exports) {
|
|
|
5162
5193
|
if (this.__worldOpacity) {
|
|
5163
5194
|
canvas.setWorld(this.__nowWorld = this.__getNowWorld(options));
|
|
5164
5195
|
this.__drawRenderPath(canvas);
|
|
5165
|
-
this.
|
|
5196
|
+
this.windingRule ? canvas.clip(this.windingRule) : canvas.clip();
|
|
5166
5197
|
}
|
|
5167
5198
|
},
|
|
5168
5199
|
__updateWorldOpacity() {
|
|
@@ -5679,11 +5710,17 @@ var LeaferUI = (function (exports) {
|
|
|
5679
5710
|
add(child, index) {
|
|
5680
5711
|
if (child === this)
|
|
5681
5712
|
return;
|
|
5682
|
-
|
|
5713
|
+
const noIndex = index === undefined;
|
|
5714
|
+
if (!child.__) {
|
|
5715
|
+
if (child instanceof Array)
|
|
5716
|
+
return child.forEach(item => { this.add(item, index); noIndex || index++; });
|
|
5717
|
+
else
|
|
5718
|
+
child = UICreator.get(child.tag, child);
|
|
5719
|
+
}
|
|
5683
5720
|
if (child.parent)
|
|
5684
5721
|
child.parent.remove(child);
|
|
5685
5722
|
child.parent = this;
|
|
5686
|
-
|
|
5723
|
+
noIndex ? this.children.push(child) : this.children.splice(index, 0, child);
|
|
5687
5724
|
if (child.isBranch)
|
|
5688
5725
|
this.__.__childBranchNumber = (this.__.__childBranchNumber || 0) + 1;
|
|
5689
5726
|
child.__layout.boxChanged || child.__layout.boxChange();
|
|
@@ -5697,9 +5734,7 @@ var LeaferUI = (function (exports) {
|
|
|
5697
5734
|
}
|
|
5698
5735
|
this.__layout.affectChildrenSort && this.__layout.childrenSortChange();
|
|
5699
5736
|
}
|
|
5700
|
-
addMany(...children) {
|
|
5701
|
-
children.forEach(child => this.add(child));
|
|
5702
|
-
}
|
|
5737
|
+
addMany(...children) { this.add(children); }
|
|
5703
5738
|
remove(child, destroy) {
|
|
5704
5739
|
if (child) {
|
|
5705
5740
|
if (child.__) {
|
|
@@ -5927,7 +5962,7 @@ var LeaferUI = (function (exports) {
|
|
|
5927
5962
|
}
|
|
5928
5963
|
}
|
|
5929
5964
|
|
|
5930
|
-
const version = "1.0.
|
|
5965
|
+
const version = "1.0.6";
|
|
5931
5966
|
|
|
5932
5967
|
class LeaferCanvas extends LeaferCanvasBase {
|
|
5933
5968
|
get allowBackgroundColor() { return true; }
|
|
@@ -6907,6 +6942,13 @@ var LeaferUI = (function (exports) {
|
|
|
6907
6942
|
|
|
6908
6943
|
const TextConvert = {};
|
|
6909
6944
|
const ColorConvert = {};
|
|
6945
|
+
const UnitConvert = {
|
|
6946
|
+
number(value, percentRefer) {
|
|
6947
|
+
if (typeof value === 'object')
|
|
6948
|
+
return value.type === 'percent' ? value.value * percentRefer : value.value;
|
|
6949
|
+
return value;
|
|
6950
|
+
}
|
|
6951
|
+
};
|
|
6910
6952
|
const PathArrow = {};
|
|
6911
6953
|
const Paint = {};
|
|
6912
6954
|
const PaintImage = {};
|
|
@@ -6927,7 +6969,7 @@ var LeaferUI = (function (exports) {
|
|
|
6927
6969
|
}
|
|
6928
6970
|
};
|
|
6929
6971
|
|
|
6930
|
-
const { parse } = PathConvert;
|
|
6972
|
+
const { parse, objectToCanvasData } = PathConvert;
|
|
6931
6973
|
const emptyPaint = {};
|
|
6932
6974
|
const debug$4 = Debug.get('UIData');
|
|
6933
6975
|
class UIData extends LeafData {
|
|
@@ -6941,10 +6983,11 @@ var LeaferUI = (function (exports) {
|
|
|
6941
6983
|
scaleX = -scaleX;
|
|
6942
6984
|
return scaleX > 1 ? strokeWidth / scaleX : strokeWidth;
|
|
6943
6985
|
}
|
|
6944
|
-
else
|
|
6986
|
+
else
|
|
6945
6987
|
return strokeWidth;
|
|
6946
|
-
}
|
|
6947
6988
|
}
|
|
6989
|
+
get __hasStroke() { return this.stroke && this.strokeWidth; }
|
|
6990
|
+
get __clipAfterFill() { return (this.cornerRadius || this.__pathInputed); }
|
|
6948
6991
|
get __autoWidth() { return !this._width; }
|
|
6949
6992
|
get __autoHeight() { return !this._height; }
|
|
6950
6993
|
get __autoSide() { return !this._width || !this._height; }
|
|
@@ -6961,9 +7004,8 @@ var LeaferUI = (function (exports) {
|
|
|
6961
7004
|
this.__leaf.scaleX *= -1;
|
|
6962
7005
|
debug$4.warn('width < 0, instead -scaleX ', this);
|
|
6963
7006
|
}
|
|
6964
|
-
else
|
|
7007
|
+
else
|
|
6965
7008
|
this._width = value;
|
|
6966
|
-
}
|
|
6967
7009
|
}
|
|
6968
7010
|
setHeight(value) {
|
|
6969
7011
|
if (value < 0) {
|
|
@@ -6971,9 +7013,8 @@ var LeaferUI = (function (exports) {
|
|
|
6971
7013
|
this.__leaf.scaleY *= -1;
|
|
6972
7014
|
debug$4.warn('height < 0, instead -scaleY', this);
|
|
6973
7015
|
}
|
|
6974
|
-
else
|
|
7016
|
+
else
|
|
6975
7017
|
this._height = value;
|
|
6976
|
-
}
|
|
6977
7018
|
}
|
|
6978
7019
|
setFill(value) {
|
|
6979
7020
|
if (this.__naturalWidth)
|
|
@@ -7014,9 +7055,10 @@ var LeaferUI = (function (exports) {
|
|
|
7014
7055
|
}
|
|
7015
7056
|
}
|
|
7016
7057
|
setPath(value) {
|
|
7017
|
-
|
|
7058
|
+
const isString = typeof value === 'string';
|
|
7059
|
+
if (isString || (value && typeof value[0] === 'object')) {
|
|
7018
7060
|
this.__setInput('path', value);
|
|
7019
|
-
this._path = parse(value);
|
|
7061
|
+
this._path = isString ? parse(value) : objectToCanvasData(value);
|
|
7020
7062
|
}
|
|
7021
7063
|
else {
|
|
7022
7064
|
if (this.__input)
|
|
@@ -7031,12 +7073,8 @@ var LeaferUI = (function (exports) {
|
|
|
7031
7073
|
value = value.filter((item) => item.visible !== false);
|
|
7032
7074
|
this._shadow = value.length ? value : null;
|
|
7033
7075
|
}
|
|
7034
|
-
else
|
|
7035
|
-
this._shadow = value.visible
|
|
7036
|
-
}
|
|
7037
|
-
else {
|
|
7038
|
-
this._shadow = null;
|
|
7039
|
-
}
|
|
7076
|
+
else
|
|
7077
|
+
this._shadow = value && value.visible !== false ? [value] : null;
|
|
7040
7078
|
}
|
|
7041
7079
|
setInnerShadow(value) {
|
|
7042
7080
|
this.__setInput('innerShadow', value);
|
|
@@ -7045,12 +7083,8 @@ var LeaferUI = (function (exports) {
|
|
|
7045
7083
|
value = value.filter((item) => item.visible !== false);
|
|
7046
7084
|
this._innerShadow = value.length ? value : null;
|
|
7047
7085
|
}
|
|
7048
|
-
else
|
|
7049
|
-
this._innerShadow = value.visible
|
|
7050
|
-
}
|
|
7051
|
-
else {
|
|
7052
|
-
this._innerShadow = null;
|
|
7053
|
-
}
|
|
7086
|
+
else
|
|
7087
|
+
this._innerShadow = value && value.visible !== false ? [value] : null;
|
|
7054
7088
|
}
|
|
7055
7089
|
__computePaint() {
|
|
7056
7090
|
const { fill, stroke } = this.__input;
|
|
@@ -7061,24 +7095,19 @@ var LeaferUI = (function (exports) {
|
|
|
7061
7095
|
this.__needComputePaint = false;
|
|
7062
7096
|
}
|
|
7063
7097
|
}
|
|
7064
|
-
const UnitConvert = {
|
|
7065
|
-
number(value, percentRefer) {
|
|
7066
|
-
if (typeof value === 'object')
|
|
7067
|
-
return value.type === 'percent' ? value.value * percentRefer : value.value;
|
|
7068
|
-
return value;
|
|
7069
|
-
}
|
|
7070
|
-
};
|
|
7071
7098
|
|
|
7072
7099
|
class GroupData extends UIData {
|
|
7073
7100
|
}
|
|
7074
7101
|
|
|
7075
7102
|
class BoxData extends GroupData {
|
|
7076
7103
|
get __boxStroke() { return !this.__pathInputed; }
|
|
7104
|
+
get __drawAfterFill() { return this.overflow === 'hide' && this.__clipAfterFill && this.__leaf.children.length; }
|
|
7105
|
+
get __clipAfterFill() { return this.__leaf.isOverflow || super.__clipAfterFill; }
|
|
7077
7106
|
}
|
|
7078
7107
|
|
|
7079
7108
|
class LeaferData extends GroupData {
|
|
7080
|
-
__getInputData() {
|
|
7081
|
-
const data = super.__getInputData();
|
|
7109
|
+
__getInputData(names, options) {
|
|
7110
|
+
const data = super.__getInputData(names, options);
|
|
7082
7111
|
canvasSizeAttrs.forEach(key => delete data[key]);
|
|
7083
7112
|
return data;
|
|
7084
7113
|
}
|
|
@@ -7105,6 +7134,7 @@ var LeaferUI = (function (exports) {
|
|
|
7105
7134
|
}
|
|
7106
7135
|
|
|
7107
7136
|
class PathData extends UIData {
|
|
7137
|
+
get __pathInputed() { return 2; }
|
|
7108
7138
|
}
|
|
7109
7139
|
|
|
7110
7140
|
class PenData extends GroupData {
|
|
@@ -7151,16 +7181,18 @@ var LeaferUI = (function (exports) {
|
|
|
7151
7181
|
delete data.fill;
|
|
7152
7182
|
return data;
|
|
7153
7183
|
}
|
|
7154
|
-
__getInputData() {
|
|
7155
|
-
const data = super.__getInputData();
|
|
7184
|
+
__getInputData(names, options) {
|
|
7185
|
+
const data = super.__getInputData(names, options);
|
|
7156
7186
|
delete data.fill;
|
|
7157
7187
|
return data;
|
|
7158
7188
|
}
|
|
7159
7189
|
}
|
|
7160
7190
|
|
|
7161
7191
|
class CanvasData extends RectData {
|
|
7162
|
-
|
|
7163
|
-
|
|
7192
|
+
get __isCanvas() { return true; }
|
|
7193
|
+
get __drawAfterFill() { return true; }
|
|
7194
|
+
__getInputData(names, options) {
|
|
7195
|
+
const data = super.__getInputData(names, options);
|
|
7164
7196
|
data.url = this.__leaf.canvas.toDataURL('image/png');
|
|
7165
7197
|
return data;
|
|
7166
7198
|
}
|
|
@@ -7187,16 +7219,12 @@ var LeaferUI = (function (exports) {
|
|
|
7187
7219
|
let width = 0;
|
|
7188
7220
|
const { shadow, innerShadow, blur, backgroundBlur } = this.__;
|
|
7189
7221
|
if (shadow)
|
|
7190
|
-
shadow.forEach(item =>
|
|
7191
|
-
width = Math.max(width, Math.max(Math.abs(item.y), Math.abs(item.x)) + (item.spread > 0 ? item.spread : 0) + item.blur * 1.5);
|
|
7192
|
-
});
|
|
7222
|
+
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));
|
|
7193
7223
|
if (blur)
|
|
7194
7224
|
width = Math.max(width, blur);
|
|
7195
7225
|
let shapeWidth = width = Math.ceil(width);
|
|
7196
7226
|
if (innerShadow)
|
|
7197
|
-
innerShadow.forEach(item =>
|
|
7198
|
-
shapeWidth = Math.max(shapeWidth, Math.max(Math.abs(item.y), Math.abs(item.x)) + (item.spread < 0 ? -item.spread : 0) + item.blur * 1.5);
|
|
7199
|
-
});
|
|
7227
|
+
innerShadow.forEach(item => shapeWidth = Math.max(shapeWidth, Math.max(Math.abs(item.y), Math.abs(item.x)) + (item.spread < 0 ? -item.spread : 0) + item.blur * 1.5));
|
|
7200
7228
|
if (backgroundBlur)
|
|
7201
7229
|
shapeWidth = Math.max(shapeWidth, backgroundBlur);
|
|
7202
7230
|
this.__layout.renderShapeSpread = shapeWidth;
|
|
@@ -7278,6 +7306,16 @@ var LeaferUI = (function (exports) {
|
|
|
7278
7306
|
if (stroke && !ignoreStroke)
|
|
7279
7307
|
this.__.__pixelStroke ? Paint.strokes(stroke, this, canvas) : Paint.stroke('#000000', this, canvas);
|
|
7280
7308
|
}
|
|
7309
|
+
},
|
|
7310
|
+
__drawAfterFill(canvas, options) {
|
|
7311
|
+
if (this.__.__clipAfterFill) {
|
|
7312
|
+
canvas.save();
|
|
7313
|
+
this.windingRule ? canvas.clip(this.windingRule) : canvas.clip();
|
|
7314
|
+
this.__drawContent(canvas, options);
|
|
7315
|
+
canvas.restore();
|
|
7316
|
+
}
|
|
7317
|
+
else
|
|
7318
|
+
this.__drawContent(canvas, options);
|
|
7281
7319
|
}
|
|
7282
7320
|
};
|
|
7283
7321
|
function drawFast(ui, canvas, options) {
|
|
@@ -7344,8 +7382,8 @@ var LeaferUI = (function (exports) {
|
|
|
7344
7382
|
return pen;
|
|
7345
7383
|
}
|
|
7346
7384
|
get editConfig() { return undefined; }
|
|
7347
|
-
get editOuter() { return
|
|
7348
|
-
get editInner() { return '
|
|
7385
|
+
get editOuter() { return ''; }
|
|
7386
|
+
get editInner() { return ''; }
|
|
7349
7387
|
constructor(data) {
|
|
7350
7388
|
super(data);
|
|
7351
7389
|
}
|
|
@@ -7356,9 +7394,8 @@ var LeaferUI = (function (exports) {
|
|
|
7356
7394
|
Object.assign(this, data);
|
|
7357
7395
|
this.lockNormalStyle = false;
|
|
7358
7396
|
}
|
|
7359
|
-
else
|
|
7397
|
+
else
|
|
7360
7398
|
Object.assign(this, data);
|
|
7361
|
-
}
|
|
7362
7399
|
}
|
|
7363
7400
|
get(name) {
|
|
7364
7401
|
return typeof name === 'string' ? this.__.__getInput(name) : this.__.__getInputData(name);
|
|
@@ -7660,23 +7697,13 @@ var LeaferUI = (function (exports) {
|
|
|
7660
7697
|
if (data.children) {
|
|
7661
7698
|
const { children } = data;
|
|
7662
7699
|
delete data.children;
|
|
7663
|
-
|
|
7664
|
-
this.__setBranch();
|
|
7665
|
-
}
|
|
7666
|
-
else {
|
|
7667
|
-
this.clear();
|
|
7668
|
-
}
|
|
7700
|
+
this.children ? this.clear() : this.__setBranch();
|
|
7669
7701
|
super.set(data, isTemp);
|
|
7670
|
-
|
|
7671
|
-
children.forEach(childData => {
|
|
7672
|
-
child = childData.__ ? childData : UICreator.get(childData.tag, childData);
|
|
7673
|
-
this.add(child);
|
|
7674
|
-
});
|
|
7702
|
+
children.forEach(child => this.add(child));
|
|
7675
7703
|
data.children = children;
|
|
7676
7704
|
}
|
|
7677
|
-
else
|
|
7705
|
+
else
|
|
7678
7706
|
super.set(data, isTemp);
|
|
7679
|
-
}
|
|
7680
7707
|
}
|
|
7681
7708
|
toJSON(options) {
|
|
7682
7709
|
const data = super.toJSON(options);
|
|
@@ -8108,9 +8135,7 @@ var LeaferUI = (function (exports) {
|
|
|
8108
8135
|
}
|
|
8109
8136
|
__updateStrokeSpread() { return 0; }
|
|
8110
8137
|
__updateRectRenderSpread() { return 0; }
|
|
8111
|
-
__updateRenderSpread() {
|
|
8112
|
-
return this.__updateRectRenderSpread() || -1;
|
|
8113
|
-
}
|
|
8138
|
+
__updateRenderSpread() { return this.__updateRectRenderSpread() || -1; }
|
|
8114
8139
|
__updateRectBoxBounds() { }
|
|
8115
8140
|
__updateBoxBounds(_secondLayout) {
|
|
8116
8141
|
const data = this.__;
|
|
@@ -8130,13 +8155,11 @@ var LeaferUI = (function (exports) {
|
|
|
8130
8155
|
}
|
|
8131
8156
|
this.__updateNaturalSize();
|
|
8132
8157
|
}
|
|
8133
|
-
else
|
|
8158
|
+
else
|
|
8134
8159
|
this.__updateRectBoxBounds();
|
|
8135
|
-
}
|
|
8136
8160
|
}
|
|
8137
|
-
else
|
|
8161
|
+
else
|
|
8138
8162
|
this.__updateRectBoxBounds();
|
|
8139
|
-
}
|
|
8140
8163
|
}
|
|
8141
8164
|
__updateStrokeBounds() { }
|
|
8142
8165
|
__updateRenderBounds() {
|
|
@@ -8146,14 +8169,13 @@ var LeaferUI = (function (exports) {
|
|
|
8146
8169
|
super.__updateRenderBounds();
|
|
8147
8170
|
copy$3(childrenRenderBounds, renderBounds);
|
|
8148
8171
|
this.__updateRectRenderBounds();
|
|
8149
|
-
isOverflow = !includes$1(renderBounds, childrenRenderBounds)
|
|
8172
|
+
isOverflow = !includes$1(renderBounds, childrenRenderBounds);
|
|
8173
|
+
if (isOverflow && this.__.overflow !== 'hide')
|
|
8174
|
+
add(renderBounds, childrenRenderBounds);
|
|
8150
8175
|
}
|
|
8151
|
-
else
|
|
8176
|
+
else
|
|
8152
8177
|
this.__updateRectRenderBounds();
|
|
8153
|
-
|
|
8154
|
-
this.isOverflow !== isOverflow && (this.isOverflow = isOverflow);
|
|
8155
|
-
if (!(this.__.__drawAfterFill = this.__.overflow === 'hide') && isOverflow)
|
|
8156
|
-
add(renderBounds, childrenRenderBounds);
|
|
8178
|
+
!this.isOverflow !== !isOverflow && (this.isOverflow = isOverflow);
|
|
8157
8179
|
}
|
|
8158
8180
|
__updateRectRenderBounds() { }
|
|
8159
8181
|
__updateRectChange() { }
|
|
@@ -8173,20 +8195,9 @@ var LeaferUI = (function (exports) {
|
|
|
8173
8195
|
this.__renderGroup(canvas, options);
|
|
8174
8196
|
}
|
|
8175
8197
|
}
|
|
8176
|
-
|
|
8177
|
-
|
|
8178
|
-
if (this.
|
|
8179
|
-
canvas.save();
|
|
8180
|
-
canvas.clip();
|
|
8181
|
-
if (length)
|
|
8182
|
-
this.__renderGroup(canvas, options);
|
|
8183
|
-
canvas.restore();
|
|
8184
|
-
}
|
|
8185
|
-
else {
|
|
8186
|
-
if (length)
|
|
8187
|
-
this.__renderGroup(canvas, options);
|
|
8188
|
-
}
|
|
8189
|
-
if (this.__.stroke && length) {
|
|
8198
|
+
__drawContent(canvas, options) {
|
|
8199
|
+
this.__renderGroup(canvas, options);
|
|
8200
|
+
if (this.__.__hasStroke) {
|
|
8190
8201
|
canvas.setWorld(this.__nowWorld);
|
|
8191
8202
|
this.__drawRenderPath(canvas);
|
|
8192
8203
|
}
|
|
@@ -8350,17 +8361,15 @@ var LeaferUI = (function (exports) {
|
|
|
8350
8361
|
if (data.__useArrow)
|
|
8351
8362
|
PathArrow.addArrows(this, false);
|
|
8352
8363
|
}
|
|
8353
|
-
else
|
|
8364
|
+
else
|
|
8354
8365
|
super.__updateRenderPath();
|
|
8355
|
-
}
|
|
8356
8366
|
}
|
|
8357
8367
|
__updateBoxBounds() {
|
|
8358
8368
|
if (this.points) {
|
|
8359
8369
|
toBounds$1(this.__.__pathForRender, this.__layout.boxBounds);
|
|
8360
8370
|
}
|
|
8361
|
-
else
|
|
8371
|
+
else
|
|
8362
8372
|
super.__updateBoxBounds();
|
|
8363
|
-
}
|
|
8364
8373
|
}
|
|
8365
8374
|
};
|
|
8366
8375
|
__decorate([
|
|
@@ -8498,7 +8507,6 @@ var LeaferUI = (function (exports) {
|
|
|
8498
8507
|
super(data);
|
|
8499
8508
|
this.canvas = Creator.canvas(this.__);
|
|
8500
8509
|
this.context = this.canvas.context;
|
|
8501
|
-
this.__.__isCanvas = this.__.__drawAfterFill = true;
|
|
8502
8510
|
if (data && data.url)
|
|
8503
8511
|
this.drawImage(data.url);
|
|
8504
8512
|
}
|
|
@@ -8511,8 +8519,7 @@ var LeaferUI = (function (exports) {
|
|
|
8511
8519
|
});
|
|
8512
8520
|
}
|
|
8513
8521
|
draw(ui, offset, scale, rotation) {
|
|
8514
|
-
ui.
|
|
8515
|
-
const matrix = new Matrix(ui.__world).invert();
|
|
8522
|
+
const matrix = new Matrix(ui.worldTransform).invert();
|
|
8516
8523
|
const m = new Matrix();
|
|
8517
8524
|
if (offset)
|
|
8518
8525
|
m.translate(offset.x, offset.y);
|
|
@@ -8527,17 +8534,9 @@ var LeaferUI = (function (exports) {
|
|
|
8527
8534
|
paint() {
|
|
8528
8535
|
this.forceRender();
|
|
8529
8536
|
}
|
|
8530
|
-
|
|
8531
|
-
const { width, height
|
|
8532
|
-
|
|
8533
|
-
canvas.save();
|
|
8534
|
-
canvas.clip();
|
|
8535
|
-
canvas.drawImage(view, 0, 0, view.width, view.height, 0, 0, width, height);
|
|
8536
|
-
canvas.restore();
|
|
8537
|
-
}
|
|
8538
|
-
else {
|
|
8539
|
-
canvas.drawImage(view, 0, 0, view.width, view.height, 0, 0, width, height);
|
|
8540
|
-
}
|
|
8537
|
+
__drawContent(canvas, _options) {
|
|
8538
|
+
const { width, height } = this.__, { view } = this.canvas;
|
|
8539
|
+
canvas.drawImage(view, 0, 0, view.width, view.height, 0, 0, width, height);
|
|
8541
8540
|
}
|
|
8542
8541
|
__updateSize() {
|
|
8543
8542
|
const { canvas } = this;
|
|
@@ -8581,7 +8580,6 @@ var LeaferUI = (function (exports) {
|
|
|
8581
8580
|
const { copyAndSpread, includes, isSame: isSame$1, spread, setList } = BoundsHelper;
|
|
8582
8581
|
exports.Text = class Text extends exports.UI {
|
|
8583
8582
|
get __tag() { return 'Text'; }
|
|
8584
|
-
get editInner() { return 'TextEditor'; }
|
|
8585
8583
|
get textDrawData() {
|
|
8586
8584
|
this.__layout.update();
|
|
8587
8585
|
return this.__.__textDrawData;
|
|
@@ -8747,7 +8745,6 @@ var LeaferUI = (function (exports) {
|
|
|
8747
8745
|
get __tag() { return 'Path'; }
|
|
8748
8746
|
constructor(data) {
|
|
8749
8747
|
super(data);
|
|
8750
|
-
this.__.__pathInputed = 2;
|
|
8751
8748
|
}
|
|
8752
8749
|
};
|
|
8753
8750
|
__decorate([
|
|
@@ -8830,21 +8827,17 @@ var LeaferUI = (function (exports) {
|
|
|
8830
8827
|
this.tree = this.addLeafer(tree);
|
|
8831
8828
|
if (sky || editor)
|
|
8832
8829
|
this.sky = this.addLeafer(sky || { type: 'draw', usePartRender: false });
|
|
8833
|
-
if (editor)
|
|
8834
|
-
this.editor = Creator.editor(editor);
|
|
8835
|
-
this.sky.add(this.editor);
|
|
8836
|
-
}
|
|
8830
|
+
if (editor)
|
|
8831
|
+
this.sky.add(this.editor = Creator.editor(editor));
|
|
8837
8832
|
}
|
|
8838
8833
|
}
|
|
8839
8834
|
__setApp() {
|
|
8840
8835
|
const { canvas } = this;
|
|
8841
8836
|
const { realCanvas, view } = this.config;
|
|
8842
|
-
if (realCanvas || view === this.canvas.view || !canvas.parentView)
|
|
8837
|
+
if (realCanvas || view === this.canvas.view || !canvas.parentView)
|
|
8843
8838
|
this.realCanvas = true;
|
|
8844
|
-
|
|
8845
|
-
else {
|
|
8839
|
+
else
|
|
8846
8840
|
canvas.unrealCanvas();
|
|
8847
|
-
}
|
|
8848
8841
|
this.leafer = this;
|
|
8849
8842
|
this.watcher.disable();
|
|
8850
8843
|
this.layouter.disable();
|
|
@@ -9250,10 +9243,7 @@ var LeaferUI = (function (exports) {
|
|
|
9250
9243
|
leafer.getValidMove = function (moveX, moveY) {
|
|
9251
9244
|
const { scroll, disabled } = this.app.config.move;
|
|
9252
9245
|
if (scroll) {
|
|
9253
|
-
|
|
9254
|
-
moveY = 0;
|
|
9255
|
-
else
|
|
9256
|
-
moveX = 0;
|
|
9246
|
+
Math.abs(moveX) > Math.abs(moveY) ? moveY = 0 : moveX = 0;
|
|
9257
9247
|
if (scroll === 'limit') {
|
|
9258
9248
|
const { x, y, width, height } = new Bounds(this.__world).addPoint(this.zoomLayer);
|
|
9259
9249
|
const right = x + width - this.width, bottom = y + height - this.height;
|
|
@@ -10985,7 +10975,7 @@ var LeaferUI = (function (exports) {
|
|
|
10985
10975
|
}
|
|
10986
10976
|
if (allowPaint) {
|
|
10987
10977
|
canvas.save();
|
|
10988
|
-
canvas.clip();
|
|
10978
|
+
ui.windingRule ? canvas.clip(ui.windingRule) : canvas.clip();
|
|
10989
10979
|
if (paint.blendMode)
|
|
10990
10980
|
canvas.blendMode = paint.blendMode;
|
|
10991
10981
|
if (data.opacity)
|