leafer-draw 1.0.5 → 1.0.7
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 +2 -2
- package/dist/web.esm.js +2 -2
- package/dist/web.esm.min.js +1 -1
- package/dist/web.js +117 -124
- package/dist/web.min.cjs +1 -1
- package/dist/web.min.js +1 -1
- package/dist/web.module.js +117 -124
- package/dist/web.module.min.js +1 -1
- package/package.json +2 -2
package/dist/web.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]);
|
|
@@ -4398,13 +4429,10 @@ var LeaferUI = (function (exports) {
|
|
|
4398
4429
|
update() {
|
|
4399
4430
|
const { leafer } = this.leaf;
|
|
4400
4431
|
if (leafer) {
|
|
4401
|
-
if (leafer.ready)
|
|
4402
|
-
|
|
4403
|
-
|
|
4404
|
-
}
|
|
4405
|
-
else {
|
|
4432
|
+
if (leafer.ready)
|
|
4433
|
+
leafer.watcher.changed && leafer.layouter.layout();
|
|
4434
|
+
else
|
|
4406
4435
|
leafer.start();
|
|
4407
|
-
}
|
|
4408
4436
|
}
|
|
4409
4437
|
else {
|
|
4410
4438
|
let root = this.leaf;
|
|
@@ -5162,7 +5190,7 @@ var LeaferUI = (function (exports) {
|
|
|
5162
5190
|
if (this.__worldOpacity) {
|
|
5163
5191
|
canvas.setWorld(this.__nowWorld = this.__getNowWorld(options));
|
|
5164
5192
|
this.__drawRenderPath(canvas);
|
|
5165
|
-
this.
|
|
5193
|
+
this.windingRule ? canvas.clip(this.windingRule) : canvas.clip();
|
|
5166
5194
|
}
|
|
5167
5195
|
},
|
|
5168
5196
|
__updateWorldOpacity() {
|
|
@@ -5679,11 +5707,17 @@ var LeaferUI = (function (exports) {
|
|
|
5679
5707
|
add(child, index) {
|
|
5680
5708
|
if (child === this)
|
|
5681
5709
|
return;
|
|
5682
|
-
|
|
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
|
+
}
|
|
5683
5717
|
if (child.parent)
|
|
5684
5718
|
child.parent.remove(child);
|
|
5685
5719
|
child.parent = this;
|
|
5686
|
-
|
|
5720
|
+
noIndex ? this.children.push(child) : this.children.splice(index, 0, child);
|
|
5687
5721
|
if (child.isBranch)
|
|
5688
5722
|
this.__.__childBranchNumber = (this.__.__childBranchNumber || 0) + 1;
|
|
5689
5723
|
child.__layout.boxChanged || child.__layout.boxChange();
|
|
@@ -5697,9 +5731,7 @@ var LeaferUI = (function (exports) {
|
|
|
5697
5731
|
}
|
|
5698
5732
|
this.__layout.affectChildrenSort && this.__layout.childrenSortChange();
|
|
5699
5733
|
}
|
|
5700
|
-
addMany(...children) {
|
|
5701
|
-
children.forEach(child => this.add(child));
|
|
5702
|
-
}
|
|
5734
|
+
addMany(...children) { this.add(children); }
|
|
5703
5735
|
remove(child, destroy) {
|
|
5704
5736
|
if (child) {
|
|
5705
5737
|
if (child.__) {
|
|
@@ -5927,7 +5959,7 @@ var LeaferUI = (function (exports) {
|
|
|
5927
5959
|
}
|
|
5928
5960
|
}
|
|
5929
5961
|
|
|
5930
|
-
const version = "1.0.
|
|
5962
|
+
const version = "1.0.7";
|
|
5931
5963
|
|
|
5932
5964
|
const debug$5 = Debug.get('LeaferCanvas');
|
|
5933
5965
|
class LeaferCanvas extends LeaferCanvasBase {
|
|
@@ -6085,7 +6117,7 @@ var LeaferUI = (function (exports) {
|
|
|
6085
6117
|
const oldSize = {};
|
|
6086
6118
|
DataHelper.copyAttrs(oldSize, this, canvasSizeAttrs);
|
|
6087
6119
|
this.resize(size);
|
|
6088
|
-
if (this.width !== undefined)
|
|
6120
|
+
if (this.resizeListener && this.width !== undefined)
|
|
6089
6121
|
this.resizeListener(new ResizeEvent(size, oldSize));
|
|
6090
6122
|
}
|
|
6091
6123
|
unrealCanvas() {
|
|
@@ -6809,6 +6841,13 @@ var LeaferUI = (function (exports) {
|
|
|
6809
6841
|
|
|
6810
6842
|
const TextConvert = {};
|
|
6811
6843
|
const ColorConvert = {};
|
|
6844
|
+
const UnitConvert = {
|
|
6845
|
+
number(value, percentRefer) {
|
|
6846
|
+
if (typeof value === 'object')
|
|
6847
|
+
return value.type === 'percent' ? value.value * percentRefer : value.value;
|
|
6848
|
+
return value;
|
|
6849
|
+
}
|
|
6850
|
+
};
|
|
6812
6851
|
const PathArrow = {};
|
|
6813
6852
|
const Paint = {};
|
|
6814
6853
|
const PaintImage = {};
|
|
@@ -6829,7 +6868,7 @@ var LeaferUI = (function (exports) {
|
|
|
6829
6868
|
}
|
|
6830
6869
|
};
|
|
6831
6870
|
|
|
6832
|
-
const { parse } = PathConvert;
|
|
6871
|
+
const { parse, objectToCanvasData } = PathConvert;
|
|
6833
6872
|
const emptyPaint = {};
|
|
6834
6873
|
const debug$2 = Debug.get('UIData');
|
|
6835
6874
|
class UIData extends LeafData {
|
|
@@ -6843,10 +6882,11 @@ var LeaferUI = (function (exports) {
|
|
|
6843
6882
|
scaleX = -scaleX;
|
|
6844
6883
|
return scaleX > 1 ? strokeWidth / scaleX : strokeWidth;
|
|
6845
6884
|
}
|
|
6846
|
-
else
|
|
6885
|
+
else
|
|
6847
6886
|
return strokeWidth;
|
|
6848
|
-
}
|
|
6849
6887
|
}
|
|
6888
|
+
get __hasStroke() { return this.stroke && this.strokeWidth; }
|
|
6889
|
+
get __clipAfterFill() { return (this.cornerRadius || this.__pathInputed); }
|
|
6850
6890
|
get __autoWidth() { return !this._width; }
|
|
6851
6891
|
get __autoHeight() { return !this._height; }
|
|
6852
6892
|
get __autoSide() { return !this._width || !this._height; }
|
|
@@ -6863,9 +6903,8 @@ var LeaferUI = (function (exports) {
|
|
|
6863
6903
|
this.__leaf.scaleX *= -1;
|
|
6864
6904
|
debug$2.warn('width < 0, instead -scaleX ', this);
|
|
6865
6905
|
}
|
|
6866
|
-
else
|
|
6906
|
+
else
|
|
6867
6907
|
this._width = value;
|
|
6868
|
-
}
|
|
6869
6908
|
}
|
|
6870
6909
|
setHeight(value) {
|
|
6871
6910
|
if (value < 0) {
|
|
@@ -6873,9 +6912,8 @@ var LeaferUI = (function (exports) {
|
|
|
6873
6912
|
this.__leaf.scaleY *= -1;
|
|
6874
6913
|
debug$2.warn('height < 0, instead -scaleY', this);
|
|
6875
6914
|
}
|
|
6876
|
-
else
|
|
6915
|
+
else
|
|
6877
6916
|
this._height = value;
|
|
6878
|
-
}
|
|
6879
6917
|
}
|
|
6880
6918
|
setFill(value) {
|
|
6881
6919
|
if (this.__naturalWidth)
|
|
@@ -6916,9 +6954,10 @@ var LeaferUI = (function (exports) {
|
|
|
6916
6954
|
}
|
|
6917
6955
|
}
|
|
6918
6956
|
setPath(value) {
|
|
6919
|
-
|
|
6957
|
+
const isString = typeof value === 'string';
|
|
6958
|
+
if (isString || (value && typeof value[0] === 'object')) {
|
|
6920
6959
|
this.__setInput('path', value);
|
|
6921
|
-
this._path = parse(value);
|
|
6960
|
+
this._path = isString ? parse(value) : objectToCanvasData(value);
|
|
6922
6961
|
}
|
|
6923
6962
|
else {
|
|
6924
6963
|
if (this.__input)
|
|
@@ -6933,12 +6972,8 @@ var LeaferUI = (function (exports) {
|
|
|
6933
6972
|
value = value.filter((item) => item.visible !== false);
|
|
6934
6973
|
this._shadow = value.length ? value : null;
|
|
6935
6974
|
}
|
|
6936
|
-
else
|
|
6937
|
-
this._shadow = value.visible
|
|
6938
|
-
}
|
|
6939
|
-
else {
|
|
6940
|
-
this._shadow = null;
|
|
6941
|
-
}
|
|
6975
|
+
else
|
|
6976
|
+
this._shadow = value && value.visible !== false ? [value] : null;
|
|
6942
6977
|
}
|
|
6943
6978
|
setInnerShadow(value) {
|
|
6944
6979
|
this.__setInput('innerShadow', value);
|
|
@@ -6947,12 +6982,8 @@ var LeaferUI = (function (exports) {
|
|
|
6947
6982
|
value = value.filter((item) => item.visible !== false);
|
|
6948
6983
|
this._innerShadow = value.length ? value : null;
|
|
6949
6984
|
}
|
|
6950
|
-
else
|
|
6951
|
-
this._innerShadow = value.visible
|
|
6952
|
-
}
|
|
6953
|
-
else {
|
|
6954
|
-
this._innerShadow = null;
|
|
6955
|
-
}
|
|
6985
|
+
else
|
|
6986
|
+
this._innerShadow = value && value.visible !== false ? [value] : null;
|
|
6956
6987
|
}
|
|
6957
6988
|
__computePaint() {
|
|
6958
6989
|
const { fill, stroke } = this.__input;
|
|
@@ -6963,24 +6994,19 @@ var LeaferUI = (function (exports) {
|
|
|
6963
6994
|
this.__needComputePaint = false;
|
|
6964
6995
|
}
|
|
6965
6996
|
}
|
|
6966
|
-
const UnitConvert = {
|
|
6967
|
-
number(value, percentRefer) {
|
|
6968
|
-
if (typeof value === 'object')
|
|
6969
|
-
return value.type === 'percent' ? value.value * percentRefer : value.value;
|
|
6970
|
-
return value;
|
|
6971
|
-
}
|
|
6972
|
-
};
|
|
6973
6997
|
|
|
6974
6998
|
class GroupData extends UIData {
|
|
6975
6999
|
}
|
|
6976
7000
|
|
|
6977
7001
|
class BoxData extends GroupData {
|
|
6978
7002
|
get __boxStroke() { return !this.__pathInputed; }
|
|
7003
|
+
get __drawAfterFill() { return this.overflow === 'hide' && this.__clipAfterFill && this.__leaf.children.length; }
|
|
7004
|
+
get __clipAfterFill() { return this.__leaf.isOverflow || super.__clipAfterFill; }
|
|
6979
7005
|
}
|
|
6980
7006
|
|
|
6981
7007
|
class LeaferData extends GroupData {
|
|
6982
|
-
__getInputData() {
|
|
6983
|
-
const data = super.__getInputData();
|
|
7008
|
+
__getInputData(names, options) {
|
|
7009
|
+
const data = super.__getInputData(names, options);
|
|
6984
7010
|
canvasSizeAttrs.forEach(key => delete data[key]);
|
|
6985
7011
|
return data;
|
|
6986
7012
|
}
|
|
@@ -7007,6 +7033,7 @@ var LeaferUI = (function (exports) {
|
|
|
7007
7033
|
}
|
|
7008
7034
|
|
|
7009
7035
|
class PathData extends UIData {
|
|
7036
|
+
get __pathInputed() { return 2; }
|
|
7010
7037
|
}
|
|
7011
7038
|
|
|
7012
7039
|
class PenData extends GroupData {
|
|
@@ -7053,16 +7080,18 @@ var LeaferUI = (function (exports) {
|
|
|
7053
7080
|
delete data.fill;
|
|
7054
7081
|
return data;
|
|
7055
7082
|
}
|
|
7056
|
-
__getInputData() {
|
|
7057
|
-
const data = super.__getInputData();
|
|
7083
|
+
__getInputData(names, options) {
|
|
7084
|
+
const data = super.__getInputData(names, options);
|
|
7058
7085
|
delete data.fill;
|
|
7059
7086
|
return data;
|
|
7060
7087
|
}
|
|
7061
7088
|
}
|
|
7062
7089
|
|
|
7063
7090
|
class CanvasData extends RectData {
|
|
7064
|
-
|
|
7065
|
-
|
|
7091
|
+
get __isCanvas() { return true; }
|
|
7092
|
+
get __drawAfterFill() { return true; }
|
|
7093
|
+
__getInputData(names, options) {
|
|
7094
|
+
const data = super.__getInputData(names, options);
|
|
7066
7095
|
data.url = this.__leaf.canvas.toDataURL('image/png');
|
|
7067
7096
|
return data;
|
|
7068
7097
|
}
|
|
@@ -7089,16 +7118,12 @@ var LeaferUI = (function (exports) {
|
|
|
7089
7118
|
let width = 0;
|
|
7090
7119
|
const { shadow, innerShadow, blur, backgroundBlur } = this.__;
|
|
7091
7120
|
if (shadow)
|
|
7092
|
-
shadow.forEach(item =>
|
|
7093
|
-
width = Math.max(width, Math.max(Math.abs(item.y), Math.abs(item.x)) + (item.spread > 0 ? item.spread : 0) + item.blur * 1.5);
|
|
7094
|
-
});
|
|
7121
|
+
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));
|
|
7095
7122
|
if (blur)
|
|
7096
7123
|
width = Math.max(width, blur);
|
|
7097
7124
|
let shapeWidth = width = Math.ceil(width);
|
|
7098
7125
|
if (innerShadow)
|
|
7099
|
-
innerShadow.forEach(item =>
|
|
7100
|
-
shapeWidth = Math.max(shapeWidth, Math.max(Math.abs(item.y), Math.abs(item.x)) + (item.spread < 0 ? -item.spread : 0) + item.blur * 1.5);
|
|
7101
|
-
});
|
|
7126
|
+
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));
|
|
7102
7127
|
if (backgroundBlur)
|
|
7103
7128
|
shapeWidth = Math.max(shapeWidth, backgroundBlur);
|
|
7104
7129
|
this.__layout.renderShapeSpread = shapeWidth;
|
|
@@ -7180,6 +7205,16 @@ var LeaferUI = (function (exports) {
|
|
|
7180
7205
|
if (stroke && !ignoreStroke)
|
|
7181
7206
|
this.__.__pixelStroke ? Paint.strokes(stroke, this, canvas) : Paint.stroke('#000000', this, canvas);
|
|
7182
7207
|
}
|
|
7208
|
+
},
|
|
7209
|
+
__drawAfterFill(canvas, options) {
|
|
7210
|
+
if (this.__.__clipAfterFill) {
|
|
7211
|
+
canvas.save();
|
|
7212
|
+
this.windingRule ? canvas.clip(this.windingRule) : canvas.clip();
|
|
7213
|
+
this.__drawContent(canvas, options);
|
|
7214
|
+
canvas.restore();
|
|
7215
|
+
}
|
|
7216
|
+
else
|
|
7217
|
+
this.__drawContent(canvas, options);
|
|
7183
7218
|
}
|
|
7184
7219
|
};
|
|
7185
7220
|
function drawFast(ui, canvas, options) {
|
|
@@ -7246,8 +7281,8 @@ var LeaferUI = (function (exports) {
|
|
|
7246
7281
|
return pen;
|
|
7247
7282
|
}
|
|
7248
7283
|
get editConfig() { return undefined; }
|
|
7249
|
-
get editOuter() { return
|
|
7250
|
-
get editInner() { return '
|
|
7284
|
+
get editOuter() { return ''; }
|
|
7285
|
+
get editInner() { return ''; }
|
|
7251
7286
|
constructor(data) {
|
|
7252
7287
|
super(data);
|
|
7253
7288
|
}
|
|
@@ -7258,9 +7293,8 @@ var LeaferUI = (function (exports) {
|
|
|
7258
7293
|
Object.assign(this, data);
|
|
7259
7294
|
this.lockNormalStyle = false;
|
|
7260
7295
|
}
|
|
7261
|
-
else
|
|
7296
|
+
else
|
|
7262
7297
|
Object.assign(this, data);
|
|
7263
|
-
}
|
|
7264
7298
|
}
|
|
7265
7299
|
get(name) {
|
|
7266
7300
|
return typeof name === 'string' ? this.__.__getInput(name) : this.__.__getInputData(name);
|
|
@@ -7562,23 +7596,13 @@ var LeaferUI = (function (exports) {
|
|
|
7562
7596
|
if (data.children) {
|
|
7563
7597
|
const { children } = data;
|
|
7564
7598
|
delete data.children;
|
|
7565
|
-
|
|
7566
|
-
this.__setBranch();
|
|
7567
|
-
}
|
|
7568
|
-
else {
|
|
7569
|
-
this.clear();
|
|
7570
|
-
}
|
|
7599
|
+
this.children ? this.clear() : this.__setBranch();
|
|
7571
7600
|
super.set(data, isTemp);
|
|
7572
|
-
|
|
7573
|
-
children.forEach(childData => {
|
|
7574
|
-
child = childData.__ ? childData : UICreator.get(childData.tag, childData);
|
|
7575
|
-
this.add(child);
|
|
7576
|
-
});
|
|
7601
|
+
children.forEach(child => this.add(child));
|
|
7577
7602
|
data.children = children;
|
|
7578
7603
|
}
|
|
7579
|
-
else
|
|
7604
|
+
else
|
|
7580
7605
|
super.set(data, isTemp);
|
|
7581
|
-
}
|
|
7582
7606
|
}
|
|
7583
7607
|
toJSON(options) {
|
|
7584
7608
|
const data = super.toJSON(options);
|
|
@@ -8010,9 +8034,7 @@ var LeaferUI = (function (exports) {
|
|
|
8010
8034
|
}
|
|
8011
8035
|
__updateStrokeSpread() { return 0; }
|
|
8012
8036
|
__updateRectRenderSpread() { return 0; }
|
|
8013
|
-
__updateRenderSpread() {
|
|
8014
|
-
return this.__updateRectRenderSpread() || -1;
|
|
8015
|
-
}
|
|
8037
|
+
__updateRenderSpread() { return this.__updateRectRenderSpread() || -1; }
|
|
8016
8038
|
__updateRectBoxBounds() { }
|
|
8017
8039
|
__updateBoxBounds(_secondLayout) {
|
|
8018
8040
|
const data = this.__;
|
|
@@ -8032,13 +8054,11 @@ var LeaferUI = (function (exports) {
|
|
|
8032
8054
|
}
|
|
8033
8055
|
this.__updateNaturalSize();
|
|
8034
8056
|
}
|
|
8035
|
-
else
|
|
8057
|
+
else
|
|
8036
8058
|
this.__updateRectBoxBounds();
|
|
8037
|
-
}
|
|
8038
8059
|
}
|
|
8039
|
-
else
|
|
8060
|
+
else
|
|
8040
8061
|
this.__updateRectBoxBounds();
|
|
8041
|
-
}
|
|
8042
8062
|
}
|
|
8043
8063
|
__updateStrokeBounds() { }
|
|
8044
8064
|
__updateRenderBounds() {
|
|
@@ -8048,14 +8068,13 @@ var LeaferUI = (function (exports) {
|
|
|
8048
8068
|
super.__updateRenderBounds();
|
|
8049
8069
|
copy$2(childrenRenderBounds, renderBounds);
|
|
8050
8070
|
this.__updateRectRenderBounds();
|
|
8051
|
-
isOverflow = !includes$1(renderBounds, childrenRenderBounds)
|
|
8071
|
+
isOverflow = !includes$1(renderBounds, childrenRenderBounds);
|
|
8072
|
+
if (isOverflow && this.__.overflow !== 'hide')
|
|
8073
|
+
add(renderBounds, childrenRenderBounds);
|
|
8052
8074
|
}
|
|
8053
|
-
else
|
|
8075
|
+
else
|
|
8054
8076
|
this.__updateRectRenderBounds();
|
|
8055
|
-
|
|
8056
|
-
this.isOverflow !== isOverflow && (this.isOverflow = isOverflow);
|
|
8057
|
-
if (!(this.__.__drawAfterFill = this.__.overflow === 'hide') && isOverflow)
|
|
8058
|
-
add(renderBounds, childrenRenderBounds);
|
|
8077
|
+
!this.isOverflow !== !isOverflow && (this.isOverflow = isOverflow);
|
|
8059
8078
|
}
|
|
8060
8079
|
__updateRectRenderBounds() { }
|
|
8061
8080
|
__updateRectChange() { }
|
|
@@ -8075,20 +8094,9 @@ var LeaferUI = (function (exports) {
|
|
|
8075
8094
|
this.__renderGroup(canvas, options);
|
|
8076
8095
|
}
|
|
8077
8096
|
}
|
|
8078
|
-
|
|
8079
|
-
|
|
8080
|
-
if (this.
|
|
8081
|
-
canvas.save();
|
|
8082
|
-
canvas.clip();
|
|
8083
|
-
if (length)
|
|
8084
|
-
this.__renderGroup(canvas, options);
|
|
8085
|
-
canvas.restore();
|
|
8086
|
-
}
|
|
8087
|
-
else {
|
|
8088
|
-
if (length)
|
|
8089
|
-
this.__renderGroup(canvas, options);
|
|
8090
|
-
}
|
|
8091
|
-
if (this.__.stroke && length) {
|
|
8097
|
+
__drawContent(canvas, options) {
|
|
8098
|
+
this.__renderGroup(canvas, options);
|
|
8099
|
+
if (this.__.__hasStroke) {
|
|
8092
8100
|
canvas.setWorld(this.__nowWorld);
|
|
8093
8101
|
this.__drawRenderPath(canvas);
|
|
8094
8102
|
}
|
|
@@ -8252,17 +8260,15 @@ var LeaferUI = (function (exports) {
|
|
|
8252
8260
|
if (data.__useArrow)
|
|
8253
8261
|
PathArrow.addArrows(this, false);
|
|
8254
8262
|
}
|
|
8255
|
-
else
|
|
8263
|
+
else
|
|
8256
8264
|
super.__updateRenderPath();
|
|
8257
|
-
}
|
|
8258
8265
|
}
|
|
8259
8266
|
__updateBoxBounds() {
|
|
8260
8267
|
if (this.points) {
|
|
8261
8268
|
toBounds$1(this.__.__pathForRender, this.__layout.boxBounds);
|
|
8262
8269
|
}
|
|
8263
|
-
else
|
|
8270
|
+
else
|
|
8264
8271
|
super.__updateBoxBounds();
|
|
8265
|
-
}
|
|
8266
8272
|
}
|
|
8267
8273
|
};
|
|
8268
8274
|
__decorate([
|
|
@@ -8400,7 +8406,6 @@ var LeaferUI = (function (exports) {
|
|
|
8400
8406
|
super(data);
|
|
8401
8407
|
this.canvas = Creator.canvas(this.__);
|
|
8402
8408
|
this.context = this.canvas.context;
|
|
8403
|
-
this.__.__isCanvas = this.__.__drawAfterFill = true;
|
|
8404
8409
|
if (data && data.url)
|
|
8405
8410
|
this.drawImage(data.url);
|
|
8406
8411
|
}
|
|
@@ -8413,8 +8418,7 @@ var LeaferUI = (function (exports) {
|
|
|
8413
8418
|
});
|
|
8414
8419
|
}
|
|
8415
8420
|
draw(ui, offset, scale, rotation) {
|
|
8416
|
-
ui.
|
|
8417
|
-
const matrix = new Matrix(ui.__world).invert();
|
|
8421
|
+
const matrix = new Matrix(ui.worldTransform).invert();
|
|
8418
8422
|
const m = new Matrix();
|
|
8419
8423
|
if (offset)
|
|
8420
8424
|
m.translate(offset.x, offset.y);
|
|
@@ -8429,17 +8433,9 @@ var LeaferUI = (function (exports) {
|
|
|
8429
8433
|
paint() {
|
|
8430
8434
|
this.forceRender();
|
|
8431
8435
|
}
|
|
8432
|
-
|
|
8433
|
-
const { width, height
|
|
8434
|
-
|
|
8435
|
-
canvas.save();
|
|
8436
|
-
canvas.clip();
|
|
8437
|
-
canvas.drawImage(view, 0, 0, view.width, view.height, 0, 0, width, height);
|
|
8438
|
-
canvas.restore();
|
|
8439
|
-
}
|
|
8440
|
-
else {
|
|
8441
|
-
canvas.drawImage(view, 0, 0, view.width, view.height, 0, 0, width, height);
|
|
8442
|
-
}
|
|
8436
|
+
__drawContent(canvas, _options) {
|
|
8437
|
+
const { width, height } = this.__, { view } = this.canvas;
|
|
8438
|
+
canvas.drawImage(view, 0, 0, view.width, view.height, 0, 0, width, height);
|
|
8443
8439
|
}
|
|
8444
8440
|
__updateSize() {
|
|
8445
8441
|
const { canvas } = this;
|
|
@@ -8483,7 +8479,6 @@ var LeaferUI = (function (exports) {
|
|
|
8483
8479
|
const { copyAndSpread, includes, isSame: isSame$1, spread, setList } = BoundsHelper;
|
|
8484
8480
|
exports.Text = class Text extends exports.UI {
|
|
8485
8481
|
get __tag() { return 'Text'; }
|
|
8486
|
-
get editInner() { return 'TextEditor'; }
|
|
8487
8482
|
get textDrawData() {
|
|
8488
8483
|
this.__layout.update();
|
|
8489
8484
|
return this.__.__textDrawData;
|
|
@@ -8558,9 +8553,8 @@ var LeaferUI = (function (exports) {
|
|
|
8558
8553
|
layout.renderChanged = true;
|
|
8559
8554
|
setList(data.__textBoxBounds = {}, [b, bounds]);
|
|
8560
8555
|
}
|
|
8561
|
-
else
|
|
8556
|
+
else
|
|
8562
8557
|
data.__textBoxBounds = contentBounds;
|
|
8563
|
-
}
|
|
8564
8558
|
}
|
|
8565
8559
|
__updateRenderSpread() {
|
|
8566
8560
|
let width = super.__updateRenderSpread();
|
|
@@ -8649,7 +8643,6 @@ var LeaferUI = (function (exports) {
|
|
|
8649
8643
|
get __tag() { return 'Path'; }
|
|
8650
8644
|
constructor(data) {
|
|
8651
8645
|
super(data);
|
|
8652
|
-
this.__.__pathInputed = 2;
|
|
8653
8646
|
}
|
|
8654
8647
|
};
|
|
8655
8648
|
__decorate([
|
|
@@ -9327,7 +9320,7 @@ var LeaferUI = (function (exports) {
|
|
|
9327
9320
|
}
|
|
9328
9321
|
if (allowPaint) {
|
|
9329
9322
|
canvas.save();
|
|
9330
|
-
canvas.clip();
|
|
9323
|
+
ui.windingRule ? canvas.clip(ui.windingRule) : canvas.clip();
|
|
9331
9324
|
if (paint.blendMode)
|
|
9332
9325
|
canvas.blendMode = paint.blendMode;
|
|
9333
9326
|
if (data.opacity)
|