@leafer-ui/miniapp 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/miniapp.cjs +1 -1
- package/dist/miniapp.esm.js +1 -1
- package/dist/miniapp.esm.min.js +1 -1
- package/dist/miniapp.min.cjs +1 -1
- package/dist/miniapp.module.js +117 -127
- package/dist/miniapp.module.min.js +1 -1
- package/package.json +10 -10
package/dist/miniapp.module.js
CHANGED
|
@@ -552,6 +552,12 @@ const PointHelper = {
|
|
|
552
552
|
to.y = t.y + sin$4(r) * distance;
|
|
553
553
|
return to;
|
|
554
554
|
},
|
|
555
|
+
toNumberPoints(originPoints) {
|
|
556
|
+
let points = originPoints;
|
|
557
|
+
if (typeof originPoints[0] === 'object')
|
|
558
|
+
points = [], originPoints.forEach(p => points.push(p.x, p.y));
|
|
559
|
+
return points;
|
|
560
|
+
},
|
|
555
561
|
reset(t) {
|
|
556
562
|
P$5.reset(t);
|
|
557
563
|
}
|
|
@@ -1542,7 +1548,10 @@ const { assign } = DataHelper;
|
|
|
1542
1548
|
|
|
1543
1549
|
class LeafData {
|
|
1544
1550
|
get __useNaturalRatio() { return true; }
|
|
1545
|
-
get __isLinePath() {
|
|
1551
|
+
get __isLinePath() {
|
|
1552
|
+
const { path } = this;
|
|
1553
|
+
return path && path.length === 6 && path[0] === 1;
|
|
1554
|
+
}
|
|
1546
1555
|
get __blendMode() {
|
|
1547
1556
|
if (this.eraser && this.eraser !== 'path')
|
|
1548
1557
|
return 'destination-out';
|
|
@@ -2305,11 +2314,12 @@ const RectHelper = {
|
|
|
2305
2314
|
|
|
2306
2315
|
const { sin: sin$3, cos: cos$3, atan2: atan2$1, ceil: ceil$1, abs: abs$3, PI: PI$2, sqrt: sqrt$1, pow } = Math;
|
|
2307
2316
|
const { setPoint: setPoint$2, addPoint: addPoint$2 } = TwoPointBoundsHelper;
|
|
2308
|
-
const { set } = PointHelper;
|
|
2317
|
+
const { set, toNumberPoints } = PointHelper;
|
|
2309
2318
|
const { M: M$5, L: L$6, C: C$5, Q: Q$4, Z: Z$5 } = PathCommandMap;
|
|
2310
2319
|
const tempPoint$2 = {};
|
|
2311
2320
|
const BezierHelper = {
|
|
2312
|
-
points(data,
|
|
2321
|
+
points(data, originPoints, curve, close) {
|
|
2322
|
+
let points = toNumberPoints(originPoints);
|
|
2313
2323
|
data.push(M$5, points[0], points[1]);
|
|
2314
2324
|
if (curve && points.length > 5) {
|
|
2315
2325
|
let aX, aY, bX, bY, cX, cY, c1X, c1Y, c2X, c2Y;
|
|
@@ -2818,6 +2828,27 @@ const PathConvert = {
|
|
|
2818
2828
|
}
|
|
2819
2829
|
return data;
|
|
2820
2830
|
},
|
|
2831
|
+
objectToCanvasData(list) {
|
|
2832
|
+
const data = [];
|
|
2833
|
+
list.forEach(item => {
|
|
2834
|
+
switch (item.name) {
|
|
2835
|
+
case 'M':
|
|
2836
|
+
data.push(M$4, item.x, item.y);
|
|
2837
|
+
break;
|
|
2838
|
+
case 'L':
|
|
2839
|
+
data.push(L$5, item.x, item.y);
|
|
2840
|
+
break;
|
|
2841
|
+
case 'C':
|
|
2842
|
+
data.push(C$4, item.x1, item.y1, item.x2, item.y2, item.x, item.y);
|
|
2843
|
+
break;
|
|
2844
|
+
case 'Q':
|
|
2845
|
+
data.push(Q$3, item.x1, item.y1, item.x, item.y);
|
|
2846
|
+
break;
|
|
2847
|
+
case 'Z': data.push(Z$4);
|
|
2848
|
+
}
|
|
2849
|
+
});
|
|
2850
|
+
return data;
|
|
2851
|
+
},
|
|
2821
2852
|
copyData(data, old, index, count) {
|
|
2822
2853
|
for (let i = index, end = index + count; i < end; i++) {
|
|
2823
2854
|
data.push(old[i]);
|
|
@@ -5159,7 +5190,7 @@ const LeafRender = {
|
|
|
5159
5190
|
if (this.__worldOpacity) {
|
|
5160
5191
|
canvas.setWorld(this.__nowWorld = this.__getNowWorld(options));
|
|
5161
5192
|
this.__drawRenderPath(canvas);
|
|
5162
|
-
this.
|
|
5193
|
+
this.windingRule ? canvas.clip(this.windingRule) : canvas.clip();
|
|
5163
5194
|
}
|
|
5164
5195
|
},
|
|
5165
5196
|
__updateWorldOpacity() {
|
|
@@ -5676,11 +5707,17 @@ let Branch = class Branch extends Leaf {
|
|
|
5676
5707
|
add(child, index) {
|
|
5677
5708
|
if (child === this)
|
|
5678
5709
|
return;
|
|
5679
|
-
|
|
5710
|
+
const noIndex = index === undefined;
|
|
5711
|
+
if (!child.__) {
|
|
5712
|
+
if (child instanceof Array)
|
|
5713
|
+
return child.forEach(item => { this.add(item, index); noIndex || index++; });
|
|
5714
|
+
else
|
|
5715
|
+
child = UICreator.get(child.tag, child);
|
|
5716
|
+
}
|
|
5680
5717
|
if (child.parent)
|
|
5681
5718
|
child.parent.remove(child);
|
|
5682
5719
|
child.parent = this;
|
|
5683
|
-
|
|
5720
|
+
noIndex ? this.children.push(child) : this.children.splice(index, 0, child);
|
|
5684
5721
|
if (child.isBranch)
|
|
5685
5722
|
this.__.__childBranchNumber = (this.__.__childBranchNumber || 0) + 1;
|
|
5686
5723
|
child.__layout.boxChanged || child.__layout.boxChange();
|
|
@@ -5694,9 +5731,7 @@ let Branch = class Branch extends Leaf {
|
|
|
5694
5731
|
}
|
|
5695
5732
|
this.__layout.affectChildrenSort && this.__layout.childrenSortChange();
|
|
5696
5733
|
}
|
|
5697
|
-
addMany(...children) {
|
|
5698
|
-
children.forEach(child => this.add(child));
|
|
5699
|
-
}
|
|
5734
|
+
addMany(...children) { this.add(children); }
|
|
5700
5735
|
remove(child, destroy) {
|
|
5701
5736
|
if (child) {
|
|
5702
5737
|
if (child.__) {
|
|
@@ -5924,7 +5959,7 @@ class LeafLevelList {
|
|
|
5924
5959
|
}
|
|
5925
5960
|
}
|
|
5926
5961
|
|
|
5927
|
-
const version = "1.0.
|
|
5962
|
+
const version = "1.0.6";
|
|
5928
5963
|
|
|
5929
5964
|
class LeaferCanvas extends LeaferCanvasBase {
|
|
5930
5965
|
get allowBackgroundColor() { return false; }
|
|
@@ -7041,6 +7076,13 @@ function zoomLayerType() {
|
|
|
7041
7076
|
|
|
7042
7077
|
const TextConvert = {};
|
|
7043
7078
|
const ColorConvert = {};
|
|
7079
|
+
const UnitConvert = {
|
|
7080
|
+
number(value, percentRefer) {
|
|
7081
|
+
if (typeof value === 'object')
|
|
7082
|
+
return value.type === 'percent' ? value.value * percentRefer : value.value;
|
|
7083
|
+
return value;
|
|
7084
|
+
}
|
|
7085
|
+
};
|
|
7044
7086
|
const PathArrow = {};
|
|
7045
7087
|
const Paint = {};
|
|
7046
7088
|
const PaintImage = {};
|
|
@@ -7061,7 +7103,7 @@ const Transition = {
|
|
|
7061
7103
|
}
|
|
7062
7104
|
};
|
|
7063
7105
|
|
|
7064
|
-
const { parse } = PathConvert;
|
|
7106
|
+
const { parse, objectToCanvasData } = PathConvert;
|
|
7065
7107
|
const emptyPaint = {};
|
|
7066
7108
|
const debug$4 = Debug.get('UIData');
|
|
7067
7109
|
class UIData extends LeafData {
|
|
@@ -7075,10 +7117,11 @@ class UIData extends LeafData {
|
|
|
7075
7117
|
scaleX = -scaleX;
|
|
7076
7118
|
return scaleX > 1 ? strokeWidth / scaleX : strokeWidth;
|
|
7077
7119
|
}
|
|
7078
|
-
else
|
|
7120
|
+
else
|
|
7079
7121
|
return strokeWidth;
|
|
7080
|
-
}
|
|
7081
7122
|
}
|
|
7123
|
+
get __hasStroke() { return this.stroke && this.strokeWidth; }
|
|
7124
|
+
get __clipAfterFill() { return (this.cornerRadius || this.__pathInputed); }
|
|
7082
7125
|
get __autoWidth() { return !this._width; }
|
|
7083
7126
|
get __autoHeight() { return !this._height; }
|
|
7084
7127
|
get __autoSide() { return !this._width || !this._height; }
|
|
@@ -7095,9 +7138,8 @@ class UIData extends LeafData {
|
|
|
7095
7138
|
this.__leaf.scaleX *= -1;
|
|
7096
7139
|
debug$4.warn('width < 0, instead -scaleX ', this);
|
|
7097
7140
|
}
|
|
7098
|
-
else
|
|
7141
|
+
else
|
|
7099
7142
|
this._width = value;
|
|
7100
|
-
}
|
|
7101
7143
|
}
|
|
7102
7144
|
setHeight(value) {
|
|
7103
7145
|
if (value < 0) {
|
|
@@ -7105,9 +7147,8 @@ class UIData extends LeafData {
|
|
|
7105
7147
|
this.__leaf.scaleY *= -1;
|
|
7106
7148
|
debug$4.warn('height < 0, instead -scaleY', this);
|
|
7107
7149
|
}
|
|
7108
|
-
else
|
|
7150
|
+
else
|
|
7109
7151
|
this._height = value;
|
|
7110
|
-
}
|
|
7111
7152
|
}
|
|
7112
7153
|
setFill(value) {
|
|
7113
7154
|
if (this.__naturalWidth)
|
|
@@ -7148,9 +7189,10 @@ class UIData extends LeafData {
|
|
|
7148
7189
|
}
|
|
7149
7190
|
}
|
|
7150
7191
|
setPath(value) {
|
|
7151
|
-
|
|
7192
|
+
const isString = typeof value === 'string';
|
|
7193
|
+
if (isString || (value && typeof value[0] === 'object')) {
|
|
7152
7194
|
this.__setInput('path', value);
|
|
7153
|
-
this._path = parse(value);
|
|
7195
|
+
this._path = isString ? parse(value) : objectToCanvasData(value);
|
|
7154
7196
|
}
|
|
7155
7197
|
else {
|
|
7156
7198
|
if (this.__input)
|
|
@@ -7165,12 +7207,8 @@ class UIData extends LeafData {
|
|
|
7165
7207
|
value = value.filter((item) => item.visible !== false);
|
|
7166
7208
|
this._shadow = value.length ? value : null;
|
|
7167
7209
|
}
|
|
7168
|
-
else
|
|
7169
|
-
this._shadow = value.visible
|
|
7170
|
-
}
|
|
7171
|
-
else {
|
|
7172
|
-
this._shadow = null;
|
|
7173
|
-
}
|
|
7210
|
+
else
|
|
7211
|
+
this._shadow = value && value.visible !== false ? [value] : null;
|
|
7174
7212
|
}
|
|
7175
7213
|
setInnerShadow(value) {
|
|
7176
7214
|
this.__setInput('innerShadow', value);
|
|
@@ -7179,12 +7217,8 @@ class UIData extends LeafData {
|
|
|
7179
7217
|
value = value.filter((item) => item.visible !== false);
|
|
7180
7218
|
this._innerShadow = value.length ? value : null;
|
|
7181
7219
|
}
|
|
7182
|
-
else
|
|
7183
|
-
this._innerShadow = value.visible
|
|
7184
|
-
}
|
|
7185
|
-
else {
|
|
7186
|
-
this._innerShadow = null;
|
|
7187
|
-
}
|
|
7220
|
+
else
|
|
7221
|
+
this._innerShadow = value && value.visible !== false ? [value] : null;
|
|
7188
7222
|
}
|
|
7189
7223
|
__computePaint() {
|
|
7190
7224
|
const { fill, stroke } = this.__input;
|
|
@@ -7195,24 +7229,19 @@ class UIData extends LeafData {
|
|
|
7195
7229
|
this.__needComputePaint = false;
|
|
7196
7230
|
}
|
|
7197
7231
|
}
|
|
7198
|
-
const UnitConvert = {
|
|
7199
|
-
number(value, percentRefer) {
|
|
7200
|
-
if (typeof value === 'object')
|
|
7201
|
-
return value.type === 'percent' ? value.value * percentRefer : value.value;
|
|
7202
|
-
return value;
|
|
7203
|
-
}
|
|
7204
|
-
};
|
|
7205
7232
|
|
|
7206
7233
|
class GroupData extends UIData {
|
|
7207
7234
|
}
|
|
7208
7235
|
|
|
7209
7236
|
class BoxData extends GroupData {
|
|
7210
7237
|
get __boxStroke() { return !this.__pathInputed; }
|
|
7238
|
+
get __drawAfterFill() { return this.overflow === 'hide' && this.__clipAfterFill && this.__leaf.children.length; }
|
|
7239
|
+
get __clipAfterFill() { return this.__leaf.isOverflow || super.__clipAfterFill; }
|
|
7211
7240
|
}
|
|
7212
7241
|
|
|
7213
7242
|
class LeaferData extends GroupData {
|
|
7214
|
-
__getInputData() {
|
|
7215
|
-
const data = super.__getInputData();
|
|
7243
|
+
__getInputData(names, options) {
|
|
7244
|
+
const data = super.__getInputData(names, options);
|
|
7216
7245
|
canvasSizeAttrs.forEach(key => delete data[key]);
|
|
7217
7246
|
return data;
|
|
7218
7247
|
}
|
|
@@ -7239,6 +7268,7 @@ class StarData extends UIData {
|
|
|
7239
7268
|
}
|
|
7240
7269
|
|
|
7241
7270
|
class PathData extends UIData {
|
|
7271
|
+
get __pathInputed() { return 2; }
|
|
7242
7272
|
}
|
|
7243
7273
|
|
|
7244
7274
|
class PenData extends GroupData {
|
|
@@ -7285,16 +7315,18 @@ class ImageData extends RectData {
|
|
|
7285
7315
|
delete data.fill;
|
|
7286
7316
|
return data;
|
|
7287
7317
|
}
|
|
7288
|
-
__getInputData() {
|
|
7289
|
-
const data = super.__getInputData();
|
|
7318
|
+
__getInputData(names, options) {
|
|
7319
|
+
const data = super.__getInputData(names, options);
|
|
7290
7320
|
delete data.fill;
|
|
7291
7321
|
return data;
|
|
7292
7322
|
}
|
|
7293
7323
|
}
|
|
7294
7324
|
|
|
7295
7325
|
class CanvasData extends RectData {
|
|
7296
|
-
|
|
7297
|
-
|
|
7326
|
+
get __isCanvas() { return true; }
|
|
7327
|
+
get __drawAfterFill() { return true; }
|
|
7328
|
+
__getInputData(names, options) {
|
|
7329
|
+
const data = super.__getInputData(names, options);
|
|
7298
7330
|
data.url = this.__leaf.canvas.toDataURL('image/png');
|
|
7299
7331
|
return data;
|
|
7300
7332
|
}
|
|
@@ -7321,16 +7353,12 @@ const UIBounds = {
|
|
|
7321
7353
|
let width = 0;
|
|
7322
7354
|
const { shadow, innerShadow, blur, backgroundBlur } = this.__;
|
|
7323
7355
|
if (shadow)
|
|
7324
|
-
shadow.forEach(item =>
|
|
7325
|
-
width = Math.max(width, Math.max(Math.abs(item.y), Math.abs(item.x)) + (item.spread > 0 ? item.spread : 0) + item.blur * 1.5);
|
|
7326
|
-
});
|
|
7356
|
+
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));
|
|
7327
7357
|
if (blur)
|
|
7328
7358
|
width = Math.max(width, blur);
|
|
7329
7359
|
let shapeWidth = width = Math.ceil(width);
|
|
7330
7360
|
if (innerShadow)
|
|
7331
|
-
innerShadow.forEach(item =>
|
|
7332
|
-
shapeWidth = Math.max(shapeWidth, Math.max(Math.abs(item.y), Math.abs(item.x)) + (item.spread < 0 ? -item.spread : 0) + item.blur * 1.5);
|
|
7333
|
-
});
|
|
7361
|
+
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));
|
|
7334
7362
|
if (backgroundBlur)
|
|
7335
7363
|
shapeWidth = Math.max(shapeWidth, backgroundBlur);
|
|
7336
7364
|
this.__layout.renderShapeSpread = shapeWidth;
|
|
@@ -7412,6 +7440,16 @@ const UIRender = {
|
|
|
7412
7440
|
if (stroke && !ignoreStroke)
|
|
7413
7441
|
this.__.__pixelStroke ? Paint.strokes(stroke, this, canvas) : Paint.stroke('#000000', this, canvas);
|
|
7414
7442
|
}
|
|
7443
|
+
},
|
|
7444
|
+
__drawAfterFill(canvas, options) {
|
|
7445
|
+
if (this.__.__clipAfterFill) {
|
|
7446
|
+
canvas.save();
|
|
7447
|
+
this.windingRule ? canvas.clip(this.windingRule) : canvas.clip();
|
|
7448
|
+
this.__drawContent(canvas, options);
|
|
7449
|
+
canvas.restore();
|
|
7450
|
+
}
|
|
7451
|
+
else
|
|
7452
|
+
this.__drawContent(canvas, options);
|
|
7415
7453
|
}
|
|
7416
7454
|
};
|
|
7417
7455
|
function drawFast(ui, canvas, options) {
|
|
@@ -7478,8 +7516,8 @@ let UI = UI_1 = class UI extends Leaf {
|
|
|
7478
7516
|
return pen;
|
|
7479
7517
|
}
|
|
7480
7518
|
get editConfig() { return undefined; }
|
|
7481
|
-
get editOuter() { return
|
|
7482
|
-
get editInner() { return '
|
|
7519
|
+
get editOuter() { return ''; }
|
|
7520
|
+
get editInner() { return ''; }
|
|
7483
7521
|
constructor(data) {
|
|
7484
7522
|
super(data);
|
|
7485
7523
|
}
|
|
@@ -7490,9 +7528,8 @@ let UI = UI_1 = class UI extends Leaf {
|
|
|
7490
7528
|
Object.assign(this, data);
|
|
7491
7529
|
this.lockNormalStyle = false;
|
|
7492
7530
|
}
|
|
7493
|
-
else
|
|
7531
|
+
else
|
|
7494
7532
|
Object.assign(this, data);
|
|
7495
|
-
}
|
|
7496
7533
|
}
|
|
7497
7534
|
get(name) {
|
|
7498
7535
|
return typeof name === 'string' ? this.__.__getInput(name) : this.__.__getInputData(name);
|
|
@@ -7794,23 +7831,13 @@ let Group = class Group extends UI {
|
|
|
7794
7831
|
if (data.children) {
|
|
7795
7832
|
const { children } = data;
|
|
7796
7833
|
delete data.children;
|
|
7797
|
-
|
|
7798
|
-
this.__setBranch();
|
|
7799
|
-
}
|
|
7800
|
-
else {
|
|
7801
|
-
this.clear();
|
|
7802
|
-
}
|
|
7834
|
+
this.children ? this.clear() : this.__setBranch();
|
|
7803
7835
|
super.set(data, isTemp);
|
|
7804
|
-
|
|
7805
|
-
children.forEach(childData => {
|
|
7806
|
-
child = childData.__ ? childData : UICreator.get(childData.tag, childData);
|
|
7807
|
-
this.add(child);
|
|
7808
|
-
});
|
|
7836
|
+
children.forEach(child => this.add(child));
|
|
7809
7837
|
data.children = children;
|
|
7810
7838
|
}
|
|
7811
|
-
else
|
|
7839
|
+
else
|
|
7812
7840
|
super.set(data, isTemp);
|
|
7813
|
-
}
|
|
7814
7841
|
}
|
|
7815
7842
|
toJSON(options) {
|
|
7816
7843
|
const data = super.toJSON(options);
|
|
@@ -8242,9 +8269,7 @@ let Box = class Box extends Group {
|
|
|
8242
8269
|
}
|
|
8243
8270
|
__updateStrokeSpread() { return 0; }
|
|
8244
8271
|
__updateRectRenderSpread() { return 0; }
|
|
8245
|
-
__updateRenderSpread() {
|
|
8246
|
-
return this.__updateRectRenderSpread() || -1;
|
|
8247
|
-
}
|
|
8272
|
+
__updateRenderSpread() { return this.__updateRectRenderSpread() || -1; }
|
|
8248
8273
|
__updateRectBoxBounds() { }
|
|
8249
8274
|
__updateBoxBounds(_secondLayout) {
|
|
8250
8275
|
const data = this.__;
|
|
@@ -8264,13 +8289,11 @@ let Box = class Box extends Group {
|
|
|
8264
8289
|
}
|
|
8265
8290
|
this.__updateNaturalSize();
|
|
8266
8291
|
}
|
|
8267
|
-
else
|
|
8292
|
+
else
|
|
8268
8293
|
this.__updateRectBoxBounds();
|
|
8269
|
-
}
|
|
8270
8294
|
}
|
|
8271
|
-
else
|
|
8295
|
+
else
|
|
8272
8296
|
this.__updateRectBoxBounds();
|
|
8273
|
-
}
|
|
8274
8297
|
}
|
|
8275
8298
|
__updateStrokeBounds() { }
|
|
8276
8299
|
__updateRenderBounds() {
|
|
@@ -8280,14 +8303,13 @@ let Box = class Box extends Group {
|
|
|
8280
8303
|
super.__updateRenderBounds();
|
|
8281
8304
|
copy$3(childrenRenderBounds, renderBounds);
|
|
8282
8305
|
this.__updateRectRenderBounds();
|
|
8283
|
-
isOverflow = !includes$1(renderBounds, childrenRenderBounds)
|
|
8306
|
+
isOverflow = !includes$1(renderBounds, childrenRenderBounds);
|
|
8307
|
+
if (isOverflow && this.__.overflow !== 'hide')
|
|
8308
|
+
add(renderBounds, childrenRenderBounds);
|
|
8284
8309
|
}
|
|
8285
|
-
else
|
|
8310
|
+
else
|
|
8286
8311
|
this.__updateRectRenderBounds();
|
|
8287
|
-
|
|
8288
|
-
this.isOverflow !== isOverflow && (this.isOverflow = isOverflow);
|
|
8289
|
-
if (!(this.__.__drawAfterFill = this.__.overflow === 'hide') && isOverflow)
|
|
8290
|
-
add(renderBounds, childrenRenderBounds);
|
|
8312
|
+
!this.isOverflow !== !isOverflow && (this.isOverflow = isOverflow);
|
|
8291
8313
|
}
|
|
8292
8314
|
__updateRectRenderBounds() { }
|
|
8293
8315
|
__updateRectChange() { }
|
|
@@ -8307,20 +8329,9 @@ let Box = class Box extends Group {
|
|
|
8307
8329
|
this.__renderGroup(canvas, options);
|
|
8308
8330
|
}
|
|
8309
8331
|
}
|
|
8310
|
-
|
|
8311
|
-
|
|
8312
|
-
if (this.
|
|
8313
|
-
canvas.save();
|
|
8314
|
-
canvas.clip();
|
|
8315
|
-
if (length)
|
|
8316
|
-
this.__renderGroup(canvas, options);
|
|
8317
|
-
canvas.restore();
|
|
8318
|
-
}
|
|
8319
|
-
else {
|
|
8320
|
-
if (length)
|
|
8321
|
-
this.__renderGroup(canvas, options);
|
|
8322
|
-
}
|
|
8323
|
-
if (this.__.stroke && length) {
|
|
8332
|
+
__drawContent(canvas, options) {
|
|
8333
|
+
this.__renderGroup(canvas, options);
|
|
8334
|
+
if (this.__.__hasStroke) {
|
|
8324
8335
|
canvas.setWorld(this.__nowWorld);
|
|
8325
8336
|
this.__drawRenderPath(canvas);
|
|
8326
8337
|
}
|
|
@@ -8484,17 +8495,15 @@ let Line = class Line extends UI {
|
|
|
8484
8495
|
if (data.__useArrow)
|
|
8485
8496
|
PathArrow.addArrows(this, false);
|
|
8486
8497
|
}
|
|
8487
|
-
else
|
|
8498
|
+
else
|
|
8488
8499
|
super.__updateRenderPath();
|
|
8489
|
-
}
|
|
8490
8500
|
}
|
|
8491
8501
|
__updateBoxBounds() {
|
|
8492
8502
|
if (this.points) {
|
|
8493
8503
|
toBounds$1(this.__.__pathForRender, this.__layout.boxBounds);
|
|
8494
8504
|
}
|
|
8495
|
-
else
|
|
8505
|
+
else
|
|
8496
8506
|
super.__updateBoxBounds();
|
|
8497
|
-
}
|
|
8498
8507
|
}
|
|
8499
8508
|
};
|
|
8500
8509
|
__decorate([
|
|
@@ -8632,7 +8641,6 @@ let Canvas = class Canvas extends Rect {
|
|
|
8632
8641
|
super(data);
|
|
8633
8642
|
this.canvas = Creator.canvas(this.__);
|
|
8634
8643
|
this.context = this.canvas.context;
|
|
8635
|
-
this.__.__isCanvas = this.__.__drawAfterFill = true;
|
|
8636
8644
|
if (data && data.url)
|
|
8637
8645
|
this.drawImage(data.url);
|
|
8638
8646
|
}
|
|
@@ -8645,8 +8653,7 @@ let Canvas = class Canvas extends Rect {
|
|
|
8645
8653
|
});
|
|
8646
8654
|
}
|
|
8647
8655
|
draw(ui, offset, scale, rotation) {
|
|
8648
|
-
ui.
|
|
8649
|
-
const matrix = new Matrix(ui.__world).invert();
|
|
8656
|
+
const matrix = new Matrix(ui.worldTransform).invert();
|
|
8650
8657
|
const m = new Matrix();
|
|
8651
8658
|
if (offset)
|
|
8652
8659
|
m.translate(offset.x, offset.y);
|
|
@@ -8661,17 +8668,9 @@ let Canvas = class Canvas extends Rect {
|
|
|
8661
8668
|
paint() {
|
|
8662
8669
|
this.forceRender();
|
|
8663
8670
|
}
|
|
8664
|
-
|
|
8665
|
-
const { width, height
|
|
8666
|
-
|
|
8667
|
-
canvas.save();
|
|
8668
|
-
canvas.clip();
|
|
8669
|
-
canvas.drawImage(view, 0, 0, view.width, view.height, 0, 0, width, height);
|
|
8670
|
-
canvas.restore();
|
|
8671
|
-
}
|
|
8672
|
-
else {
|
|
8673
|
-
canvas.drawImage(view, 0, 0, view.width, view.height, 0, 0, width, height);
|
|
8674
|
-
}
|
|
8671
|
+
__drawContent(canvas, _options) {
|
|
8672
|
+
const { width, height } = this.__, { view } = this.canvas;
|
|
8673
|
+
canvas.drawImage(view, 0, 0, view.width, view.height, 0, 0, width, height);
|
|
8675
8674
|
}
|
|
8676
8675
|
__updateSize() {
|
|
8677
8676
|
const { canvas } = this;
|
|
@@ -8715,7 +8714,6 @@ Canvas = __decorate([
|
|
|
8715
8714
|
const { copyAndSpread, includes, isSame: isSame$1, spread, setList } = BoundsHelper;
|
|
8716
8715
|
let Text = class Text extends UI {
|
|
8717
8716
|
get __tag() { return 'Text'; }
|
|
8718
|
-
get editInner() { return 'TextEditor'; }
|
|
8719
8717
|
get textDrawData() {
|
|
8720
8718
|
this.__layout.update();
|
|
8721
8719
|
return this.__.__textDrawData;
|
|
@@ -8881,7 +8879,6 @@ let Path = class Path extends UI {
|
|
|
8881
8879
|
get __tag() { return 'Path'; }
|
|
8882
8880
|
constructor(data) {
|
|
8883
8881
|
super(data);
|
|
8884
|
-
this.__.__pathInputed = 2;
|
|
8885
8882
|
}
|
|
8886
8883
|
};
|
|
8887
8884
|
__decorate([
|
|
@@ -8964,21 +8961,17 @@ let App = class App extends Leafer {
|
|
|
8964
8961
|
this.tree = this.addLeafer(tree);
|
|
8965
8962
|
if (sky || editor)
|
|
8966
8963
|
this.sky = this.addLeafer(sky || { type: 'draw', usePartRender: false });
|
|
8967
|
-
if (editor)
|
|
8968
|
-
this.editor = Creator.editor(editor);
|
|
8969
|
-
this.sky.add(this.editor);
|
|
8970
|
-
}
|
|
8964
|
+
if (editor)
|
|
8965
|
+
this.sky.add(this.editor = Creator.editor(editor));
|
|
8971
8966
|
}
|
|
8972
8967
|
}
|
|
8973
8968
|
__setApp() {
|
|
8974
8969
|
const { canvas } = this;
|
|
8975
8970
|
const { realCanvas, view } = this.config;
|
|
8976
|
-
if (realCanvas || view === this.canvas.view || !canvas.parentView)
|
|
8971
|
+
if (realCanvas || view === this.canvas.view || !canvas.parentView)
|
|
8977
8972
|
this.realCanvas = true;
|
|
8978
|
-
|
|
8979
|
-
else {
|
|
8973
|
+
else
|
|
8980
8974
|
canvas.unrealCanvas();
|
|
8981
|
-
}
|
|
8982
8975
|
this.leafer = this;
|
|
8983
8976
|
this.watcher.disable();
|
|
8984
8977
|
this.layouter.disable();
|
|
@@ -9384,10 +9377,7 @@ leafer.initType = function (type) {
|
|
|
9384
9377
|
leafer.getValidMove = function (moveX, moveY) {
|
|
9385
9378
|
const { scroll, disabled } = this.app.config.move;
|
|
9386
9379
|
if (scroll) {
|
|
9387
|
-
|
|
9388
|
-
moveY = 0;
|
|
9389
|
-
else
|
|
9390
|
-
moveX = 0;
|
|
9380
|
+
Math.abs(moveX) > Math.abs(moveY) ? moveY = 0 : moveX = 0;
|
|
9391
9381
|
if (scroll === 'limit') {
|
|
9392
9382
|
const { x, y, width, height } = new Bounds(this.__world).addPoint(this.zoomLayer);
|
|
9393
9383
|
const right = x + width - this.width, bottom = y + height - this.height;
|
|
@@ -11224,7 +11214,7 @@ function checkImage(ui, canvas, paint, allowPaint) {
|
|
|
11224
11214
|
}
|
|
11225
11215
|
if (allowPaint) {
|
|
11226
11216
|
canvas.save();
|
|
11227
|
-
canvas.clip();
|
|
11217
|
+
ui.windingRule ? canvas.clip(ui.windingRule) : canvas.clip();
|
|
11228
11218
|
if (paint.blendMode)
|
|
11229
11219
|
canvas.blendMode = paint.blendMode;
|
|
11230
11220
|
if (data.opacity)
|