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.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]);
|
|
@@ -4395,13 +4426,10 @@ class LeafLayout {
|
|
|
4395
4426
|
update() {
|
|
4396
4427
|
const { leafer } = this.leaf;
|
|
4397
4428
|
if (leafer) {
|
|
4398
|
-
if (leafer.ready)
|
|
4399
|
-
|
|
4400
|
-
|
|
4401
|
-
}
|
|
4402
|
-
else {
|
|
4429
|
+
if (leafer.ready)
|
|
4430
|
+
leafer.watcher.changed && leafer.layouter.layout();
|
|
4431
|
+
else
|
|
4403
4432
|
leafer.start();
|
|
4404
|
-
}
|
|
4405
4433
|
}
|
|
4406
4434
|
else {
|
|
4407
4435
|
let root = this.leaf;
|
|
@@ -5159,7 +5187,7 @@ const LeafRender = {
|
|
|
5159
5187
|
if (this.__worldOpacity) {
|
|
5160
5188
|
canvas.setWorld(this.__nowWorld = this.__getNowWorld(options));
|
|
5161
5189
|
this.__drawRenderPath(canvas);
|
|
5162
|
-
this.
|
|
5190
|
+
this.windingRule ? canvas.clip(this.windingRule) : canvas.clip();
|
|
5163
5191
|
}
|
|
5164
5192
|
},
|
|
5165
5193
|
__updateWorldOpacity() {
|
|
@@ -5676,11 +5704,17 @@ let Branch = class Branch extends Leaf {
|
|
|
5676
5704
|
add(child, index) {
|
|
5677
5705
|
if (child === this)
|
|
5678
5706
|
return;
|
|
5679
|
-
|
|
5707
|
+
const noIndex = index === undefined;
|
|
5708
|
+
if (!child.__) {
|
|
5709
|
+
if (child instanceof Array)
|
|
5710
|
+
return child.forEach(item => { this.add(item, index); noIndex || index++; });
|
|
5711
|
+
else
|
|
5712
|
+
child = UICreator.get(child.tag, child);
|
|
5713
|
+
}
|
|
5680
5714
|
if (child.parent)
|
|
5681
5715
|
child.parent.remove(child);
|
|
5682
5716
|
child.parent = this;
|
|
5683
|
-
|
|
5717
|
+
noIndex ? this.children.push(child) : this.children.splice(index, 0, child);
|
|
5684
5718
|
if (child.isBranch)
|
|
5685
5719
|
this.__.__childBranchNumber = (this.__.__childBranchNumber || 0) + 1;
|
|
5686
5720
|
child.__layout.boxChanged || child.__layout.boxChange();
|
|
@@ -5694,9 +5728,7 @@ let Branch = class Branch extends Leaf {
|
|
|
5694
5728
|
}
|
|
5695
5729
|
this.__layout.affectChildrenSort && this.__layout.childrenSortChange();
|
|
5696
5730
|
}
|
|
5697
|
-
addMany(...children) {
|
|
5698
|
-
children.forEach(child => this.add(child));
|
|
5699
|
-
}
|
|
5731
|
+
addMany(...children) { this.add(children); }
|
|
5700
5732
|
remove(child, destroy) {
|
|
5701
5733
|
if (child) {
|
|
5702
5734
|
if (child.__) {
|
|
@@ -5924,7 +5956,7 @@ class LeafLevelList {
|
|
|
5924
5956
|
}
|
|
5925
5957
|
}
|
|
5926
5958
|
|
|
5927
|
-
const version = "1.0.
|
|
5959
|
+
const version = "1.0.7";
|
|
5928
5960
|
|
|
5929
5961
|
const debug$5 = Debug.get('LeaferCanvas');
|
|
5930
5962
|
class LeaferCanvas extends LeaferCanvasBase {
|
|
@@ -6082,7 +6114,7 @@ class LeaferCanvas extends LeaferCanvasBase {
|
|
|
6082
6114
|
const oldSize = {};
|
|
6083
6115
|
DataHelper.copyAttrs(oldSize, this, canvasSizeAttrs);
|
|
6084
6116
|
this.resize(size);
|
|
6085
|
-
if (this.width !== undefined)
|
|
6117
|
+
if (this.resizeListener && this.width !== undefined)
|
|
6086
6118
|
this.resizeListener(new ResizeEvent(size, oldSize));
|
|
6087
6119
|
}
|
|
6088
6120
|
unrealCanvas() {
|
|
@@ -6806,6 +6838,13 @@ function zoomLayerType() {
|
|
|
6806
6838
|
|
|
6807
6839
|
const TextConvert = {};
|
|
6808
6840
|
const ColorConvert = {};
|
|
6841
|
+
const UnitConvert = {
|
|
6842
|
+
number(value, percentRefer) {
|
|
6843
|
+
if (typeof value === 'object')
|
|
6844
|
+
return value.type === 'percent' ? value.value * percentRefer : value.value;
|
|
6845
|
+
return value;
|
|
6846
|
+
}
|
|
6847
|
+
};
|
|
6809
6848
|
const PathArrow = {};
|
|
6810
6849
|
const Paint = {};
|
|
6811
6850
|
const PaintImage = {};
|
|
@@ -6826,7 +6865,7 @@ const Transition = {
|
|
|
6826
6865
|
}
|
|
6827
6866
|
};
|
|
6828
6867
|
|
|
6829
|
-
const { parse } = PathConvert;
|
|
6868
|
+
const { parse, objectToCanvasData } = PathConvert;
|
|
6830
6869
|
const emptyPaint = {};
|
|
6831
6870
|
const debug$2 = Debug.get('UIData');
|
|
6832
6871
|
class UIData extends LeafData {
|
|
@@ -6840,10 +6879,11 @@ class UIData extends LeafData {
|
|
|
6840
6879
|
scaleX = -scaleX;
|
|
6841
6880
|
return scaleX > 1 ? strokeWidth / scaleX : strokeWidth;
|
|
6842
6881
|
}
|
|
6843
|
-
else
|
|
6882
|
+
else
|
|
6844
6883
|
return strokeWidth;
|
|
6845
|
-
}
|
|
6846
6884
|
}
|
|
6885
|
+
get __hasStroke() { return this.stroke && this.strokeWidth; }
|
|
6886
|
+
get __clipAfterFill() { return (this.cornerRadius || this.__pathInputed); }
|
|
6847
6887
|
get __autoWidth() { return !this._width; }
|
|
6848
6888
|
get __autoHeight() { return !this._height; }
|
|
6849
6889
|
get __autoSide() { return !this._width || !this._height; }
|
|
@@ -6860,9 +6900,8 @@ class UIData extends LeafData {
|
|
|
6860
6900
|
this.__leaf.scaleX *= -1;
|
|
6861
6901
|
debug$2.warn('width < 0, instead -scaleX ', this);
|
|
6862
6902
|
}
|
|
6863
|
-
else
|
|
6903
|
+
else
|
|
6864
6904
|
this._width = value;
|
|
6865
|
-
}
|
|
6866
6905
|
}
|
|
6867
6906
|
setHeight(value) {
|
|
6868
6907
|
if (value < 0) {
|
|
@@ -6870,9 +6909,8 @@ class UIData extends LeafData {
|
|
|
6870
6909
|
this.__leaf.scaleY *= -1;
|
|
6871
6910
|
debug$2.warn('height < 0, instead -scaleY', this);
|
|
6872
6911
|
}
|
|
6873
|
-
else
|
|
6912
|
+
else
|
|
6874
6913
|
this._height = value;
|
|
6875
|
-
}
|
|
6876
6914
|
}
|
|
6877
6915
|
setFill(value) {
|
|
6878
6916
|
if (this.__naturalWidth)
|
|
@@ -6913,9 +6951,10 @@ class UIData extends LeafData {
|
|
|
6913
6951
|
}
|
|
6914
6952
|
}
|
|
6915
6953
|
setPath(value) {
|
|
6916
|
-
|
|
6954
|
+
const isString = typeof value === 'string';
|
|
6955
|
+
if (isString || (value && typeof value[0] === 'object')) {
|
|
6917
6956
|
this.__setInput('path', value);
|
|
6918
|
-
this._path = parse(value);
|
|
6957
|
+
this._path = isString ? parse(value) : objectToCanvasData(value);
|
|
6919
6958
|
}
|
|
6920
6959
|
else {
|
|
6921
6960
|
if (this.__input)
|
|
@@ -6930,12 +6969,8 @@ class UIData extends LeafData {
|
|
|
6930
6969
|
value = value.filter((item) => item.visible !== false);
|
|
6931
6970
|
this._shadow = value.length ? value : null;
|
|
6932
6971
|
}
|
|
6933
|
-
else
|
|
6934
|
-
this._shadow = value.visible
|
|
6935
|
-
}
|
|
6936
|
-
else {
|
|
6937
|
-
this._shadow = null;
|
|
6938
|
-
}
|
|
6972
|
+
else
|
|
6973
|
+
this._shadow = value && value.visible !== false ? [value] : null;
|
|
6939
6974
|
}
|
|
6940
6975
|
setInnerShadow(value) {
|
|
6941
6976
|
this.__setInput('innerShadow', value);
|
|
@@ -6944,12 +6979,8 @@ class UIData extends LeafData {
|
|
|
6944
6979
|
value = value.filter((item) => item.visible !== false);
|
|
6945
6980
|
this._innerShadow = value.length ? value : null;
|
|
6946
6981
|
}
|
|
6947
|
-
else
|
|
6948
|
-
this._innerShadow = value.visible
|
|
6949
|
-
}
|
|
6950
|
-
else {
|
|
6951
|
-
this._innerShadow = null;
|
|
6952
|
-
}
|
|
6982
|
+
else
|
|
6983
|
+
this._innerShadow = value && value.visible !== false ? [value] : null;
|
|
6953
6984
|
}
|
|
6954
6985
|
__computePaint() {
|
|
6955
6986
|
const { fill, stroke } = this.__input;
|
|
@@ -6960,24 +6991,19 @@ class UIData extends LeafData {
|
|
|
6960
6991
|
this.__needComputePaint = false;
|
|
6961
6992
|
}
|
|
6962
6993
|
}
|
|
6963
|
-
const UnitConvert = {
|
|
6964
|
-
number(value, percentRefer) {
|
|
6965
|
-
if (typeof value === 'object')
|
|
6966
|
-
return value.type === 'percent' ? value.value * percentRefer : value.value;
|
|
6967
|
-
return value;
|
|
6968
|
-
}
|
|
6969
|
-
};
|
|
6970
6994
|
|
|
6971
6995
|
class GroupData extends UIData {
|
|
6972
6996
|
}
|
|
6973
6997
|
|
|
6974
6998
|
class BoxData extends GroupData {
|
|
6975
6999
|
get __boxStroke() { return !this.__pathInputed; }
|
|
7000
|
+
get __drawAfterFill() { return this.overflow === 'hide' && this.__clipAfterFill && this.__leaf.children.length; }
|
|
7001
|
+
get __clipAfterFill() { return this.__leaf.isOverflow || super.__clipAfterFill; }
|
|
6976
7002
|
}
|
|
6977
7003
|
|
|
6978
7004
|
class LeaferData extends GroupData {
|
|
6979
|
-
__getInputData() {
|
|
6980
|
-
const data = super.__getInputData();
|
|
7005
|
+
__getInputData(names, options) {
|
|
7006
|
+
const data = super.__getInputData(names, options);
|
|
6981
7007
|
canvasSizeAttrs.forEach(key => delete data[key]);
|
|
6982
7008
|
return data;
|
|
6983
7009
|
}
|
|
@@ -7004,6 +7030,7 @@ class StarData extends UIData {
|
|
|
7004
7030
|
}
|
|
7005
7031
|
|
|
7006
7032
|
class PathData extends UIData {
|
|
7033
|
+
get __pathInputed() { return 2; }
|
|
7007
7034
|
}
|
|
7008
7035
|
|
|
7009
7036
|
class PenData extends GroupData {
|
|
@@ -7050,16 +7077,18 @@ class ImageData extends RectData {
|
|
|
7050
7077
|
delete data.fill;
|
|
7051
7078
|
return data;
|
|
7052
7079
|
}
|
|
7053
|
-
__getInputData() {
|
|
7054
|
-
const data = super.__getInputData();
|
|
7080
|
+
__getInputData(names, options) {
|
|
7081
|
+
const data = super.__getInputData(names, options);
|
|
7055
7082
|
delete data.fill;
|
|
7056
7083
|
return data;
|
|
7057
7084
|
}
|
|
7058
7085
|
}
|
|
7059
7086
|
|
|
7060
7087
|
class CanvasData extends RectData {
|
|
7061
|
-
|
|
7062
|
-
|
|
7088
|
+
get __isCanvas() { return true; }
|
|
7089
|
+
get __drawAfterFill() { return true; }
|
|
7090
|
+
__getInputData(names, options) {
|
|
7091
|
+
const data = super.__getInputData(names, options);
|
|
7063
7092
|
data.url = this.__leaf.canvas.toDataURL('image/png');
|
|
7064
7093
|
return data;
|
|
7065
7094
|
}
|
|
@@ -7086,16 +7115,12 @@ const UIBounds = {
|
|
|
7086
7115
|
let width = 0;
|
|
7087
7116
|
const { shadow, innerShadow, blur, backgroundBlur } = this.__;
|
|
7088
7117
|
if (shadow)
|
|
7089
|
-
shadow.forEach(item =>
|
|
7090
|
-
width = Math.max(width, Math.max(Math.abs(item.y), Math.abs(item.x)) + (item.spread > 0 ? item.spread : 0) + item.blur * 1.5);
|
|
7091
|
-
});
|
|
7118
|
+
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));
|
|
7092
7119
|
if (blur)
|
|
7093
7120
|
width = Math.max(width, blur);
|
|
7094
7121
|
let shapeWidth = width = Math.ceil(width);
|
|
7095
7122
|
if (innerShadow)
|
|
7096
|
-
innerShadow.forEach(item =>
|
|
7097
|
-
shapeWidth = Math.max(shapeWidth, Math.max(Math.abs(item.y), Math.abs(item.x)) + (item.spread < 0 ? -item.spread : 0) + item.blur * 1.5);
|
|
7098
|
-
});
|
|
7123
|
+
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));
|
|
7099
7124
|
if (backgroundBlur)
|
|
7100
7125
|
shapeWidth = Math.max(shapeWidth, backgroundBlur);
|
|
7101
7126
|
this.__layout.renderShapeSpread = shapeWidth;
|
|
@@ -7177,6 +7202,16 @@ const UIRender = {
|
|
|
7177
7202
|
if (stroke && !ignoreStroke)
|
|
7178
7203
|
this.__.__pixelStroke ? Paint.strokes(stroke, this, canvas) : Paint.stroke('#000000', this, canvas);
|
|
7179
7204
|
}
|
|
7205
|
+
},
|
|
7206
|
+
__drawAfterFill(canvas, options) {
|
|
7207
|
+
if (this.__.__clipAfterFill) {
|
|
7208
|
+
canvas.save();
|
|
7209
|
+
this.windingRule ? canvas.clip(this.windingRule) : canvas.clip();
|
|
7210
|
+
this.__drawContent(canvas, options);
|
|
7211
|
+
canvas.restore();
|
|
7212
|
+
}
|
|
7213
|
+
else
|
|
7214
|
+
this.__drawContent(canvas, options);
|
|
7180
7215
|
}
|
|
7181
7216
|
};
|
|
7182
7217
|
function drawFast(ui, canvas, options) {
|
|
@@ -7243,8 +7278,8 @@ let UI = UI_1 = class UI extends Leaf {
|
|
|
7243
7278
|
return pen;
|
|
7244
7279
|
}
|
|
7245
7280
|
get editConfig() { return undefined; }
|
|
7246
|
-
get editOuter() { return
|
|
7247
|
-
get editInner() { return '
|
|
7281
|
+
get editOuter() { return ''; }
|
|
7282
|
+
get editInner() { return ''; }
|
|
7248
7283
|
constructor(data) {
|
|
7249
7284
|
super(data);
|
|
7250
7285
|
}
|
|
@@ -7255,9 +7290,8 @@ let UI = UI_1 = class UI extends Leaf {
|
|
|
7255
7290
|
Object.assign(this, data);
|
|
7256
7291
|
this.lockNormalStyle = false;
|
|
7257
7292
|
}
|
|
7258
|
-
else
|
|
7293
|
+
else
|
|
7259
7294
|
Object.assign(this, data);
|
|
7260
|
-
}
|
|
7261
7295
|
}
|
|
7262
7296
|
get(name) {
|
|
7263
7297
|
return typeof name === 'string' ? this.__.__getInput(name) : this.__.__getInputData(name);
|
|
@@ -7559,23 +7593,13 @@ let Group = class Group extends UI {
|
|
|
7559
7593
|
if (data.children) {
|
|
7560
7594
|
const { children } = data;
|
|
7561
7595
|
delete data.children;
|
|
7562
|
-
|
|
7563
|
-
this.__setBranch();
|
|
7564
|
-
}
|
|
7565
|
-
else {
|
|
7566
|
-
this.clear();
|
|
7567
|
-
}
|
|
7596
|
+
this.children ? this.clear() : this.__setBranch();
|
|
7568
7597
|
super.set(data, isTemp);
|
|
7569
|
-
|
|
7570
|
-
children.forEach(childData => {
|
|
7571
|
-
child = childData.__ ? childData : UICreator.get(childData.tag, childData);
|
|
7572
|
-
this.add(child);
|
|
7573
|
-
});
|
|
7598
|
+
children.forEach(child => this.add(child));
|
|
7574
7599
|
data.children = children;
|
|
7575
7600
|
}
|
|
7576
|
-
else
|
|
7601
|
+
else
|
|
7577
7602
|
super.set(data, isTemp);
|
|
7578
|
-
}
|
|
7579
7603
|
}
|
|
7580
7604
|
toJSON(options) {
|
|
7581
7605
|
const data = super.toJSON(options);
|
|
@@ -8007,9 +8031,7 @@ let Box = class Box extends Group {
|
|
|
8007
8031
|
}
|
|
8008
8032
|
__updateStrokeSpread() { return 0; }
|
|
8009
8033
|
__updateRectRenderSpread() { return 0; }
|
|
8010
|
-
__updateRenderSpread() {
|
|
8011
|
-
return this.__updateRectRenderSpread() || -1;
|
|
8012
|
-
}
|
|
8034
|
+
__updateRenderSpread() { return this.__updateRectRenderSpread() || -1; }
|
|
8013
8035
|
__updateRectBoxBounds() { }
|
|
8014
8036
|
__updateBoxBounds(_secondLayout) {
|
|
8015
8037
|
const data = this.__;
|
|
@@ -8029,13 +8051,11 @@ let Box = class Box extends Group {
|
|
|
8029
8051
|
}
|
|
8030
8052
|
this.__updateNaturalSize();
|
|
8031
8053
|
}
|
|
8032
|
-
else
|
|
8054
|
+
else
|
|
8033
8055
|
this.__updateRectBoxBounds();
|
|
8034
|
-
}
|
|
8035
8056
|
}
|
|
8036
|
-
else
|
|
8057
|
+
else
|
|
8037
8058
|
this.__updateRectBoxBounds();
|
|
8038
|
-
}
|
|
8039
8059
|
}
|
|
8040
8060
|
__updateStrokeBounds() { }
|
|
8041
8061
|
__updateRenderBounds() {
|
|
@@ -8045,14 +8065,13 @@ let Box = class Box extends Group {
|
|
|
8045
8065
|
super.__updateRenderBounds();
|
|
8046
8066
|
copy$2(childrenRenderBounds, renderBounds);
|
|
8047
8067
|
this.__updateRectRenderBounds();
|
|
8048
|
-
isOverflow = !includes$1(renderBounds, childrenRenderBounds)
|
|
8068
|
+
isOverflow = !includes$1(renderBounds, childrenRenderBounds);
|
|
8069
|
+
if (isOverflow && this.__.overflow !== 'hide')
|
|
8070
|
+
add(renderBounds, childrenRenderBounds);
|
|
8049
8071
|
}
|
|
8050
|
-
else
|
|
8072
|
+
else
|
|
8051
8073
|
this.__updateRectRenderBounds();
|
|
8052
|
-
|
|
8053
|
-
this.isOverflow !== isOverflow && (this.isOverflow = isOverflow);
|
|
8054
|
-
if (!(this.__.__drawAfterFill = this.__.overflow === 'hide') && isOverflow)
|
|
8055
|
-
add(renderBounds, childrenRenderBounds);
|
|
8074
|
+
!this.isOverflow !== !isOverflow && (this.isOverflow = isOverflow);
|
|
8056
8075
|
}
|
|
8057
8076
|
__updateRectRenderBounds() { }
|
|
8058
8077
|
__updateRectChange() { }
|
|
@@ -8072,20 +8091,9 @@ let Box = class Box extends Group {
|
|
|
8072
8091
|
this.__renderGroup(canvas, options);
|
|
8073
8092
|
}
|
|
8074
8093
|
}
|
|
8075
|
-
|
|
8076
|
-
|
|
8077
|
-
if (this.
|
|
8078
|
-
canvas.save();
|
|
8079
|
-
canvas.clip();
|
|
8080
|
-
if (length)
|
|
8081
|
-
this.__renderGroup(canvas, options);
|
|
8082
|
-
canvas.restore();
|
|
8083
|
-
}
|
|
8084
|
-
else {
|
|
8085
|
-
if (length)
|
|
8086
|
-
this.__renderGroup(canvas, options);
|
|
8087
|
-
}
|
|
8088
|
-
if (this.__.stroke && length) {
|
|
8094
|
+
__drawContent(canvas, options) {
|
|
8095
|
+
this.__renderGroup(canvas, options);
|
|
8096
|
+
if (this.__.__hasStroke) {
|
|
8089
8097
|
canvas.setWorld(this.__nowWorld);
|
|
8090
8098
|
this.__drawRenderPath(canvas);
|
|
8091
8099
|
}
|
|
@@ -8249,17 +8257,15 @@ let Line = class Line extends UI {
|
|
|
8249
8257
|
if (data.__useArrow)
|
|
8250
8258
|
PathArrow.addArrows(this, false);
|
|
8251
8259
|
}
|
|
8252
|
-
else
|
|
8260
|
+
else
|
|
8253
8261
|
super.__updateRenderPath();
|
|
8254
|
-
}
|
|
8255
8262
|
}
|
|
8256
8263
|
__updateBoxBounds() {
|
|
8257
8264
|
if (this.points) {
|
|
8258
8265
|
toBounds$1(this.__.__pathForRender, this.__layout.boxBounds);
|
|
8259
8266
|
}
|
|
8260
|
-
else
|
|
8267
|
+
else
|
|
8261
8268
|
super.__updateBoxBounds();
|
|
8262
|
-
}
|
|
8263
8269
|
}
|
|
8264
8270
|
};
|
|
8265
8271
|
__decorate([
|
|
@@ -8397,7 +8403,6 @@ let Canvas = class Canvas extends Rect {
|
|
|
8397
8403
|
super(data);
|
|
8398
8404
|
this.canvas = Creator.canvas(this.__);
|
|
8399
8405
|
this.context = this.canvas.context;
|
|
8400
|
-
this.__.__isCanvas = this.__.__drawAfterFill = true;
|
|
8401
8406
|
if (data && data.url)
|
|
8402
8407
|
this.drawImage(data.url);
|
|
8403
8408
|
}
|
|
@@ -8410,8 +8415,7 @@ let Canvas = class Canvas extends Rect {
|
|
|
8410
8415
|
});
|
|
8411
8416
|
}
|
|
8412
8417
|
draw(ui, offset, scale, rotation) {
|
|
8413
|
-
ui.
|
|
8414
|
-
const matrix = new Matrix(ui.__world).invert();
|
|
8418
|
+
const matrix = new Matrix(ui.worldTransform).invert();
|
|
8415
8419
|
const m = new Matrix();
|
|
8416
8420
|
if (offset)
|
|
8417
8421
|
m.translate(offset.x, offset.y);
|
|
@@ -8426,17 +8430,9 @@ let Canvas = class Canvas extends Rect {
|
|
|
8426
8430
|
paint() {
|
|
8427
8431
|
this.forceRender();
|
|
8428
8432
|
}
|
|
8429
|
-
|
|
8430
|
-
const { width, height
|
|
8431
|
-
|
|
8432
|
-
canvas.save();
|
|
8433
|
-
canvas.clip();
|
|
8434
|
-
canvas.drawImage(view, 0, 0, view.width, view.height, 0, 0, width, height);
|
|
8435
|
-
canvas.restore();
|
|
8436
|
-
}
|
|
8437
|
-
else {
|
|
8438
|
-
canvas.drawImage(view, 0, 0, view.width, view.height, 0, 0, width, height);
|
|
8439
|
-
}
|
|
8433
|
+
__drawContent(canvas, _options) {
|
|
8434
|
+
const { width, height } = this.__, { view } = this.canvas;
|
|
8435
|
+
canvas.drawImage(view, 0, 0, view.width, view.height, 0, 0, width, height);
|
|
8440
8436
|
}
|
|
8441
8437
|
__updateSize() {
|
|
8442
8438
|
const { canvas } = this;
|
|
@@ -8480,7 +8476,6 @@ Canvas = __decorate([
|
|
|
8480
8476
|
const { copyAndSpread, includes, isSame: isSame$1, spread, setList } = BoundsHelper;
|
|
8481
8477
|
let Text = class Text extends UI {
|
|
8482
8478
|
get __tag() { return 'Text'; }
|
|
8483
|
-
get editInner() { return 'TextEditor'; }
|
|
8484
8479
|
get textDrawData() {
|
|
8485
8480
|
this.__layout.update();
|
|
8486
8481
|
return this.__.__textDrawData;
|
|
@@ -8555,9 +8550,8 @@ let Text = class Text extends UI {
|
|
|
8555
8550
|
layout.renderChanged = true;
|
|
8556
8551
|
setList(data.__textBoxBounds = {}, [b, bounds]);
|
|
8557
8552
|
}
|
|
8558
|
-
else
|
|
8553
|
+
else
|
|
8559
8554
|
data.__textBoxBounds = contentBounds;
|
|
8560
|
-
}
|
|
8561
8555
|
}
|
|
8562
8556
|
__updateRenderSpread() {
|
|
8563
8557
|
let width = super.__updateRenderSpread();
|
|
@@ -8646,7 +8640,6 @@ let Path = class Path extends UI {
|
|
|
8646
8640
|
get __tag() { return 'Path'; }
|
|
8647
8641
|
constructor(data) {
|
|
8648
8642
|
super(data);
|
|
8649
|
-
this.__.__pathInputed = 2;
|
|
8650
8643
|
}
|
|
8651
8644
|
};
|
|
8652
8645
|
__decorate([
|
|
@@ -9324,7 +9317,7 @@ function checkImage(ui, canvas, paint, allowPaint) {
|
|
|
9324
9317
|
}
|
|
9325
9318
|
if (allowPaint) {
|
|
9326
9319
|
canvas.save();
|
|
9327
|
-
canvas.clip();
|
|
9320
|
+
ui.windingRule ? canvas.clip(ui.windingRule) : canvas.clip();
|
|
9328
9321
|
if (paint.blendMode)
|
|
9329
9322
|
canvas.blendMode = paint.blendMode;
|
|
9330
9323
|
if (data.opacity)
|