@leafer-ui/draw 1.9.4 → 1.9.5
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/lib/draw.cjs +26 -76
- package/lib/draw.esm.js +27 -77
- package/lib/draw.esm.min.js +1 -1
- package/lib/draw.esm.min.js.map +1 -1
- package/lib/draw.min.cjs +1 -1
- package/lib/draw.min.cjs.map +1 -1
- package/package.json +6 -6
package/lib/draw.cjs
CHANGED
|
@@ -304,7 +304,11 @@ class LeaferData extends GroupData {
|
|
|
304
304
|
|
|
305
305
|
class FrameData extends BoxData {}
|
|
306
306
|
|
|
307
|
-
class LineData extends UIData {
|
|
307
|
+
class LineData extends UIData {
|
|
308
|
+
get __usePathBox() {
|
|
309
|
+
return this.points || this.__pathInputed;
|
|
310
|
+
}
|
|
311
|
+
}
|
|
308
312
|
|
|
309
313
|
class RectData extends UIData {
|
|
310
314
|
get __boxStroke() {
|
|
@@ -318,7 +322,7 @@ class EllipseData extends UIData {
|
|
|
318
322
|
}
|
|
319
323
|
}
|
|
320
324
|
|
|
321
|
-
class PolygonData extends
|
|
325
|
+
class PolygonData extends LineData {}
|
|
322
326
|
|
|
323
327
|
class StarData extends UIData {}
|
|
324
328
|
|
|
@@ -628,20 +632,9 @@ exports.UI = UI_1 = class UI extends core.Leaf {
|
|
|
628
632
|
if (!path) this.__drawPathByBox(core.pen);
|
|
629
633
|
return core.pen;
|
|
630
634
|
}
|
|
631
|
-
constructor(data) {
|
|
632
|
-
super(data);
|
|
633
|
-
}
|
|
634
635
|
reset(_data) {}
|
|
635
|
-
set(data,
|
|
636
|
-
if (data)
|
|
637
|
-
if (transition) {
|
|
638
|
-
if (transition === "temp") {
|
|
639
|
-
this.lockNormalStyle = true;
|
|
640
|
-
Object.assign(this, data);
|
|
641
|
-
this.lockNormalStyle = false;
|
|
642
|
-
} else this.animate(data, transition);
|
|
643
|
-
} else Object.assign(this, data);
|
|
644
|
-
}
|
|
636
|
+
set(data, _transition) {
|
|
637
|
+
if (data) Object.assign(this, data);
|
|
645
638
|
}
|
|
646
639
|
get(name) {
|
|
647
640
|
return core.isString(name) ? this.__.__getInput(name) : this.__.__getInputData(name);
|
|
@@ -687,7 +680,7 @@ exports.UI = UI_1 = class UI extends core.Leaf {
|
|
|
687
680
|
const data = this.__;
|
|
688
681
|
if (data.path) {
|
|
689
682
|
data.__pathForRender = data.cornerRadius ? core.PathCorner.smooth(data.path, data.cornerRadius, data.cornerSmoothing) : data.path;
|
|
690
|
-
if (data.__useArrow) PathArrow.addArrows(this
|
|
683
|
+
if (data.__useArrow) PathArrow.addArrows(this);
|
|
691
684
|
} else data.__pathForRender && (data.__pathForRender = undefined);
|
|
692
685
|
}
|
|
693
686
|
__drawRenderPath(canvas) {
|
|
@@ -711,7 +704,8 @@ exports.UI = UI_1 = class UI extends core.Leaf {
|
|
|
711
704
|
drawImagePlaceholder(canvas, _image) {
|
|
712
705
|
Paint.fill(this.__.placeholderColor, this, canvas);
|
|
713
706
|
}
|
|
714
|
-
animate(
|
|
707
|
+
animate(keyframe, _options, _type, _isTemp) {
|
|
708
|
+
this.set(keyframe);
|
|
715
709
|
return core.Plugin.need("animate");
|
|
716
710
|
}
|
|
717
711
|
killAnimate(_type, _nextStyle) {}
|
|
@@ -900,9 +894,6 @@ exports.Group = class Group extends exports.UI {
|
|
|
900
894
|
get isBranch() {
|
|
901
895
|
return true;
|
|
902
896
|
}
|
|
903
|
-
constructor(data) {
|
|
904
|
-
super(data);
|
|
905
|
-
}
|
|
906
897
|
reset(data) {
|
|
907
898
|
this.__setBranch();
|
|
908
899
|
super.reset(data);
|
|
@@ -1027,7 +1018,7 @@ exports.Leafer = Leafer_1 = class Leafer extends exports.Group {
|
|
|
1027
1018
|
const canvas = this.canvas = core.Creator.canvas(config);
|
|
1028
1019
|
this.__controllers.push(this.renderer = core.Creator.renderer(this, canvas, config), this.watcher = core.Creator.watcher(this, config), this.layouter = core.Creator.layouter(this, config));
|
|
1029
1020
|
if (this.isApp) this.__setApp();
|
|
1030
|
-
this.__checkAutoLayout(
|
|
1021
|
+
this.__checkAutoLayout();
|
|
1031
1022
|
this.view = canvas.view;
|
|
1032
1023
|
if (!parentApp) {
|
|
1033
1024
|
this.selector = core.Creator.selector(this);
|
|
@@ -1126,7 +1117,8 @@ exports.Leafer = Leafer_1 = class Leafer extends exports.Group {
|
|
|
1126
1117
|
this.leafer = leafer;
|
|
1127
1118
|
this.__level = 1;
|
|
1128
1119
|
}
|
|
1129
|
-
__checkAutoLayout(
|
|
1120
|
+
__checkAutoLayout() {
|
|
1121
|
+
const {config: config, parentApp: parentApp} = this;
|
|
1130
1122
|
if (!parentApp) {
|
|
1131
1123
|
if (!config.width || !config.height) this.autoLayout = new core.AutoBounds(config);
|
|
1132
1124
|
this.canvas.startAutoLayout(this.autoLayout, this.__onResize.bind(this));
|
|
@@ -1152,9 +1144,10 @@ exports.Leafer = Leafer_1 = class Leafer extends exports.Group {
|
|
|
1152
1144
|
return super.__getAttr(attrName);
|
|
1153
1145
|
}
|
|
1154
1146
|
__changeCanvasSize(attrName, newValue) {
|
|
1155
|
-
const
|
|
1156
|
-
data
|
|
1157
|
-
|
|
1147
|
+
const {config: config, canvas: canvas} = this;
|
|
1148
|
+
const data = core.DataHelper.copyAttrs({}, canvas, core.canvasSizeAttrs);
|
|
1149
|
+
data[attrName] = config[attrName] = newValue;
|
|
1150
|
+
config.width && config.height ? canvas.stopAutoLayout() : this.__checkAutoLayout();
|
|
1158
1151
|
this.__doResize(data);
|
|
1159
1152
|
}
|
|
1160
1153
|
__changeFill(newValue) {
|
|
@@ -1301,9 +1294,9 @@ exports.Leafer = Leafer_1 = class Leafer extends exports.Group {
|
|
|
1301
1294
|
if (!this.parent) {
|
|
1302
1295
|
if (this.selector) this.selector.destroy();
|
|
1303
1296
|
if (this.hitCanvasManager) this.hitCanvasManager.destroy();
|
|
1304
|
-
this.canvasManager.destroy();
|
|
1297
|
+
if (this.canvasManager) this.canvasManager.destroy();
|
|
1305
1298
|
}
|
|
1306
|
-
this.canvas.destroy();
|
|
1299
|
+
if (this.canvas) this.canvas.destroy();
|
|
1307
1300
|
this.config.view = this.view = this.parentApp = null;
|
|
1308
1301
|
if (this.userConfig) this.userConfig.view = null;
|
|
1309
1302
|
super.destroy();
|
|
@@ -1331,9 +1324,6 @@ exports.Rect = class Rect extends exports.UI {
|
|
|
1331
1324
|
get __tag() {
|
|
1332
1325
|
return "Rect";
|
|
1333
1326
|
}
|
|
1334
|
-
constructor(data) {
|
|
1335
|
-
super(data);
|
|
1336
|
-
}
|
|
1337
1327
|
};
|
|
1338
1328
|
|
|
1339
1329
|
__decorate([ core.dataProcessor(RectData) ], exports.Rect.prototype, "__", void 0);
|
|
@@ -1465,9 +1455,6 @@ exports.Frame = class Frame extends exports.Box {
|
|
|
1465
1455
|
get isFrame() {
|
|
1466
1456
|
return true;
|
|
1467
1457
|
}
|
|
1468
|
-
constructor(data) {
|
|
1469
|
-
super(data);
|
|
1470
|
-
}
|
|
1471
1458
|
};
|
|
1472
1459
|
|
|
1473
1460
|
__decorate([ core.dataProcessor(FrameData) ], exports.Frame.prototype, "__", void 0);
|
|
@@ -1484,9 +1471,6 @@ exports.Ellipse = class Ellipse extends exports.UI {
|
|
|
1484
1471
|
get __tag() {
|
|
1485
1472
|
return "Ellipse";
|
|
1486
1473
|
}
|
|
1487
|
-
constructor(data) {
|
|
1488
|
-
super(data);
|
|
1489
|
-
}
|
|
1490
1474
|
__updatePath() {
|
|
1491
1475
|
const {width: width, height: height, innerRadius: innerRadius, startAngle: startAngle, endAngle: endAngle} = this.__;
|
|
1492
1476
|
const rx = width / 2, ry = height / 2;
|
|
@@ -1530,8 +1514,6 @@ const {moveTo: moveTo$2, lineTo: lineTo$2, drawPoints: drawPoints$1} = core.Path
|
|
|
1530
1514
|
|
|
1531
1515
|
const {rotate: rotate, getAngle: getAngle, getDistance: getDistance, defaultPoint: defaultPoint} = core.PointHelper;
|
|
1532
1516
|
|
|
1533
|
-
const {toBounds: toBounds} = core.PathBounds;
|
|
1534
|
-
|
|
1535
1517
|
exports.Line = class Line extends exports.UI {
|
|
1536
1518
|
get __tag() {
|
|
1537
1519
|
return "Line";
|
|
@@ -1548,31 +1530,16 @@ exports.Line = class Line extends exports.UI {
|
|
|
1548
1530
|
this.rotation = getAngle(defaultPoint, value);
|
|
1549
1531
|
if (this.height) this.height = 0;
|
|
1550
1532
|
}
|
|
1551
|
-
constructor(data) {
|
|
1552
|
-
super(data);
|
|
1553
|
-
}
|
|
1554
1533
|
__updatePath() {
|
|
1555
1534
|
const data = this.__;
|
|
1556
1535
|
const path = data.path = [];
|
|
1557
1536
|
if (data.points) {
|
|
1558
|
-
drawPoints$1(path, data.points,
|
|
1537
|
+
drawPoints$1(path, data.points, data.curve, data.closed);
|
|
1559
1538
|
} else {
|
|
1560
1539
|
moveTo$2(path, 0, 0);
|
|
1561
1540
|
lineTo$2(path, this.width, 0);
|
|
1562
1541
|
}
|
|
1563
1542
|
}
|
|
1564
|
-
__updateRenderPath() {
|
|
1565
|
-
const data = this.__;
|
|
1566
|
-
if (!this.pathInputed && data.points && data.curve) {
|
|
1567
|
-
drawPoints$1(data.__pathForRender = [], data.points, data.curve, data.closed);
|
|
1568
|
-
if (data.__useArrow) PathArrow.addArrows(this, false);
|
|
1569
|
-
} else super.__updateRenderPath();
|
|
1570
|
-
}
|
|
1571
|
-
__updateBoxBounds() {
|
|
1572
|
-
if (this.points) {
|
|
1573
|
-
toBounds(this.__.__pathForRender, this.__layout.boxBounds);
|
|
1574
|
-
} else super.__updateBoxBounds();
|
|
1575
|
-
}
|
|
1576
1543
|
};
|
|
1577
1544
|
|
|
1578
1545
|
__decorate([ core.dataProcessor(LineData) ], exports.Line.prototype, "__", void 0);
|
|
@@ -1599,15 +1566,13 @@ exports.Polygon = class Polygon extends exports.UI {
|
|
|
1599
1566
|
get __tag() {
|
|
1600
1567
|
return "Polygon";
|
|
1601
1568
|
}
|
|
1602
|
-
constructor(data) {
|
|
1603
|
-
super(data);
|
|
1604
|
-
}
|
|
1605
1569
|
__updatePath() {
|
|
1606
|
-
const
|
|
1607
|
-
|
|
1608
|
-
|
|
1570
|
+
const data = this.__;
|
|
1571
|
+
const path = data.path = [];
|
|
1572
|
+
if (data.points) {
|
|
1573
|
+
drawPoints(path, data.points, data.curve, true);
|
|
1609
1574
|
} else {
|
|
1610
|
-
const {width: width, height: height, sides: sides} =
|
|
1575
|
+
const {width: width, height: height, sides: sides} = data;
|
|
1611
1576
|
const rx = width / 2, ry = height / 2;
|
|
1612
1577
|
moveTo$1(path, rx, 0);
|
|
1613
1578
|
for (let i = 1; i < sides; i++) {
|
|
@@ -1642,9 +1607,6 @@ exports.Star = class Star extends exports.UI {
|
|
|
1642
1607
|
get __tag() {
|
|
1643
1608
|
return "Star";
|
|
1644
1609
|
}
|
|
1645
|
-
constructor(data) {
|
|
1646
|
-
super(data);
|
|
1647
|
-
}
|
|
1648
1610
|
__updatePath() {
|
|
1649
1611
|
const {width: width, height: height, corners: corners, innerRadius: innerRadius} = this.__;
|
|
1650
1612
|
const rx = width / 2, ry = height / 2;
|
|
@@ -1677,9 +1639,6 @@ exports.Image = class Image extends exports.Rect {
|
|
|
1677
1639
|
const {fill: fill} = this.__;
|
|
1678
1640
|
return core.isArray(fill) && fill[0].image;
|
|
1679
1641
|
}
|
|
1680
|
-
constructor(data) {
|
|
1681
|
-
super(data);
|
|
1682
|
-
}
|
|
1683
1642
|
};
|
|
1684
1643
|
|
|
1685
1644
|
__decorate([ core.dataProcessor(ImageData) ], exports.Image.prototype, "__", void 0);
|
|
@@ -1779,9 +1738,6 @@ exports.Text = class Text extends exports.UI {
|
|
|
1779
1738
|
this.updateLayout();
|
|
1780
1739
|
return this.__.__textDrawData;
|
|
1781
1740
|
}
|
|
1782
|
-
constructor(data) {
|
|
1783
|
-
super(data);
|
|
1784
|
-
}
|
|
1785
1741
|
__updateTextDrawData() {
|
|
1786
1742
|
const data = this.__;
|
|
1787
1743
|
const {lineHeight: lineHeight, letterSpacing: letterSpacing, fontFamily: fontFamily, fontSize: fontSize, fontWeight: fontWeight, italic: italic, textCase: textCase, textOverflow: textOverflow, padding: padding} = data;
|
|
@@ -1914,9 +1870,6 @@ exports.Path = class Path extends exports.UI {
|
|
|
1914
1870
|
get __tag() {
|
|
1915
1871
|
return "Path";
|
|
1916
1872
|
}
|
|
1917
|
-
constructor(data) {
|
|
1918
|
-
super(data);
|
|
1919
|
-
}
|
|
1920
1873
|
};
|
|
1921
1874
|
|
|
1922
1875
|
__decorate([ core.dataProcessor(PathData) ], exports.Path.prototype, "__", void 0);
|
|
@@ -1929,9 +1882,6 @@ exports.Pen = class Pen extends exports.Group {
|
|
|
1929
1882
|
get __tag() {
|
|
1930
1883
|
return "Pen";
|
|
1931
1884
|
}
|
|
1932
|
-
constructor(data) {
|
|
1933
|
-
super(data);
|
|
1934
|
-
}
|
|
1935
1885
|
setStyle(data) {
|
|
1936
1886
|
const path = this.pathElement = new exports.Path(data);
|
|
1937
1887
|
this.pathStyle = data;
|
package/lib/draw.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineKey, decorateLeafAttr, attr, createDescriptor, Plugin, isObject, PathConvert, DataHelper, Debug, LeafData, isString, isUndefined, isArray, canvasSizeAttrs, UICreator, MathHelper, dataProcessor, dataType, surfaceType, opacityType, visibleType, sortType, maskType, eraserType, positionType, boundsType, scaleType, rotationType, scrollType, autoLayoutType, naturalBoundsType, affectRenderBoundsType, pathInputType, pathType, hitType, strokeType, cursorType, rewrite, Leaf, useModule, rewriteAble, pen, PathCorner, PathDrawer, isNumber, registerUI, Branch, LeafList, Resource, getBoundsData, Creator, CanvasManager, WaitHelper, LeaferEvent, Bounds, ResizeEvent, AutoBounds, Run, LayoutEvent, RenderEvent, WatchEvent, ImageManager, BoundsHelper, PathCommandDataHelper, Platform, PointHelper,
|
|
1
|
+
import { defineKey, decorateLeafAttr, attr, createDescriptor, Plugin, isObject, PathConvert, DataHelper, Debug, LeafData, isString, isUndefined, isArray, canvasSizeAttrs, UICreator, MathHelper, dataProcessor, dataType, surfaceType, opacityType, visibleType, sortType, maskType, eraserType, positionType, boundsType, scaleType, rotationType, scrollType, autoLayoutType, naturalBoundsType, affectRenderBoundsType, pathInputType, pathType, hitType, strokeType, cursorType, rewrite, Leaf, useModule, rewriteAble, pen, PathCorner, PathDrawer, isNumber, registerUI, Branch, LeafList, Resource, getBoundsData, Creator, CanvasManager, WaitHelper, LeaferEvent, Bounds, ResizeEvent, AutoBounds, Run, LayoutEvent, RenderEvent, WatchEvent, ImageManager, BoundsHelper, PathCommandDataHelper, Platform, PointHelper, affectStrokeBoundsType, getPointData, LeaferImage, ImageEvent, Matrix, PathCreator } from "@leafer/core";
|
|
2
2
|
|
|
3
3
|
export * from "@leafer/core";
|
|
4
4
|
|
|
@@ -304,7 +304,11 @@ class LeaferData extends GroupData {
|
|
|
304
304
|
|
|
305
305
|
class FrameData extends BoxData {}
|
|
306
306
|
|
|
307
|
-
class LineData extends UIData {
|
|
307
|
+
class LineData extends UIData {
|
|
308
|
+
get __usePathBox() {
|
|
309
|
+
return this.points || this.__pathInputed;
|
|
310
|
+
}
|
|
311
|
+
}
|
|
308
312
|
|
|
309
313
|
class RectData extends UIData {
|
|
310
314
|
get __boxStroke() {
|
|
@@ -318,7 +322,7 @@ class EllipseData extends UIData {
|
|
|
318
322
|
}
|
|
319
323
|
}
|
|
320
324
|
|
|
321
|
-
class PolygonData extends
|
|
325
|
+
class PolygonData extends LineData {}
|
|
322
326
|
|
|
323
327
|
class StarData extends UIData {}
|
|
324
328
|
|
|
@@ -628,20 +632,9 @@ let UI = UI_1 = class UI extends Leaf {
|
|
|
628
632
|
if (!path) this.__drawPathByBox(pen);
|
|
629
633
|
return pen;
|
|
630
634
|
}
|
|
631
|
-
constructor(data) {
|
|
632
|
-
super(data);
|
|
633
|
-
}
|
|
634
635
|
reset(_data) {}
|
|
635
|
-
set(data,
|
|
636
|
-
if (data)
|
|
637
|
-
if (transition) {
|
|
638
|
-
if (transition === "temp") {
|
|
639
|
-
this.lockNormalStyle = true;
|
|
640
|
-
Object.assign(this, data);
|
|
641
|
-
this.lockNormalStyle = false;
|
|
642
|
-
} else this.animate(data, transition);
|
|
643
|
-
} else Object.assign(this, data);
|
|
644
|
-
}
|
|
636
|
+
set(data, _transition) {
|
|
637
|
+
if (data) Object.assign(this, data);
|
|
645
638
|
}
|
|
646
639
|
get(name) {
|
|
647
640
|
return isString(name) ? this.__.__getInput(name) : this.__.__getInputData(name);
|
|
@@ -687,7 +680,7 @@ let UI = UI_1 = class UI extends Leaf {
|
|
|
687
680
|
const data = this.__;
|
|
688
681
|
if (data.path) {
|
|
689
682
|
data.__pathForRender = data.cornerRadius ? PathCorner.smooth(data.path, data.cornerRadius, data.cornerSmoothing) : data.path;
|
|
690
|
-
if (data.__useArrow) PathArrow.addArrows(this
|
|
683
|
+
if (data.__useArrow) PathArrow.addArrows(this);
|
|
691
684
|
} else data.__pathForRender && (data.__pathForRender = undefined);
|
|
692
685
|
}
|
|
693
686
|
__drawRenderPath(canvas) {
|
|
@@ -711,7 +704,8 @@ let UI = UI_1 = class UI extends Leaf {
|
|
|
711
704
|
drawImagePlaceholder(canvas, _image) {
|
|
712
705
|
Paint.fill(this.__.placeholderColor, this, canvas);
|
|
713
706
|
}
|
|
714
|
-
animate(
|
|
707
|
+
animate(keyframe, _options, _type, _isTemp) {
|
|
708
|
+
this.set(keyframe);
|
|
715
709
|
return Plugin.need("animate");
|
|
716
710
|
}
|
|
717
711
|
killAnimate(_type, _nextStyle) {}
|
|
@@ -900,9 +894,6 @@ let Group = class Group extends UI {
|
|
|
900
894
|
get isBranch() {
|
|
901
895
|
return true;
|
|
902
896
|
}
|
|
903
|
-
constructor(data) {
|
|
904
|
-
super(data);
|
|
905
|
-
}
|
|
906
897
|
reset(data) {
|
|
907
898
|
this.__setBranch();
|
|
908
899
|
super.reset(data);
|
|
@@ -1027,7 +1018,7 @@ let Leafer = Leafer_1 = class Leafer extends Group {
|
|
|
1027
1018
|
const canvas = this.canvas = Creator.canvas(config);
|
|
1028
1019
|
this.__controllers.push(this.renderer = Creator.renderer(this, canvas, config), this.watcher = Creator.watcher(this, config), this.layouter = Creator.layouter(this, config));
|
|
1029
1020
|
if (this.isApp) this.__setApp();
|
|
1030
|
-
this.__checkAutoLayout(
|
|
1021
|
+
this.__checkAutoLayout();
|
|
1031
1022
|
this.view = canvas.view;
|
|
1032
1023
|
if (!parentApp) {
|
|
1033
1024
|
this.selector = Creator.selector(this);
|
|
@@ -1126,7 +1117,8 @@ let Leafer = Leafer_1 = class Leafer extends Group {
|
|
|
1126
1117
|
this.leafer = leafer;
|
|
1127
1118
|
this.__level = 1;
|
|
1128
1119
|
}
|
|
1129
|
-
__checkAutoLayout(
|
|
1120
|
+
__checkAutoLayout() {
|
|
1121
|
+
const {config: config, parentApp: parentApp} = this;
|
|
1130
1122
|
if (!parentApp) {
|
|
1131
1123
|
if (!config.width || !config.height) this.autoLayout = new AutoBounds(config);
|
|
1132
1124
|
this.canvas.startAutoLayout(this.autoLayout, this.__onResize.bind(this));
|
|
@@ -1152,9 +1144,10 @@ let Leafer = Leafer_1 = class Leafer extends Group {
|
|
|
1152
1144
|
return super.__getAttr(attrName);
|
|
1153
1145
|
}
|
|
1154
1146
|
__changeCanvasSize(attrName, newValue) {
|
|
1155
|
-
const
|
|
1156
|
-
data
|
|
1157
|
-
|
|
1147
|
+
const {config: config, canvas: canvas} = this;
|
|
1148
|
+
const data = DataHelper.copyAttrs({}, canvas, canvasSizeAttrs);
|
|
1149
|
+
data[attrName] = config[attrName] = newValue;
|
|
1150
|
+
config.width && config.height ? canvas.stopAutoLayout() : this.__checkAutoLayout();
|
|
1158
1151
|
this.__doResize(data);
|
|
1159
1152
|
}
|
|
1160
1153
|
__changeFill(newValue) {
|
|
@@ -1301,9 +1294,9 @@ let Leafer = Leafer_1 = class Leafer extends Group {
|
|
|
1301
1294
|
if (!this.parent) {
|
|
1302
1295
|
if (this.selector) this.selector.destroy();
|
|
1303
1296
|
if (this.hitCanvasManager) this.hitCanvasManager.destroy();
|
|
1304
|
-
this.canvasManager.destroy();
|
|
1297
|
+
if (this.canvasManager) this.canvasManager.destroy();
|
|
1305
1298
|
}
|
|
1306
|
-
this.canvas.destroy();
|
|
1299
|
+
if (this.canvas) this.canvas.destroy();
|
|
1307
1300
|
this.config.view = this.view = this.parentApp = null;
|
|
1308
1301
|
if (this.userConfig) this.userConfig.view = null;
|
|
1309
1302
|
super.destroy();
|
|
@@ -1331,9 +1324,6 @@ let Rect = class Rect extends UI {
|
|
|
1331
1324
|
get __tag() {
|
|
1332
1325
|
return "Rect";
|
|
1333
1326
|
}
|
|
1334
|
-
constructor(data) {
|
|
1335
|
-
super(data);
|
|
1336
|
-
}
|
|
1337
1327
|
};
|
|
1338
1328
|
|
|
1339
1329
|
__decorate([ dataProcessor(RectData) ], Rect.prototype, "__", void 0);
|
|
@@ -1465,9 +1455,6 @@ let Frame = class Frame extends Box {
|
|
|
1465
1455
|
get isFrame() {
|
|
1466
1456
|
return true;
|
|
1467
1457
|
}
|
|
1468
|
-
constructor(data) {
|
|
1469
|
-
super(data);
|
|
1470
|
-
}
|
|
1471
1458
|
};
|
|
1472
1459
|
|
|
1473
1460
|
__decorate([ dataProcessor(FrameData) ], Frame.prototype, "__", void 0);
|
|
@@ -1484,9 +1471,6 @@ let Ellipse = class Ellipse extends UI {
|
|
|
1484
1471
|
get __tag() {
|
|
1485
1472
|
return "Ellipse";
|
|
1486
1473
|
}
|
|
1487
|
-
constructor(data) {
|
|
1488
|
-
super(data);
|
|
1489
|
-
}
|
|
1490
1474
|
__updatePath() {
|
|
1491
1475
|
const {width: width, height: height, innerRadius: innerRadius, startAngle: startAngle, endAngle: endAngle} = this.__;
|
|
1492
1476
|
const rx = width / 2, ry = height / 2;
|
|
@@ -1530,8 +1514,6 @@ const {moveTo: moveTo$2, lineTo: lineTo$2, drawPoints: drawPoints$1} = PathComma
|
|
|
1530
1514
|
|
|
1531
1515
|
const {rotate: rotate, getAngle: getAngle, getDistance: getDistance, defaultPoint: defaultPoint} = PointHelper;
|
|
1532
1516
|
|
|
1533
|
-
const {toBounds: toBounds} = PathBounds;
|
|
1534
|
-
|
|
1535
1517
|
let Line = class Line extends UI {
|
|
1536
1518
|
get __tag() {
|
|
1537
1519
|
return "Line";
|
|
@@ -1548,31 +1530,16 @@ let Line = class Line extends UI {
|
|
|
1548
1530
|
this.rotation = getAngle(defaultPoint, value);
|
|
1549
1531
|
if (this.height) this.height = 0;
|
|
1550
1532
|
}
|
|
1551
|
-
constructor(data) {
|
|
1552
|
-
super(data);
|
|
1553
|
-
}
|
|
1554
1533
|
__updatePath() {
|
|
1555
1534
|
const data = this.__;
|
|
1556
1535
|
const path = data.path = [];
|
|
1557
1536
|
if (data.points) {
|
|
1558
|
-
drawPoints$1(path, data.points,
|
|
1537
|
+
drawPoints$1(path, data.points, data.curve, data.closed);
|
|
1559
1538
|
} else {
|
|
1560
1539
|
moveTo$2(path, 0, 0);
|
|
1561
1540
|
lineTo$2(path, this.width, 0);
|
|
1562
1541
|
}
|
|
1563
1542
|
}
|
|
1564
|
-
__updateRenderPath() {
|
|
1565
|
-
const data = this.__;
|
|
1566
|
-
if (!this.pathInputed && data.points && data.curve) {
|
|
1567
|
-
drawPoints$1(data.__pathForRender = [], data.points, data.curve, data.closed);
|
|
1568
|
-
if (data.__useArrow) PathArrow.addArrows(this, false);
|
|
1569
|
-
} else super.__updateRenderPath();
|
|
1570
|
-
}
|
|
1571
|
-
__updateBoxBounds() {
|
|
1572
|
-
if (this.points) {
|
|
1573
|
-
toBounds(this.__.__pathForRender, this.__layout.boxBounds);
|
|
1574
|
-
} else super.__updateBoxBounds();
|
|
1575
|
-
}
|
|
1576
1543
|
};
|
|
1577
1544
|
|
|
1578
1545
|
__decorate([ dataProcessor(LineData) ], Line.prototype, "__", void 0);
|
|
@@ -1599,15 +1566,13 @@ let Polygon = class Polygon extends UI {
|
|
|
1599
1566
|
get __tag() {
|
|
1600
1567
|
return "Polygon";
|
|
1601
1568
|
}
|
|
1602
|
-
constructor(data) {
|
|
1603
|
-
super(data);
|
|
1604
|
-
}
|
|
1605
1569
|
__updatePath() {
|
|
1606
|
-
const
|
|
1607
|
-
|
|
1608
|
-
|
|
1570
|
+
const data = this.__;
|
|
1571
|
+
const path = data.path = [];
|
|
1572
|
+
if (data.points) {
|
|
1573
|
+
drawPoints(path, data.points, data.curve, true);
|
|
1609
1574
|
} else {
|
|
1610
|
-
const {width: width, height: height, sides: sides} =
|
|
1575
|
+
const {width: width, height: height, sides: sides} = data;
|
|
1611
1576
|
const rx = width / 2, ry = height / 2;
|
|
1612
1577
|
moveTo$1(path, rx, 0);
|
|
1613
1578
|
for (let i = 1; i < sides; i++) {
|
|
@@ -1642,9 +1607,6 @@ let Star = class Star extends UI {
|
|
|
1642
1607
|
get __tag() {
|
|
1643
1608
|
return "Star";
|
|
1644
1609
|
}
|
|
1645
|
-
constructor(data) {
|
|
1646
|
-
super(data);
|
|
1647
|
-
}
|
|
1648
1610
|
__updatePath() {
|
|
1649
1611
|
const {width: width, height: height, corners: corners, innerRadius: innerRadius} = this.__;
|
|
1650
1612
|
const rx = width / 2, ry = height / 2;
|
|
@@ -1677,9 +1639,6 @@ let Image = class Image extends Rect {
|
|
|
1677
1639
|
const {fill: fill} = this.__;
|
|
1678
1640
|
return isArray(fill) && fill[0].image;
|
|
1679
1641
|
}
|
|
1680
|
-
constructor(data) {
|
|
1681
|
-
super(data);
|
|
1682
|
-
}
|
|
1683
1642
|
};
|
|
1684
1643
|
|
|
1685
1644
|
__decorate([ dataProcessor(ImageData) ], Image.prototype, "__", void 0);
|
|
@@ -1779,9 +1738,6 @@ let Text = class Text extends UI {
|
|
|
1779
1738
|
this.updateLayout();
|
|
1780
1739
|
return this.__.__textDrawData;
|
|
1781
1740
|
}
|
|
1782
|
-
constructor(data) {
|
|
1783
|
-
super(data);
|
|
1784
|
-
}
|
|
1785
1741
|
__updateTextDrawData() {
|
|
1786
1742
|
const data = this.__;
|
|
1787
1743
|
const {lineHeight: lineHeight, letterSpacing: letterSpacing, fontFamily: fontFamily, fontSize: fontSize, fontWeight: fontWeight, italic: italic, textCase: textCase, textOverflow: textOverflow, padding: padding} = data;
|
|
@@ -1914,9 +1870,6 @@ let Path = class Path extends UI {
|
|
|
1914
1870
|
get __tag() {
|
|
1915
1871
|
return "Path";
|
|
1916
1872
|
}
|
|
1917
|
-
constructor(data) {
|
|
1918
|
-
super(data);
|
|
1919
|
-
}
|
|
1920
1873
|
};
|
|
1921
1874
|
|
|
1922
1875
|
__decorate([ dataProcessor(PathData) ], Path.prototype, "__", void 0);
|
|
@@ -1929,9 +1882,6 @@ let Pen = class Pen extends Group {
|
|
|
1929
1882
|
get __tag() {
|
|
1930
1883
|
return "Pen";
|
|
1931
1884
|
}
|
|
1932
|
-
constructor(data) {
|
|
1933
|
-
super(data);
|
|
1934
|
-
}
|
|
1935
1885
|
setStyle(data) {
|
|
1936
1886
|
const path = this.pathElement = new Path(data);
|
|
1937
1887
|
this.pathStyle = data;
|