leafer-game 1.11.1 → 1.12.0
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 +9 -0
- package/dist/web.esm.js +11 -0
- package/dist/web.esm.min.js +1 -1
- package/dist/web.esm.min.js.map +1 -1
- package/dist/web.js +59 -22
- package/dist/web.min.cjs +1 -1
- package/dist/web.min.cjs.map +1 -1
- package/dist/web.min.js +1 -1
- package/dist/web.min.js.map +1 -1
- package/dist/web.module.js +62 -23
- package/dist/web.module.min.js +1 -1
- package/dist/web.module.min.js.map +1 -1
- package/package.json +12 -12
package/dist/web.cjs
CHANGED
|
@@ -12,6 +12,15 @@ var motionPath = require("@leafer-in/motion-path");
|
|
|
12
12
|
|
|
13
13
|
var find = require("@leafer-in/find");
|
|
14
14
|
|
|
15
|
+
exports.PathNodeHandleType = void 0;
|
|
16
|
+
|
|
17
|
+
(function(PathNodeHandleType) {
|
|
18
|
+
PathNodeHandleType[PathNodeHandleType["none"] = 1] = "none";
|
|
19
|
+
PathNodeHandleType[PathNodeHandleType["free"] = 2] = "free";
|
|
20
|
+
PathNodeHandleType[PathNodeHandleType["mirrorAngle"] = 3] = "mirrorAngle";
|
|
21
|
+
PathNodeHandleType[PathNodeHandleType["mirror"] = 4] = "mirror";
|
|
22
|
+
})(exports.PathNodeHandleType || (exports.PathNodeHandleType = {}));
|
|
23
|
+
|
|
15
24
|
Object.keys(leaferUi).forEach(function(k) {
|
|
16
25
|
if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
17
26
|
enumerable: true,
|
package/dist/web.esm.js
CHANGED
|
@@ -9,3 +9,14 @@ export * from "@leafer-in/animate";
|
|
|
9
9
|
export * from "@leafer-in/motion-path";
|
|
10
10
|
|
|
11
11
|
export * from "@leafer-in/find";
|
|
12
|
+
|
|
13
|
+
var PathNodeHandleType;
|
|
14
|
+
|
|
15
|
+
(function(PathNodeHandleType) {
|
|
16
|
+
PathNodeHandleType[PathNodeHandleType["none"] = 1] = "none";
|
|
17
|
+
PathNodeHandleType[PathNodeHandleType["free"] = 2] = "free";
|
|
18
|
+
PathNodeHandleType[PathNodeHandleType["mirrorAngle"] = 3] = "mirrorAngle";
|
|
19
|
+
PathNodeHandleType[PathNodeHandleType["mirror"] = 4] = "mirror";
|
|
20
|
+
})(PathNodeHandleType || (PathNodeHandleType = {}));
|
|
21
|
+
|
|
22
|
+
export { PathNodeHandleType };
|
package/dist/web.esm.min.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export*from"leafer-ui";export*from"@leafer-in/robot";export*from"@leafer-in/state";export*from"@leafer-in/animate";export*from"@leafer-in/motion-path";export*from"@leafer-in/find";
|
|
1
|
+
export*from"leafer-ui";export*from"@leafer-in/robot";export*from"@leafer-in/state";export*from"@leafer-in/animate";export*from"@leafer-in/motion-path";export*from"@leafer-in/find";var r;!function(r){r[r.none=1]="none",r[r.free=2]="free",r[r.mirrorAngle=3]="mirrorAngle",r[r.mirror=4]="mirror"}(r||(r={}));export{r as PathNodeHandleType};
|
|
2
2
|
//# sourceMappingURL=web.esm.min.js.map
|
package/dist/web.esm.min.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"web.esm.min.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"web.esm.min.js","sources":["../../../../src/leafer/packages/interface/src/path/IPathCommand.ts"],"sourcesContent":["import { IPointData } from '../math/IMath'\n\ntype Command = number\ntype x = number\ntype y = number\ntype x1 = number\ntype y1 = number\ntype x2 = number\ntype y2 = number\ntype radiusX = number\ntype radiusY = number\ntype xAxisRotation = number\ntype largeArcFlag = number\ntype sweepFlag = number\n\n\nexport type MCommandData = [Command, x, y]\nexport type HCommandData = [Command, x]\nexport type VCommandData = [Command, y]\nexport type LCommandData = MCommandData\n\nexport type CCommandData = [Command, x1, y1, x2, y2, x, y]\nexport type SCommandData = [Command, x2, y2, x, y]\n\nexport type QCommandData = [Command, x1, y1, x, y]\nexport type TCommandData = [Command, x, y]\n\nexport type ZCommandData = [Command]\n\nexport type ACommandData = [Command, radiusX, radiusY, xAxisRotation, largeArcFlag, sweepFlag, x, y]\n\n\n// 非svg标准的canvas绘图命令\ntype width = number\ntype height = number\ntype rotation = number\ntype startAngle = number\ntype endAngle = number\ntype anticlockwise = boolean\ntype cornerRadius = number | number[]\ntype radius = number\n\nexport type RectCommandData = [Command, x, y, width, height]\nexport type RoundRectCommandData = [Command, x, y, width, height, cornerRadius]\nexport type EllipseCommandData = [Command, x, y, radiusX, radiusY, rotation, startAngle, endAngle, anticlockwise]\nexport type ArcCommandData = [Command, x, y, radius, startAngle, endAngle, anticlockwise]\nexport type ArcToCommandData = [Command, x1, y1, x2, y2, radius]\n\n\nexport type CanvasPathCommand = 1 | 2 | 5 | 7 | 11 // M | L | C | Q | Z canvas可以绘制的命令\n\nexport type IPathCommandData = number[] // ...(MCommandData | LCommandData | CCommandData | QCommandData | ZCommandData)\n\n\n// 路径命令对象\nexport interface MoveToCommandObject {\n name: 'M'\n x: number\n y: number\n}\nexport interface LineToCommandObject {\n name: 'L'\n x: number\n y: number\n}\n\nexport interface BezierCurveToCommandObject {\n name: 'C'\n x1: number\n y1: number\n x2: number\n y2: number\n x: number\n y: number\n}\n\nexport interface QuadraticCurveToCommandObject {\n name: 'Q'\n x1: number\n y1: number\n x: number\n y: number\n}\n\nexport interface ClosePathCommandObject {\n name: 'Z'\n}\n\nexport type IPathCommandObject = MoveToCommandObject | LineToCommandObject | BezierCurveToCommandObject | QuadraticCurveToCommandObject | ClosePathCommandObject // M | L | C | Q | Z canvas可以绘制的命令\n\n\n// 可视化路径节点\n\nexport interface IPathCommandNodeBase {\n name: 'M^' | 'L^' | 'C^' | 'Z^'\n x: number\n y: number\n a?: IPointData // 第一个手柄,连接上一个节点\n b?: IPointData // 第二个手柄,连接下一个节点\n ab?: PathNodeHandleType // 手柄类型\n}\n\nexport interface MoveToCommandNode extends IPathCommandNodeBase {\n name: 'M^'\n}\nexport interface LineToCommandNode extends IPathCommandNodeBase {\n name: 'L^'\n}\n\nexport interface BezierCurveToCommandNode extends IPathCommandNodeBase {\n name: 'C^'\n}\n\nexport interface ClosePathCommandNode {\n name: 'Z^'\n x?: number\n y?: number\n a?: IPointData\n b?: IPointData\n ab?: PathNodeHandleType\n}\n\nexport type IPathCommandNode = MoveToCommandNode | LineToCommandNode | BezierCurveToCommandNode | ClosePathCommandNode // M | L | C | Z 路径节点命令(适合可视化编辑)\n\nexport enum PathNodeHandleType { // 手柄类型\n none = 1, // 无手柄\n free = 2, // 每个手柄自由控制\n mirrorAngle = 3, // 仅镜像角度\n mirror = 4, // 镜像角度和长度\n}\n\nexport type PathNodeHandleName = 'a' | 'b' // 手柄名称\n\nexport interface IPathNodeBase {\n pathNode: IPathCommandNode\n}"],"names":["PathNodeHandleType"],"mappings":"wLA4HYA,GAAZ,SAAYA,GACRA,EAAAA,EAAA,KAAA,GAAA,OACAA,EAAAA,EAAA,KAAA,GAAA,OACAA,EAAAA,EAAA,YAAA,GAAA,cACAA,EAAAA,EAAA,OAAA,GAAA,QACH,CALD,CAAYA,IAAAA,EAAkB,CAAA"}
|
package/dist/web.js
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
var LeaferUI = function(exports) {
|
|
2
2
|
"use strict";
|
|
3
|
+
exports.PathNodeHandleType = void 0;
|
|
4
|
+
(function(PathNodeHandleType) {
|
|
5
|
+
PathNodeHandleType[PathNodeHandleType["none"] = 1] = "none";
|
|
6
|
+
PathNodeHandleType[PathNodeHandleType["free"] = 2] = "free";
|
|
7
|
+
PathNodeHandleType[PathNodeHandleType["mirrorAngle"] = 3] = "mirrorAngle";
|
|
8
|
+
PathNodeHandleType[PathNodeHandleType["mirror"] = 4] = "mirror";
|
|
9
|
+
})(exports.PathNodeHandleType || (exports.PathNodeHandleType = {}));
|
|
3
10
|
exports.Answer = void 0;
|
|
4
11
|
(function(Answer) {
|
|
5
12
|
Answer[Answer["No"] = 0] = "No";
|
|
@@ -3811,16 +3818,27 @@ var LeaferUI = function(exports) {
|
|
|
3811
3818
|
recycle(image) {
|
|
3812
3819
|
image.use--;
|
|
3813
3820
|
setTimeout(() => {
|
|
3814
|
-
if (!image.use)
|
|
3821
|
+
if (!image.use) {
|
|
3822
|
+
if (Platform.image.isLarge(image)) {
|
|
3823
|
+
if (image.url) Resource.remove(image.url);
|
|
3824
|
+
} else {
|
|
3825
|
+
image.clearLevels();
|
|
3826
|
+
I$1.recycledList.push(image);
|
|
3827
|
+
}
|
|
3828
|
+
}
|
|
3815
3829
|
});
|
|
3816
3830
|
},
|
|
3817
|
-
|
|
3831
|
+
recyclePaint(paint) {
|
|
3832
|
+
I$1.recycle(paint.image);
|
|
3833
|
+
},
|
|
3834
|
+
clearRecycled(force) {
|
|
3818
3835
|
const list = I$1.recycledList;
|
|
3819
|
-
if (list.length > I$1.maxRecycled) {
|
|
3820
|
-
list.forEach(image => !image.use && image.url && Resource.remove(image.url));
|
|
3836
|
+
if (list.length > I$1.maxRecycled || force) {
|
|
3837
|
+
list.forEach(image => (!image.use || force) && image.url && Resource.remove(image.url));
|
|
3821
3838
|
list.length = 0;
|
|
3822
3839
|
}
|
|
3823
3840
|
},
|
|
3841
|
+
clearLevels() {},
|
|
3824
3842
|
hasAlphaPixel(config) {
|
|
3825
3843
|
return FileHelper.alphaPixelTypes.some(item => I$1.isFormat(item, config));
|
|
3826
3844
|
},
|
|
@@ -3835,7 +3853,7 @@ var LeaferUI = function(exports) {
|
|
|
3835
3853
|
return false;
|
|
3836
3854
|
},
|
|
3837
3855
|
destroy() {
|
|
3838
|
-
|
|
3856
|
+
this.clearRecycled(true);
|
|
3839
3857
|
}
|
|
3840
3858
|
};
|
|
3841
3859
|
const I$1 = ImageManager;
|
|
@@ -3935,11 +3953,15 @@ var LeaferUI = function(exports) {
|
|
|
3935
3953
|
Platform.image.setPatternTransform(pattern, transform, paint);
|
|
3936
3954
|
return pattern;
|
|
3937
3955
|
}
|
|
3956
|
+
clearLevels(_checkUse) {}
|
|
3938
3957
|
destroy() {
|
|
3958
|
+
this.clearLevels();
|
|
3959
|
+
const {view: view} = this;
|
|
3960
|
+
if (view && view.close) view.close();
|
|
3939
3961
|
this.config = {
|
|
3940
3962
|
url: ""
|
|
3941
3963
|
};
|
|
3942
|
-
this.cache = null;
|
|
3964
|
+
this.cache = this.view = null;
|
|
3943
3965
|
this.waitComplete.length = 0;
|
|
3944
3966
|
}
|
|
3945
3967
|
}
|
|
@@ -5569,6 +5591,7 @@ var LeaferUI = function(exports) {
|
|
|
5569
5591
|
const LeafRender = {
|
|
5570
5592
|
__render(canvas, options) {
|
|
5571
5593
|
if (options.shape) return this.__renderShape(canvas, options);
|
|
5594
|
+
if (options.cellList && !options.cellList.has(this)) return;
|
|
5572
5595
|
if (this.__worldOpacity) {
|
|
5573
5596
|
const data = this.__;
|
|
5574
5597
|
if (data.bright && !options.topRendering) return options.topList.add(this);
|
|
@@ -6447,7 +6470,7 @@ var LeaferUI = function(exports) {
|
|
|
6447
6470
|
this.levelMap = null;
|
|
6448
6471
|
}
|
|
6449
6472
|
}
|
|
6450
|
-
const version = "1.
|
|
6473
|
+
const version = "1.12.0";
|
|
6451
6474
|
const debug$5 = Debug.get("LeaferCanvas");
|
|
6452
6475
|
class LeaferCanvas extends LeaferCanvasBase {
|
|
6453
6476
|
set zIndex(zIndex) {
|
|
@@ -6755,7 +6778,7 @@ var LeaferUI = function(exports) {
|
|
|
6755
6778
|
return this.hasAdd || this.hasRemove || this.hasVisible;
|
|
6756
6779
|
}
|
|
6757
6780
|
get updatedList() {
|
|
6758
|
-
if (this.hasRemove) {
|
|
6781
|
+
if (this.hasRemove && this.config.usePartLayout) {
|
|
6759
6782
|
const updatedList = new LeafList;
|
|
6760
6783
|
this.__updatedList.list.forEach(item => {
|
|
6761
6784
|
if (item.leafer) updatedList.add(item);
|
|
@@ -6790,16 +6813,18 @@ var LeaferUI = function(exports) {
|
|
|
6790
6813
|
if (this.running) this.target.emit(RenderEvent.REQUEST);
|
|
6791
6814
|
}
|
|
6792
6815
|
__onAttrChange(event) {
|
|
6793
|
-
this.__updatedList.add(event.target);
|
|
6816
|
+
if (this.config.usePartLayout) this.__updatedList.add(event.target);
|
|
6794
6817
|
this.update();
|
|
6795
6818
|
}
|
|
6796
6819
|
__onChildEvent(event) {
|
|
6797
|
-
if (
|
|
6798
|
-
|
|
6799
|
-
|
|
6800
|
-
|
|
6801
|
-
|
|
6802
|
-
|
|
6820
|
+
if (this.config.usePartLayout) {
|
|
6821
|
+
if (event.type === ChildEvent.ADD) {
|
|
6822
|
+
this.hasAdd = true;
|
|
6823
|
+
this.__pushChild(event.child);
|
|
6824
|
+
} else {
|
|
6825
|
+
this.hasRemove = true;
|
|
6826
|
+
this.__updatedList.add(event.parent);
|
|
6827
|
+
}
|
|
6803
6828
|
}
|
|
6804
6829
|
this.update();
|
|
6805
6830
|
}
|
|
@@ -6906,7 +6931,9 @@ var LeaferUI = function(exports) {
|
|
|
6906
6931
|
class Layouter {
|
|
6907
6932
|
constructor(target, userConfig) {
|
|
6908
6933
|
this.totalTimes = 0;
|
|
6909
|
-
this.config = {
|
|
6934
|
+
this.config = {
|
|
6935
|
+
usePartLayout: true
|
|
6936
|
+
};
|
|
6910
6937
|
this.__levelList = new LeafLevelList;
|
|
6911
6938
|
this.target = target;
|
|
6912
6939
|
if (userConfig) this.config = DataHelper.default(userConfig, this.config);
|
|
@@ -6951,7 +6978,7 @@ var LeaferUI = function(exports) {
|
|
|
6951
6978
|
this.totalTimes++;
|
|
6952
6979
|
this.layouting = true;
|
|
6953
6980
|
this.target.emit(WatchEvent.REQUEST);
|
|
6954
|
-
if (this.totalTimes > 1) {
|
|
6981
|
+
if (this.totalTimes > 1 && this.config.usePartLayout) {
|
|
6955
6982
|
this.partLayout();
|
|
6956
6983
|
} else {
|
|
6957
6984
|
this.fullLayout();
|
|
@@ -7066,7 +7093,7 @@ var LeaferUI = function(exports) {
|
|
|
7066
7093
|
}
|
|
7067
7094
|
update(change = true) {
|
|
7068
7095
|
if (!this.changed) this.changed = change;
|
|
7069
|
-
this.__requestRender();
|
|
7096
|
+
if (!this.requestTime) this.__requestRender();
|
|
7070
7097
|
}
|
|
7071
7098
|
requestLayout() {
|
|
7072
7099
|
this.target.emit(LayoutEvent.REQUEST);
|
|
@@ -7173,7 +7200,7 @@ var LeaferUI = function(exports) {
|
|
|
7173
7200
|
Run.end(t);
|
|
7174
7201
|
}
|
|
7175
7202
|
__render(bounds, realBounds) {
|
|
7176
|
-
const {canvas: canvas} = this, includes = bounds.includes(
|
|
7203
|
+
const {canvas: canvas, target: target} = this, includes = bounds.includes(target.__world), options = includes ? {
|
|
7177
7204
|
includes: includes
|
|
7178
7205
|
} : {
|
|
7179
7206
|
bounds: bounds,
|
|
@@ -7181,12 +7208,16 @@ var LeaferUI = function(exports) {
|
|
|
7181
7208
|
};
|
|
7182
7209
|
if (this.needFill) canvas.fillWorld(bounds, this.config.fill);
|
|
7183
7210
|
if (Debug.showRepaint) Debug.drawRepaint(canvas, bounds);
|
|
7184
|
-
|
|
7211
|
+
if (this.config.useCellRender) options.cellList = this.getCellList();
|
|
7212
|
+
Platform.render(target, canvas, options);
|
|
7185
7213
|
this.renderBounds = realBounds = realBounds || bounds;
|
|
7186
7214
|
this.renderOptions = options;
|
|
7187
7215
|
this.totalBounds.isEmpty() ? this.totalBounds = realBounds : this.totalBounds.add(realBounds);
|
|
7188
7216
|
canvas.updateRender(realBounds);
|
|
7189
7217
|
}
|
|
7218
|
+
getCellList() {
|
|
7219
|
+
return undefined;
|
|
7220
|
+
}
|
|
7190
7221
|
addBlock(block) {
|
|
7191
7222
|
if (!this.updateBlocks) this.updateBlocks = [];
|
|
7192
7223
|
this.updateBlocks.push(block);
|
|
@@ -7800,6 +7831,11 @@ var LeaferUI = function(exports) {
|
|
|
7800
7831
|
}
|
|
7801
7832
|
this._boxStyle = value;
|
|
7802
7833
|
}
|
|
7834
|
+
__getInputData(names, options) {
|
|
7835
|
+
const data = super.__getInputData(names, options);
|
|
7836
|
+
if (data.textEditing) delete data.textEditing;
|
|
7837
|
+
return data;
|
|
7838
|
+
}
|
|
7803
7839
|
}
|
|
7804
7840
|
class ImageData extends RectData {
|
|
7805
7841
|
setUrl(value) {
|
|
@@ -11112,6 +11148,7 @@ var LeaferUI = function(exports) {
|
|
|
11112
11148
|
const {boxBounds: boxBounds} = ui.__layout;
|
|
11113
11149
|
switch (paint.type) {
|
|
11114
11150
|
case "image":
|
|
11151
|
+
if (!paint.url) return undefined;
|
|
11115
11152
|
leafPaint = PaintImage.image(ui, attrName, paint, boxBounds, !recycleMap || !recycleMap[paint.url]);
|
|
11116
11153
|
break;
|
|
11117
11154
|
|
|
@@ -11485,7 +11522,7 @@ var LeaferUI = function(exports) {
|
|
|
11485
11522
|
if (data.repeat) {
|
|
11486
11523
|
drawImage = false;
|
|
11487
11524
|
} else if (!(originPaint.changeful || Platform.name === "miniapp" && ResizeEvent.isResizing(ui) || exporting)) {
|
|
11488
|
-
drawImage = Platform.image.isLarge(image, scaleX, scaleY);
|
|
11525
|
+
drawImage = Platform.image.isLarge(image, scaleX, scaleY) || image.width * scaleX > 8096 || image.height * scaleY > 8096;
|
|
11489
11526
|
}
|
|
11490
11527
|
}
|
|
11491
11528
|
if (drawImage) {
|
|
@@ -11541,7 +11578,7 @@ var LeaferUI = function(exports) {
|
|
|
11541
11578
|
if (url) {
|
|
11542
11579
|
if (!recycleMap) recycleMap = {};
|
|
11543
11580
|
recycleMap[url] = true;
|
|
11544
|
-
ImageManager.
|
|
11581
|
+
ImageManager.recyclePaint(paint);
|
|
11545
11582
|
if (image.loading) {
|
|
11546
11583
|
if (!input) {
|
|
11547
11584
|
input = data.__input && data.__input[attrName] || [];
|
package/dist/web.min.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e=require("leafer-ui"),t=require("@leafer-in/robot"),
|
|
1
|
+
"use strict";var e,r=require("leafer-ui"),t=require("@leafer-in/robot"),o=require("@leafer-in/state"),n=require("@leafer-in/animate"),a=require("@leafer-in/motion-path"),c=require("@leafer-in/find");exports.PathNodeHandleType=void 0,(e=exports.PathNodeHandleType||(exports.PathNodeHandleType={}))[e.none=1]="none",e[e.free=2]="free",e[e.mirrorAngle=3]="mirrorAngle",e[e.mirror=4]="mirror",Object.keys(r).forEach(function(e){"default"===e||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return r[e]}})}),Object.keys(t).forEach(function(e){"default"===e||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return t[e]}})}),Object.keys(o).forEach(function(e){"default"===e||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return o[e]}})}),Object.keys(n).forEach(function(e){"default"===e||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return n[e]}})}),Object.keys(a).forEach(function(e){"default"===e||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return a[e]}})}),Object.keys(c).forEach(function(e){"default"===e||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return c[e]}})});
|
|
2
2
|
//# sourceMappingURL=web.min.cjs.map
|
package/dist/web.min.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"web.min.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"web.min.cjs","sources":["../../../../src/leafer/packages/interface/src/path/IPathCommand.ts"],"sourcesContent":["import { IPointData } from '../math/IMath'\n\ntype Command = number\ntype x = number\ntype y = number\ntype x1 = number\ntype y1 = number\ntype x2 = number\ntype y2 = number\ntype radiusX = number\ntype radiusY = number\ntype xAxisRotation = number\ntype largeArcFlag = number\ntype sweepFlag = number\n\n\nexport type MCommandData = [Command, x, y]\nexport type HCommandData = [Command, x]\nexport type VCommandData = [Command, y]\nexport type LCommandData = MCommandData\n\nexport type CCommandData = [Command, x1, y1, x2, y2, x, y]\nexport type SCommandData = [Command, x2, y2, x, y]\n\nexport type QCommandData = [Command, x1, y1, x, y]\nexport type TCommandData = [Command, x, y]\n\nexport type ZCommandData = [Command]\n\nexport type ACommandData = [Command, radiusX, radiusY, xAxisRotation, largeArcFlag, sweepFlag, x, y]\n\n\n// 非svg标准的canvas绘图命令\ntype width = number\ntype height = number\ntype rotation = number\ntype startAngle = number\ntype endAngle = number\ntype anticlockwise = boolean\ntype cornerRadius = number | number[]\ntype radius = number\n\nexport type RectCommandData = [Command, x, y, width, height]\nexport type RoundRectCommandData = [Command, x, y, width, height, cornerRadius]\nexport type EllipseCommandData = [Command, x, y, radiusX, radiusY, rotation, startAngle, endAngle, anticlockwise]\nexport type ArcCommandData = [Command, x, y, radius, startAngle, endAngle, anticlockwise]\nexport type ArcToCommandData = [Command, x1, y1, x2, y2, radius]\n\n\nexport type CanvasPathCommand = 1 | 2 | 5 | 7 | 11 // M | L | C | Q | Z canvas可以绘制的命令\n\nexport type IPathCommandData = number[] // ...(MCommandData | LCommandData | CCommandData | QCommandData | ZCommandData)\n\n\n// 路径命令对象\nexport interface MoveToCommandObject {\n name: 'M'\n x: number\n y: number\n}\nexport interface LineToCommandObject {\n name: 'L'\n x: number\n y: number\n}\n\nexport interface BezierCurveToCommandObject {\n name: 'C'\n x1: number\n y1: number\n x2: number\n y2: number\n x: number\n y: number\n}\n\nexport interface QuadraticCurveToCommandObject {\n name: 'Q'\n x1: number\n y1: number\n x: number\n y: number\n}\n\nexport interface ClosePathCommandObject {\n name: 'Z'\n}\n\nexport type IPathCommandObject = MoveToCommandObject | LineToCommandObject | BezierCurveToCommandObject | QuadraticCurveToCommandObject | ClosePathCommandObject // M | L | C | Q | Z canvas可以绘制的命令\n\n\n// 可视化路径节点\n\nexport interface IPathCommandNodeBase {\n name: 'M^' | 'L^' | 'C^' | 'Z^'\n x: number\n y: number\n a?: IPointData // 第一个手柄,连接上一个节点\n b?: IPointData // 第二个手柄,连接下一个节点\n ab?: PathNodeHandleType // 手柄类型\n}\n\nexport interface MoveToCommandNode extends IPathCommandNodeBase {\n name: 'M^'\n}\nexport interface LineToCommandNode extends IPathCommandNodeBase {\n name: 'L^'\n}\n\nexport interface BezierCurveToCommandNode extends IPathCommandNodeBase {\n name: 'C^'\n}\n\nexport interface ClosePathCommandNode {\n name: 'Z^'\n x?: number\n y?: number\n a?: IPointData\n b?: IPointData\n ab?: PathNodeHandleType\n}\n\nexport type IPathCommandNode = MoveToCommandNode | LineToCommandNode | BezierCurveToCommandNode | ClosePathCommandNode // M | L | C | Z 路径节点命令(适合可视化编辑)\n\nexport enum PathNodeHandleType { // 手柄类型\n none = 1, // 无手柄\n free = 2, // 每个手柄自由控制\n mirrorAngle = 3, // 仅镜像角度\n mirror = 4, // 镜像角度和长度\n}\n\nexport type PathNodeHandleName = 'a' | 'b' // 手柄名称\n\nexport interface IPathNodeBase {\n pathNode: IPathCommandNode\n}"],"names":["PathNodeHandleType"],"mappings":"iBA4HYA,sLAAAA,QAAAA,wBAAAA,GAAAA,EAAAA,QAAAA,qBAAAA,2BAAkB,CAAA,IAC1BA,EAAA,KAAA,GAAA,OACAA,EAAAA,EAAA,KAAA,GAAA,OACAA,EAAAA,EAAA,YAAA,GAAA,cACAA,EAAAA,EAAA,OAAA,GAAA"}
|