@leafer-game/worker 2.1.4 → 2.1.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/dist/worker.esm.min.js.map +1 -1
- package/dist/worker.js +12 -185
- package/dist/worker.min.cjs.map +1 -1
- package/dist/worker.min.js +1 -1
- package/dist/worker.min.js.map +1 -1
- package/dist/worker.module.js +12 -186
- package/dist/worker.module.min.js +1 -1
- package/dist/worker.module.min.js.map +1 -1
- package/package.json +12 -12
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"worker.esm.min.js","sources":["../../../../../../../src/leafer/packages/interface/src/path/IPathCommand.ts"],"sourcesContent":["import { IPointData } from '../math/IMath'\nimport { IWindingRule } from '../canvas/ICanvas'\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\nexport interface IPathCommandDataWithRadius {\n data: IPathCommandData\n radius: number[]\n}\n\nexport interface IPathCommandDataWithWindingRule {\n data: IPathCommandData\n windingRule?: IWindingRule\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 r?: 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 r?: 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":"
|
|
1
|
+
{"version":3,"file":"worker.esm.min.js","sources":["../../../../../../../src/leafer/packages/interface/src/path/IPathCommand.ts"],"sourcesContent":["import { IPointData } from '../math/IMath'\nimport { IWindingRule } from '../canvas/ICanvas'\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\nexport interface IPathCommandDataWithRadius {\n data: IPathCommandData\n radius: number[]\n}\n\nexport interface IPathCommandDataWithWindingRule {\n data: IPathCommandData\n windingRule?: IWindingRule\n}\n\n// 路径命令对象\nexport interface MoveToCommandObject {\n name: 'M'\n x: number\n y: number\n pressure?: number // 压感\n}\nexport interface LineToCommandObject {\n name: 'L'\n x: number\n y: number\n pressure?: 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 pressure?: number\n}\n\nexport interface QuadraticCurveToCommandObject {\n name: 'Q'\n x1: number\n y1: number\n x: number\n y: number\n pressure?: 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 r?: number // 圆角半径\n a?: IPointData // 第一个手柄,连接上一个节点\n b?: IPointData // 第二个手柄,连接下一个节点\n ab?: PathNodeHandleType // 手柄类型\n pressure?: number // 压感\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 r?: 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":"gMA6IYA,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/worker.js
CHANGED
|
@@ -240,7 +240,7 @@ var LeaferUI = function(exports) {
|
|
|
240
240
|
RUNTIME: "runtime",
|
|
241
241
|
LEAF: "leaf",
|
|
242
242
|
TASK: "task",
|
|
243
|
-
|
|
243
|
+
CANVAS: "canvas",
|
|
244
244
|
IMAGE: "image",
|
|
245
245
|
types: {},
|
|
246
246
|
create(typeName) {
|
|
@@ -869,7 +869,7 @@ var LeaferUI = function(exports) {
|
|
|
869
869
|
return quick ? t.x === point.x && t.y === point.y : float$4(t.x) === float$4(point.x) && float$4(t.y) === float$4(point.y);
|
|
870
870
|
},
|
|
871
871
|
reset(t) {
|
|
872
|
-
|
|
872
|
+
t.x = t.y = 0;
|
|
873
873
|
}
|
|
874
874
|
};
|
|
875
875
|
const P$5 = PointHelper;
|
|
@@ -1073,6 +1073,7 @@ var LeaferUI = function(exports) {
|
|
|
1073
1073
|
}
|
|
1074
1074
|
reset() {
|
|
1075
1075
|
MatrixHelper.reset(this);
|
|
1076
|
+
return this;
|
|
1076
1077
|
}
|
|
1077
1078
|
}
|
|
1078
1079
|
const tempMatrix$2 = new Matrix;
|
|
@@ -2177,7 +2178,7 @@ var LeaferUI = function(exports) {
|
|
|
2177
2178
|
this.worldTransform = {};
|
|
2178
2179
|
if (!config) config = minSize;
|
|
2179
2180
|
this.manager = manager;
|
|
2180
|
-
this.innerId = IncrementId.create(IncrementId.
|
|
2181
|
+
this.innerId = IncrementId.create(IncrementId.CANVAS);
|
|
2181
2182
|
const {width: width, height: height, pixelRatio: pixelRatio} = config;
|
|
2182
2183
|
this.autoLayout = !width || !height;
|
|
2183
2184
|
this.size.pixelRatio = pixelRatio || Platform.devicePixelRatio;
|
|
@@ -2327,6 +2328,7 @@ var LeaferUI = function(exports) {
|
|
|
2327
2328
|
}
|
|
2328
2329
|
useGrayscaleAlpha(bounds) {
|
|
2329
2330
|
this.setTempPixelBounds(bounds, true, true);
|
|
2331
|
+
if (!tempPixelBounds.width || !tempPixelBounds.height) return;
|
|
2330
2332
|
let alpha, pixel;
|
|
2331
2333
|
const {context: context} = this, imageData = context.getImageData(tempPixelBounds.x, tempPixelBounds.y, tempPixelBounds.width, tempPixelBounds.height), {data: data} = imageData;
|
|
2332
2334
|
for (let i = 0, len = data.length; i < len; i += 4) {
|
|
@@ -5207,6 +5209,7 @@ var LeaferUI = function(exports) {
|
|
|
5207
5209
|
this.renderChanged = true;
|
|
5208
5210
|
this.renderSpread || (this.renderSpread = 1);
|
|
5209
5211
|
this.boundsChanged = true;
|
|
5212
|
+
this.hitCanvasChanged = true;
|
|
5210
5213
|
}
|
|
5211
5214
|
scaleChange() {
|
|
5212
5215
|
this.scaleChanged = true;
|
|
@@ -6053,10 +6056,6 @@ var LeaferUI = function(exports) {
|
|
|
6053
6056
|
}
|
|
6054
6057
|
}
|
|
6055
6058
|
}
|
|
6056
|
-
set(_data, _isTemp) {}
|
|
6057
|
-
get(_name) {
|
|
6058
|
-
return undefined;
|
|
6059
|
-
}
|
|
6060
6059
|
setAttr(name, value) {
|
|
6061
6060
|
this[name] = value;
|
|
6062
6061
|
}
|
|
@@ -6073,37 +6072,10 @@ var LeaferUI = function(exports) {
|
|
|
6073
6072
|
toString(options) {
|
|
6074
6073
|
return JSON.stringify(this.toJSON(options));
|
|
6075
6074
|
}
|
|
6076
|
-
|
|
6077
|
-
|
|
6078
|
-
|
|
6079
|
-
__SVG(_data) {}
|
|
6080
|
-
toHTML() {
|
|
6081
|
-
return undefined;
|
|
6082
|
-
}
|
|
6083
|
-
__setAttr(_attrName, _newValue) {
|
|
6084
|
-
return true;
|
|
6085
|
-
}
|
|
6086
|
-
__getAttr(_attrName) {
|
|
6087
|
-
return undefined;
|
|
6088
|
-
}
|
|
6089
|
-
setProxyAttr(_attrName, _newValue) {}
|
|
6090
|
-
getProxyAttr(_attrName) {
|
|
6091
|
-
return undefined;
|
|
6092
|
-
}
|
|
6093
|
-
find(_condition, _options) {
|
|
6094
|
-
return undefined;
|
|
6095
|
-
}
|
|
6096
|
-
findTag(_tag) {
|
|
6097
|
-
return undefined;
|
|
6098
|
-
}
|
|
6099
|
-
findOne(_condition, _options) {
|
|
6100
|
-
return undefined;
|
|
6101
|
-
}
|
|
6102
|
-
findId(_id) {
|
|
6103
|
-
return undefined;
|
|
6075
|
+
scaleResize(scaleX, scaleY = scaleX, _noResize, _boundsType) {
|
|
6076
|
+
this.scaleX *= scaleX;
|
|
6077
|
+
this.scaleY *= scaleY;
|
|
6104
6078
|
}
|
|
6105
|
-
focus(_value) {}
|
|
6106
|
-
updateState() {}
|
|
6107
6079
|
updateLayout() {
|
|
6108
6080
|
this.__layout.update();
|
|
6109
6081
|
}
|
|
@@ -6119,27 +6091,6 @@ var LeaferUI = function(exports) {
|
|
|
6119
6091
|
__extraUpdate() {
|
|
6120
6092
|
if (this.leaferIsReady) this.leafer.layouter.addExtra(this);
|
|
6121
6093
|
}
|
|
6122
|
-
__updateWorldMatrix() {}
|
|
6123
|
-
__updateLocalMatrix() {}
|
|
6124
|
-
__updateWorldBounds() {}
|
|
6125
|
-
__updateLocalBounds() {}
|
|
6126
|
-
__updateLocalBoxBounds() {}
|
|
6127
|
-
__updateLocalStrokeBounds() {}
|
|
6128
|
-
__updateLocalRenderBounds() {}
|
|
6129
|
-
__updateBoxBounds(_secondLayout, _bounds) {}
|
|
6130
|
-
__updateContentBounds() {}
|
|
6131
|
-
__updateStrokeBounds(_bounds) {}
|
|
6132
|
-
__updateRenderBounds(_bounds) {}
|
|
6133
|
-
__updateAutoLayout() {}
|
|
6134
|
-
__updateFlowLayout() {}
|
|
6135
|
-
__updateNaturalSize() {}
|
|
6136
|
-
__updateStrokeSpread() {
|
|
6137
|
-
return 0;
|
|
6138
|
-
}
|
|
6139
|
-
__updateRenderSpread() {
|
|
6140
|
-
return 0;
|
|
6141
|
-
}
|
|
6142
|
-
__onUpdateSize() {}
|
|
6143
6094
|
__updateEraser(value) {
|
|
6144
6095
|
this.__hasEraser = value ? true : this.children.some(item => item.__.eraser);
|
|
6145
6096
|
}
|
|
@@ -6153,7 +6104,6 @@ var LeaferUI = function(exports) {
|
|
|
6153
6104
|
__updateMask(_value) {
|
|
6154
6105
|
this.__hasMask = this.children.some(item => item.__.mask && item.__.visible && item.__.opacity);
|
|
6155
6106
|
}
|
|
6156
|
-
__renderMask(_canvas, _options) {}
|
|
6157
6107
|
__getNowWorld(options) {
|
|
6158
6108
|
if (options.matrix) {
|
|
6159
6109
|
if (!this.__cameraWorld) this.__cameraWorld = {};
|
|
@@ -6309,76 +6259,12 @@ var LeaferUI = function(exports) {
|
|
|
6309
6259
|
flip(axis, transition) {
|
|
6310
6260
|
transform(this, getFlipTransform(this, axis), false, transition);
|
|
6311
6261
|
}
|
|
6312
|
-
scaleResize(scaleX, scaleY = scaleX, _noResize, _boundsType) {
|
|
6313
|
-
this.scaleX *= scaleX;
|
|
6314
|
-
this.scaleY *= scaleY;
|
|
6315
|
-
}
|
|
6316
|
-
__scaleResize(_scaleX, _scaleY) {}
|
|
6317
|
-
resizeWidth(_width) {}
|
|
6318
|
-
resizeHeight(_height) {}
|
|
6319
|
-
hit(_world, _hitRadius) {
|
|
6320
|
-
return true;
|
|
6321
|
-
}
|
|
6322
|
-
__hitWorld(_point, _forceHitFill) {
|
|
6323
|
-
return true;
|
|
6324
|
-
}
|
|
6325
|
-
__hit(_local, _forceHitFill) {
|
|
6326
|
-
return true;
|
|
6327
|
-
}
|
|
6328
|
-
__hitFill(_inner) {
|
|
6329
|
-
return true;
|
|
6330
|
-
}
|
|
6331
|
-
__hitStroke(_inner, _strokeWidth) {
|
|
6332
|
-
return true;
|
|
6333
|
-
}
|
|
6334
|
-
__hitPixel(_inner) {
|
|
6335
|
-
return true;
|
|
6336
|
-
}
|
|
6337
|
-
__drawHitPath(_canvas) {}
|
|
6338
|
-
__updateHitCanvas() {}
|
|
6339
|
-
__render(_canvas, _options) {}
|
|
6340
|
-
__drawFast(_canvas, _options) {}
|
|
6341
|
-
__draw(_canvas, _options, _originCanvas) {}
|
|
6342
|
-
__clip(_canvas, _options) {}
|
|
6343
|
-
__renderShape(_canvas, _options) {}
|
|
6344
|
-
__drawShape(_canvas, _options) {}
|
|
6345
|
-
__updateWorldOpacity() {}
|
|
6346
|
-
__updateChange() {}
|
|
6347
|
-
__drawPath(_canvas) {}
|
|
6348
|
-
__drawRenderPath(_canvas) {}
|
|
6349
|
-
__updatePath() {}
|
|
6350
|
-
__updateRenderPath(_updateCache) {}
|
|
6351
|
-
getMotionPathData() {
|
|
6352
|
-
return Plugin.need("path");
|
|
6353
|
-
}
|
|
6354
|
-
getMotionPoint(_motionDistance) {
|
|
6355
|
-
return Plugin.need("path");
|
|
6356
|
-
}
|
|
6357
|
-
getMotionTotal() {
|
|
6358
|
-
return 0;
|
|
6359
|
-
}
|
|
6360
|
-
__updateMotionPath() {}
|
|
6361
|
-
__runAnimation(_type, _complete) {}
|
|
6362
|
-
__updateSortChildren() {}
|
|
6363
|
-
add(_child, _index) {}
|
|
6364
6262
|
remove(_child, destroy) {
|
|
6365
6263
|
if (this.parent) this.parent.remove(this, destroy);
|
|
6366
6264
|
}
|
|
6367
6265
|
dropTo(parent, index, resize) {
|
|
6368
6266
|
drop(this, parent, index, resize);
|
|
6369
6267
|
}
|
|
6370
|
-
on(_type, _listener, _options) {}
|
|
6371
|
-
off(_type, _listener, _options) {}
|
|
6372
|
-
on_(_type, _listener, _bind, _options) {
|
|
6373
|
-
return undefined;
|
|
6374
|
-
}
|
|
6375
|
-
off_(_id) {}
|
|
6376
|
-
once(_type, _listener, _captureOrBind, _capture) {}
|
|
6377
|
-
emit(_type, _event, _capture) {}
|
|
6378
|
-
emitEvent(_event, _capture) {}
|
|
6379
|
-
hasEvent(_type, _capture) {
|
|
6380
|
-
return false;
|
|
6381
|
-
}
|
|
6382
6268
|
static changeAttr(attrName, defaultValue, fn) {
|
|
6383
6269
|
fn ? this.addAttr(attrName, defaultValue, fn) : defineDataProcessor(this.prototype, attrName, defaultValue);
|
|
6384
6270
|
}
|
|
@@ -6674,7 +6560,7 @@ var LeaferUI = function(exports) {
|
|
|
6674
6560
|
this.levelMap = null;
|
|
6675
6561
|
}
|
|
6676
6562
|
}
|
|
6677
|
-
const version = "2.1.
|
|
6563
|
+
const version = "2.1.5";
|
|
6678
6564
|
class LeaferCanvas extends LeaferCanvasBase {
|
|
6679
6565
|
get allowBackgroundColor() {
|
|
6680
6566
|
return true;
|
|
@@ -8080,17 +7966,12 @@ var LeaferUI = function(exports) {
|
|
|
8080
7966
|
if (!path) this.__drawPathByBox(pen);
|
|
8081
7967
|
return pen;
|
|
8082
7968
|
}
|
|
8083
|
-
reset(_data) {}
|
|
8084
7969
|
set(data, _transition) {
|
|
8085
7970
|
if (data) Object.assign(this, data);
|
|
8086
7971
|
}
|
|
8087
7972
|
get(name) {
|
|
8088
7973
|
return isString(name) ? this.__.__getInput(name) : this.__.__getInputData(name);
|
|
8089
7974
|
}
|
|
8090
|
-
createProxyData() {
|
|
8091
|
-
return undefined;
|
|
8092
|
-
}
|
|
8093
|
-
clearProxyData() {}
|
|
8094
7975
|
find(_condition, _options) {
|
|
8095
7976
|
return Plugin.need("find");
|
|
8096
7977
|
}
|
|
@@ -8128,6 +8009,7 @@ var LeaferUI = function(exports) {
|
|
|
8128
8009
|
data.lazy && !this.__inLazyBounds && !Export.running ? data.__needComputePaint = true : data.__computePaint();
|
|
8129
8010
|
}
|
|
8130
8011
|
}
|
|
8012
|
+
__updatePath() {}
|
|
8131
8013
|
__updateRenderPath(updateCache) {
|
|
8132
8014
|
const data = this.__;
|
|
8133
8015
|
if (data.path) {
|
|
@@ -8163,7 +8045,6 @@ var LeaferUI = function(exports) {
|
|
|
8163
8045
|
this.set(keyframe);
|
|
8164
8046
|
return Plugin.need("animate");
|
|
8165
8047
|
}
|
|
8166
|
-
killAnimate(_type, _nextStyle) {}
|
|
8167
8048
|
export(_filename, _options) {
|
|
8168
8049
|
return Plugin.need("export");
|
|
8169
8050
|
}
|
|
@@ -8266,7 +8147,6 @@ var LeaferUI = function(exports) {
|
|
|
8266
8147
|
__decorate([ surfaceType() ], exports.UI.prototype, "placeholderColor", void 0);
|
|
8267
8148
|
__decorate([ dataType(100) ], exports.UI.prototype, "placeholderDelay", void 0);
|
|
8268
8149
|
__decorate([ dataType({}) ], exports.UI.prototype, "data", void 0);
|
|
8269
|
-
__decorate([ rewrite(exports.Leaf.prototype.reset) ], exports.UI.prototype, "reset", null);
|
|
8270
8150
|
exports.UI = UI_1 = __decorate([ useModule(UIBounds), useModule(UIRender), rewriteAble() ], exports.UI);
|
|
8271
8151
|
exports.Group = class Group extends exports.UI {
|
|
8272
8152
|
get __tag() {
|
|
@@ -8302,9 +8182,6 @@ var LeaferUI = function(exports) {
|
|
|
8302
8182
|
}
|
|
8303
8183
|
return data;
|
|
8304
8184
|
}
|
|
8305
|
-
pick(_hitPoint, _options) {
|
|
8306
|
-
return undefined;
|
|
8307
|
-
}
|
|
8308
8185
|
addAt(child, index) {
|
|
8309
8186
|
this.add(child, index);
|
|
8310
8187
|
}
|
|
@@ -8314,11 +8191,6 @@ var LeaferUI = function(exports) {
|
|
|
8314
8191
|
addBefore(child, before) {
|
|
8315
8192
|
this.add(child, this.children.indexOf(before));
|
|
8316
8193
|
}
|
|
8317
|
-
add(_child, _index) {}
|
|
8318
|
-
addMany(..._children) {}
|
|
8319
|
-
remove(_child, _destroy) {}
|
|
8320
|
-
removeAll(_destroy) {}
|
|
8321
|
-
clear() {}
|
|
8322
8194
|
};
|
|
8323
8195
|
__decorate([ dataProcessor(GroupData) ], exports.Group.prototype, "__", void 0);
|
|
8324
8196
|
__decorate([ boundsType(0) ], exports.Group.prototype, "width", void 0);
|
|
@@ -9172,51 +9044,6 @@ var LeaferUI = function(exports) {
|
|
|
9172
9044
|
this.add(path);
|
|
9173
9045
|
return this;
|
|
9174
9046
|
}
|
|
9175
|
-
beginPath() {
|
|
9176
|
-
return this;
|
|
9177
|
-
}
|
|
9178
|
-
moveTo(_x, _y) {
|
|
9179
|
-
return this;
|
|
9180
|
-
}
|
|
9181
|
-
lineTo(_x, _y) {
|
|
9182
|
-
return this;
|
|
9183
|
-
}
|
|
9184
|
-
bezierCurveTo(_x1, _y1, _x2, _y2, _x, _y) {
|
|
9185
|
-
return this;
|
|
9186
|
-
}
|
|
9187
|
-
quadraticCurveTo(_x1, _y1, _x, _y) {
|
|
9188
|
-
return this;
|
|
9189
|
-
}
|
|
9190
|
-
closePath() {
|
|
9191
|
-
return this;
|
|
9192
|
-
}
|
|
9193
|
-
rect(_x, _y, _width, _height) {
|
|
9194
|
-
return this;
|
|
9195
|
-
}
|
|
9196
|
-
roundRect(_x, _y, _width, _height, _cornerRadius) {
|
|
9197
|
-
return this;
|
|
9198
|
-
}
|
|
9199
|
-
ellipse(_x, _y, _radiusX, _radiusY, _rotation, _startAngle, _endAngle, _anticlockwise) {
|
|
9200
|
-
return this;
|
|
9201
|
-
}
|
|
9202
|
-
arc(_x, _y, _radius, _startAngle, _endAngle, _anticlockwise) {
|
|
9203
|
-
return this;
|
|
9204
|
-
}
|
|
9205
|
-
arcTo(_x1, _y1, _x2, _y2, _radius) {
|
|
9206
|
-
return this;
|
|
9207
|
-
}
|
|
9208
|
-
drawEllipse(_x, _y, _radiusX, _radiusY, _rotation, _startAngle, _endAngle, _anticlockwise) {
|
|
9209
|
-
return this;
|
|
9210
|
-
}
|
|
9211
|
-
drawArc(_x, _y, _radius, _startAngle, _endAngle, _anticlockwise) {
|
|
9212
|
-
return this;
|
|
9213
|
-
}
|
|
9214
|
-
drawPoints(_points, _curve, _close) {
|
|
9215
|
-
return this;
|
|
9216
|
-
}
|
|
9217
|
-
clearPath() {
|
|
9218
|
-
return this;
|
|
9219
|
-
}
|
|
9220
9047
|
paint() {
|
|
9221
9048
|
const {pathElement: pathElement} = this;
|
|
9222
9049
|
if (!pathElement.__layout.boxChanged) pathElement.forceUpdate("path");
|
|
@@ -11042,7 +10869,7 @@ var LeaferUI = function(exports) {
|
|
|
11042
10869
|
needUpdate = false;
|
|
11043
10870
|
}
|
|
11044
10871
|
}
|
|
11045
|
-
if (paint.mode === "brush") PaintImage.brush(leafPaint, ui);
|
|
10872
|
+
if (paint.mode === "brush") PaintImage.brush(leafPaint, ui, attrName);
|
|
11046
10873
|
if (!leafPaint.data) {
|
|
11047
10874
|
PaintImage.createData(leafPaint, image, paint, boxBounds);
|
|
11048
10875
|
const {transform: transform} = leafPaint.data, {opacity: opacity} = paint;
|
package/dist/worker.min.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"worker.min.cjs","sources":["../../../../../../../src/leafer/packages/interface/src/path/IPathCommand.ts"],"sourcesContent":["import { IPointData } from '../math/IMath'\nimport { IWindingRule } from '../canvas/ICanvas'\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\nexport interface IPathCommandDataWithRadius {\n data: IPathCommandData\n radius: number[]\n}\n\nexport interface IPathCommandDataWithWindingRule {\n data: IPathCommandData\n windingRule?: IWindingRule\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 r?: 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 r?: 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":"
|
|
1
|
+
{"version":3,"file":"worker.min.cjs","sources":["../../../../../../../src/leafer/packages/interface/src/path/IPathCommand.ts"],"sourcesContent":["import { IPointData } from '../math/IMath'\nimport { IWindingRule } from '../canvas/ICanvas'\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\nexport interface IPathCommandDataWithRadius {\n data: IPathCommandData\n radius: number[]\n}\n\nexport interface IPathCommandDataWithWindingRule {\n data: IPathCommandData\n windingRule?: IWindingRule\n}\n\n// 路径命令对象\nexport interface MoveToCommandObject {\n name: 'M'\n x: number\n y: number\n pressure?: number // 压感\n}\nexport interface LineToCommandObject {\n name: 'L'\n x: number\n y: number\n pressure?: 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 pressure?: number\n}\n\nexport interface QuadraticCurveToCommandObject {\n name: 'Q'\n x1: number\n y1: number\n x: number\n y: number\n pressure?: 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 r?: number // 圆角半径\n a?: IPointData // 第一个手柄,连接上一个节点\n b?: IPointData // 第二个手柄,连接下一个节点\n ab?: PathNodeHandleType // 手柄类型\n pressure?: number // 压感\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 r?: 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":"iBA6IYA,8LAAAA,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"}
|