@visactor/vrender 0.21.0-alpha.4 → 0.21.0-beta.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/cjs/index.d.ts +1 -1
- package/cjs/index.js +10 -11
- package/cjs/index.js.map +1 -1
- package/dist/index.es.js +137 -111
- package/dist/index.js +137 -111
- package/dist/index.min.js +1 -1
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/index.js.map +1 -1
- package/package.json +6 -6
package/dist/index.es.js
CHANGED
|
@@ -3990,7 +3990,8 @@ const DefaultAttribute = Object.assign(Object.assign(Object.assign({
|
|
|
3990
3990
|
globalZIndex: 1,
|
|
3991
3991
|
globalCompositeOperation: "",
|
|
3992
3992
|
overflow: "hidden",
|
|
3993
|
-
shadowPickMode: "graphic"
|
|
3993
|
+
shadowPickMode: "graphic",
|
|
3994
|
+
keepStrokeScale: !1
|
|
3994
3995
|
}, DefaultDebugAttribute), DefaultStyle), DefaultTransform);
|
|
3995
3996
|
function addAttributeToPrototype(obj, c, keys) {
|
|
3996
3997
|
keys.forEach(key => {
|
|
@@ -6406,7 +6407,7 @@ class TimeOutTickHandler {
|
|
|
6406
6407
|
}
|
|
6407
6408
|
}
|
|
6408
6409
|
|
|
6409
|
-
class DefaultTicker {
|
|
6410
|
+
class DefaultTicker extends EventEmitter {
|
|
6410
6411
|
set mode(m) {
|
|
6411
6412
|
this._mode !== m && (this._mode = m, this.setupTickHandler());
|
|
6412
6413
|
}
|
|
@@ -6415,17 +6416,17 @@ class DefaultTicker {
|
|
|
6415
6416
|
}
|
|
6416
6417
|
constructor() {
|
|
6417
6418
|
let timelines = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
6418
|
-
this.handleTick = (handler, params) => {
|
|
6419
|
+
super(), this.handleTick = (handler, params) => {
|
|
6419
6420
|
const {
|
|
6420
6421
|
once = !1
|
|
6421
6422
|
} = null != params ? params : {};
|
|
6422
|
-
this.ifCanStop() ? this.stop() : (this._handlerTick(
|
|
6423
|
-
}, this._handlerTick =
|
|
6423
|
+
this.ifCanStop() ? this.stop() : (this._handlerTick(), once || handler.tick(this.interval, this.handleTick));
|
|
6424
|
+
}, this._handlerTick = () => {
|
|
6424
6425
|
const time = this.tickerHandler.getTime();
|
|
6425
6426
|
let delta = 0;
|
|
6426
6427
|
this.lastFrameTime >= 0 && (delta = time - this.lastFrameTime), this.lastFrameTime = time, this.status === STATUS$1.RUNNING && (this.tickCounts++, this.timelines.forEach(t => {
|
|
6427
6428
|
t.tick(delta);
|
|
6428
|
-
}));
|
|
6429
|
+
}), this.emit("afterTick"));
|
|
6429
6430
|
}, this.init(), this.lastFrameTime = -1, this.tickCounts = 0, this.timelines = timelines, this.autoStop = !0;
|
|
6430
6431
|
}
|
|
6431
6432
|
init() {
|
|
@@ -6521,6 +6522,9 @@ class DefaultTicker {
|
|
|
6521
6522
|
stop() {
|
|
6522
6523
|
this.status = STATUS$1.INITIAL, this.setupTickHandler(), this.lastFrameTime = -1;
|
|
6523
6524
|
}
|
|
6525
|
+
trySyncTickStatus() {
|
|
6526
|
+
this.status === STATUS$1.RUNNING && this._handlerTick();
|
|
6527
|
+
}
|
|
6524
6528
|
}
|
|
6525
6529
|
|
|
6526
6530
|
class ManualTickHandler {
|
|
@@ -7662,7 +7666,7 @@ class TagPointsUpdate extends ACustomAnimate {
|
|
|
7662
7666
|
lastMatchedIndex = i, lastMatchedPoint = tagMap.get(this.toPoints[i].context);
|
|
7663
7667
|
break;
|
|
7664
7668
|
}
|
|
7665
|
-
"clip" === this.newPointAnimateType && 0 !== this.toPoints.length && (Number.isFinite(lastMatchedIndex) ? (this.clipRange = this.toPoints[lastMatchedIndex][this.clipRangeByDimension] / this.toPoints[this.toPoints.length - 1][this.clipRangeByDimension], isValidNumber$1(this.clipRange) ? this.clipRange = clamp$1(this.clipRange, 0, 1) : this.clipRange = 0) : this.clipRange = 0);
|
|
7669
|
+
"clip" === this.newPointAnimateType && 0 !== this.toPoints.length && (Number.isFinite(lastMatchedIndex) ? (this.clipRange = this.toPoints[lastMatchedIndex][this.clipRangeByDimension] / this.toPoints[this.toPoints.length - 1][this.clipRangeByDimension], 1 === this.clipRange && (this.shrinkClipRange = this.toPoints[lastMatchedIndex][this.clipRangeByDimension] / this.fromPoints[this.fromPoints.length - 1][this.clipRangeByDimension]), isValidNumber$1(this.clipRange) ? this.clipRange = clamp$1(this.clipRange, 0, 1) : this.clipRange = 0) : this.clipRange = 0);
|
|
7666
7670
|
let prevMatchedPoint = this.toPoints[0];
|
|
7667
7671
|
this.interpolatePoints = this.toPoints.map((point, index) => {
|
|
7668
7672
|
const matchedPoint = tagMap.get(point.context);
|
|
@@ -7674,11 +7678,19 @@ class TagPointsUpdate extends ACustomAnimate {
|
|
|
7674
7678
|
return newPoint.defined = toPoint.defined, newPoint.context = toPoint.context, newPoint;
|
|
7675
7679
|
});
|
|
7676
7680
|
}
|
|
7681
|
+
onFirstRun() {
|
|
7682
|
+
const lastClipRange = this.target.attribute.clipRange;
|
|
7683
|
+
isValidNumber$1(lastClipRange * this.clipRange) && (this.clipRange *= lastClipRange);
|
|
7684
|
+
}
|
|
7677
7685
|
onUpdate(end, ratio, out) {
|
|
7678
7686
|
if (this.points = this.points.map((point, index) => {
|
|
7679
7687
|
const newPoint = pointInterpolation(this.interpolatePoints[index][0], this.interpolatePoints[index][1], ratio);
|
|
7680
7688
|
return newPoint.context = point.context, newPoint;
|
|
7681
|
-
}), this.clipRange
|
|
7689
|
+
}), this.clipRange) {
|
|
7690
|
+
if (this.shrinkClipRange) return void (end ? (out.points = this.toPoints, out.clipRange = 1) : (out.points = this.fromPoints, out.clipRange = this.clipRange - (this.clipRange - this.shrinkClipRange) * ratio));
|
|
7691
|
+
out.clipRange = this.clipRange + (1 - this.clipRange) * ratio;
|
|
7692
|
+
}
|
|
7693
|
+
if (this.segmentsCache && this.to.segments) {
|
|
7682
7694
|
let start = 0;
|
|
7683
7695
|
out.segments = this.to.segments.map((segment, index) => {
|
|
7684
7696
|
const end = start + this.segmentsCache[index],
|
|
@@ -9094,7 +9106,7 @@ class ResourceLoader {
|
|
|
9094
9106
|
}
|
|
9095
9107
|
static GetFile(url, type) {
|
|
9096
9108
|
let data = ResourceLoader.cache.get(url);
|
|
9097
|
-
return data ? "fail" === data.loadState ? Promise.reject() : "
|
|
9109
|
+
return data ? "init" === data.loadState || "fail" === data.loadState ? Promise.reject() : "loading" === data.loadState ? data.dataPromise.then(data => data.data) : Promise.resolve(data.data) : (data = {
|
|
9098
9110
|
type: type,
|
|
9099
9111
|
loadState: "init"
|
|
9100
9112
|
}, ResourceLoader.cache.set(url, data), "arrayBuffer" === type ? data.dataPromise = application.global.loadArrayBuffer(url) : "blob" === type ? data.dataPromise = application.global.loadBlob(url) : "json" === type && (data.dataPromise = application.global.loadJson(url)), data.dataPromise.then(data => data.data));
|
|
@@ -12032,7 +12044,8 @@ class DefaultArcRenderContribution {
|
|
|
12032
12044
|
x: originX = arcAttribute.x,
|
|
12033
12045
|
y: originY = arcAttribute.y,
|
|
12034
12046
|
scaleX = arcAttribute.scaleX,
|
|
12035
|
-
scaleY = arcAttribute.scaleY
|
|
12047
|
+
scaleY = arcAttribute.scaleY,
|
|
12048
|
+
keepStrokeScale = arcAttribute.keepStrokeScale
|
|
12036
12049
|
} = arc.attribute;
|
|
12037
12050
|
let {
|
|
12038
12051
|
innerRadius = arcAttribute.innerRadius,
|
|
@@ -12044,7 +12057,7 @@ class DefaultArcRenderContribution {
|
|
|
12044
12057
|
{
|
|
12045
12058
|
distance = arcAttribute[key].distance
|
|
12046
12059
|
} = borderStyle,
|
|
12047
|
-
d = getScaledStroke(context, distance, context.dpr),
|
|
12060
|
+
d = keepStrokeScale ? distance : getScaledStroke(context, distance, context.dpr),
|
|
12048
12061
|
deltaAngle = distance / outerRadius,
|
|
12049
12062
|
sign = "outerBorder" === key ? 1 : -1;
|
|
12050
12063
|
if (arc.setAttributes({
|
|
@@ -12089,14 +12102,15 @@ class DefaultCircleRenderContribution {
|
|
|
12089
12102
|
x: originX = circleAttribute.x,
|
|
12090
12103
|
y: originY = circleAttribute.y,
|
|
12091
12104
|
scaleX = circleAttribute.scaleX,
|
|
12092
|
-
scaleY = circleAttribute.scaleY
|
|
12105
|
+
scaleY = circleAttribute.scaleY,
|
|
12106
|
+
keepStrokeScale = circleAttribute.keepStrokeScale
|
|
12093
12107
|
} = circle.attribute,
|
|
12094
12108
|
renderBorder = (borderStyle, key) => {
|
|
12095
12109
|
const doStroke = !(!borderStyle || !borderStyle.stroke),
|
|
12096
12110
|
{
|
|
12097
12111
|
distance = circleAttribute[key].distance
|
|
12098
12112
|
} = borderStyle,
|
|
12099
|
-
d = getScaledStroke(context, distance, context.dpr),
|
|
12113
|
+
d = keepStrokeScale ? distance : getScaledStroke(context, distance, context.dpr),
|
|
12100
12114
|
sign = "outerBorder" === key ? 1 : -1;
|
|
12101
12115
|
if (context.beginPath(), context.arc(x, y, radius + sign * d, startAngle, endAngle), context.closePath(), context.setShadowBlendStyle && context.setShadowBlendStyle(circle, circle.attribute, circleAttribute), strokeCb) strokeCb(context, borderStyle, circleAttribute[key]);else if (doStroke) {
|
|
12102
12116
|
const lastOpacity = circleAttribute[key].opacity;
|
|
@@ -12215,7 +12229,8 @@ class DefaultRectRenderContribution {
|
|
|
12215
12229
|
scaleX = rectAttribute.scaleX,
|
|
12216
12230
|
scaleY = rectAttribute.scaleY,
|
|
12217
12231
|
x1: x1,
|
|
12218
|
-
y1: y1
|
|
12232
|
+
y1: y1,
|
|
12233
|
+
keepStrokeScale = rectAttribute.keepStrokeScale
|
|
12219
12234
|
} = rect.attribute;
|
|
12220
12235
|
let {
|
|
12221
12236
|
width: width,
|
|
@@ -12228,7 +12243,7 @@ class DefaultRectRenderContribution {
|
|
|
12228
12243
|
{
|
|
12229
12244
|
distance = rectAttribute[key].distance
|
|
12230
12245
|
} = borderStyle,
|
|
12231
|
-
d = getScaledStroke(context, distance, context.dpr),
|
|
12246
|
+
d = keepStrokeScale ? distance : getScaledStroke(context, distance, context.dpr),
|
|
12232
12247
|
nextX = x + sign * d,
|
|
12233
12248
|
nextY = y + sign * d,
|
|
12234
12249
|
dw = 2 * d;
|
|
@@ -12358,9 +12373,8 @@ class DefaultImageRenderContribution extends DefaultRectRenderContribution {
|
|
|
12358
12373
|
constructor() {
|
|
12359
12374
|
super(...arguments), this.time = BaseRenderContributionTime.afterFillStroke, this.useStyle = !0, this.order = 0;
|
|
12360
12375
|
}
|
|
12361
|
-
drawShape(
|
|
12362
|
-
|
|
12363
|
-
image.renderFrame(context, x, y);
|
|
12376
|
+
drawShape(rect, context, x, y, doFill, doStroke, fVisible, sVisible, rectAttribute, drawContext, fillCb, strokeCb) {
|
|
12377
|
+
return super.drawShape(rect, context, x, y, doFill, doStroke, fVisible, sVisible, rectAttribute, drawContext, fillCb, strokeCb);
|
|
12364
12378
|
}
|
|
12365
12379
|
}
|
|
12366
12380
|
const defaultImageRenderContribution = new DefaultImageRenderContribution();
|
|
@@ -12386,14 +12400,15 @@ class DefaultSymbolRenderContribution {
|
|
|
12386
12400
|
x: originX = symbolAttribute.x,
|
|
12387
12401
|
y: originY = symbolAttribute.y,
|
|
12388
12402
|
scaleX = symbolAttribute.scaleX,
|
|
12389
|
-
scaleY = symbolAttribute.scaleY
|
|
12403
|
+
scaleY = symbolAttribute.scaleY,
|
|
12404
|
+
keepStrokeScale = symbolAttribute.keepStrokeScale
|
|
12390
12405
|
} = symbol.attribute,
|
|
12391
12406
|
renderBorder = (borderStyle, key) => {
|
|
12392
12407
|
const doStroke = !(!borderStyle || !borderStyle.stroke),
|
|
12393
12408
|
{
|
|
12394
12409
|
distance = symbolAttribute[key].distance
|
|
12395
12410
|
} = borderStyle,
|
|
12396
|
-
d = getScaledStroke(context, distance, context.dpr),
|
|
12411
|
+
d = keepStrokeScale ? distance : getScaledStroke(context, distance, context.dpr),
|
|
12397
12412
|
sign = "outerBorder" === key ? 1 : -1;
|
|
12398
12413
|
if (context.beginPath(), !1 === parsedPath.drawOffset(context, size, x, y, sign * d) && context.closePath(), context.setShadowBlendStyle && context.setShadowBlendStyle(symbol, symbol.attribute, symbolAttribute), strokeCb) strokeCb(context, borderStyle, symbolAttribute[key]);else if (doStroke) {
|
|
12399
12414
|
const lastOpacity = symbolAttribute[key].opacity;
|
|
@@ -14110,12 +14125,10 @@ let DefaultCanvasImageRender = class extends BaseRender {
|
|
|
14110
14125
|
const {
|
|
14111
14126
|
image: url
|
|
14112
14127
|
} = image.attribute;
|
|
14113
|
-
if (!image.
|
|
14114
|
-
|
|
14115
|
-
|
|
14116
|
-
|
|
14117
|
-
if ("success" !== res.state) return;
|
|
14118
|
-
}
|
|
14128
|
+
if (!url || !image.resources) return;
|
|
14129
|
+
const res = image.resources.get(url);
|
|
14130
|
+
if ("loading" === res.state && isString$1(url)) return void ResourceLoader.improveImageLoading(url);
|
|
14131
|
+
if ("success" !== res.state) return;
|
|
14119
14132
|
const {
|
|
14120
14133
|
context: context
|
|
14121
14134
|
} = renderService.drawParams;
|
|
@@ -15243,6 +15256,9 @@ class BaseSymbol {
|
|
|
15243
15256
|
bounds.x1 = -halfS, bounds.x2 = halfS, bounds.y1 = -halfS, bounds.y2 = halfS;
|
|
15244
15257
|
} else bounds.x1 = -size[0] / 2, bounds.x2 = size[0] / 2, bounds.y1 = -size[1] / 2, bounds.y2 = size[1] / 2;
|
|
15245
15258
|
}
|
|
15259
|
+
parseSize(size) {
|
|
15260
|
+
return isNumber$1(size) ? size : Math.min(size[0], size[1]);
|
|
15261
|
+
}
|
|
15246
15262
|
}
|
|
15247
15263
|
|
|
15248
15264
|
function circle(ctx, r, x, y, z) {
|
|
@@ -15253,13 +15269,13 @@ class CircleSymbol extends BaseSymbol {
|
|
|
15253
15269
|
super(...arguments), this.type = "circle", this.pathStr = "M0.5,0A0.5,0.5,0,1,1,-0.5,0A0.5,0.5,0,1,1,0.5,0";
|
|
15254
15270
|
}
|
|
15255
15271
|
draw(ctx, size, x, y, z) {
|
|
15256
|
-
return circle(ctx, size / 2, x, y, z);
|
|
15272
|
+
return circle(ctx, this.parseSize(size) / 2, x, y, z);
|
|
15257
15273
|
}
|
|
15258
15274
|
drawOffset(ctx, size, x, y, offset, z) {
|
|
15259
|
-
return circle(ctx, size / 2 + offset, x, y, z);
|
|
15275
|
+
return circle(ctx, this.parseSize(size) / 2 + offset, x, y, z);
|
|
15260
15276
|
}
|
|
15261
15277
|
drawToSvgPath(size, x, y, z) {
|
|
15262
|
-
const r = size / 2;
|
|
15278
|
+
const r = this.parseSize(size) / 2;
|
|
15263
15279
|
return `M ${x - r}, ${y} a ${r},${r} 0 1,0 ${2 * r},0 a ${r},${r} 0 1,0 -${2 * r},0`;
|
|
15264
15280
|
}
|
|
15265
15281
|
}
|
|
@@ -15276,10 +15292,10 @@ class CrossSymbol extends BaseSymbol {
|
|
|
15276
15292
|
super(...arguments), this.type = "cross", this.pathStr = "M-0.5,-0.2L-0.5,0.2L-0.2,0.2L-0.2,0.5L0.2,0.5L0.2,0.2L0.5,0.2L0.5,-0.2L0.2,-0.2L0.2,-0.5L-0.2,-0.5L-0.2,-0.2Z";
|
|
15277
15293
|
}
|
|
15278
15294
|
draw(ctx, size, x, y, z) {
|
|
15279
|
-
return cross(ctx, size / 6, x, y, z);
|
|
15295
|
+
return cross(ctx, this.parseSize(size) / 6, x, y, z);
|
|
15280
15296
|
}
|
|
15281
15297
|
drawOffset(ctx, size, x, y, offset, z) {
|
|
15282
|
-
return crossOffset(ctx, size / 6, x, y, offset, z);
|
|
15298
|
+
return crossOffset(ctx, this.parseSize(size) / 6, x, y, offset, z);
|
|
15283
15299
|
}
|
|
15284
15300
|
}
|
|
15285
15301
|
var cross$1 = new CrossSymbol();
|
|
@@ -15292,13 +15308,13 @@ class DiamondSymbol extends BaseSymbol {
|
|
|
15292
15308
|
super(...arguments), this.type = "diamond", this.pathStr = "M-0.5,0L0,-0.5L0.5,0L0,0.5Z";
|
|
15293
15309
|
}
|
|
15294
15310
|
draw(ctx, size, x, y, z) {
|
|
15295
|
-
return diamond(ctx, size / 2, x, y, z);
|
|
15311
|
+
return diamond(ctx, this.parseSize(size) / 2, x, y, z);
|
|
15296
15312
|
}
|
|
15297
15313
|
drawFitDir(ctx, size, x, y, z) {
|
|
15298
|
-
return diamond(ctx, size / 2, x, y, z);
|
|
15314
|
+
return diamond(ctx, this.parseSize(size) / 2, x, y, z);
|
|
15299
15315
|
}
|
|
15300
15316
|
drawOffset(ctx, size, x, y, offset, z) {
|
|
15301
|
-
return diamond(ctx, size / 2 + offset, x, y, z);
|
|
15317
|
+
return diamond(ctx, this.parseSize(size) / 2 + offset, x, y, z);
|
|
15302
15318
|
}
|
|
15303
15319
|
}
|
|
15304
15320
|
var diamond$1 = new DiamondSymbol();
|
|
@@ -15312,10 +15328,10 @@ class SquareSymbol extends BaseSymbol {
|
|
|
15312
15328
|
super(...arguments), this.type = "square", this.pathStr = "M-0.5,-0.5h1v1h-1Z";
|
|
15313
15329
|
}
|
|
15314
15330
|
draw(ctx, size, x, y) {
|
|
15315
|
-
return square(ctx, size / 2, x, y);
|
|
15331
|
+
return square(ctx, this.parseSize(size) / 2, x, y);
|
|
15316
15332
|
}
|
|
15317
15333
|
drawOffset(ctx, size, x, y, offset) {
|
|
15318
|
-
return square(ctx, size / 2 + offset, x, y);
|
|
15334
|
+
return square(ctx, this.parseSize(size) / 2 + offset, x, y);
|
|
15319
15335
|
}
|
|
15320
15336
|
}
|
|
15321
15337
|
var square$1 = new SquareSymbol();
|
|
@@ -15329,10 +15345,10 @@ class TriangleUpSymbol extends BaseSymbol {
|
|
|
15329
15345
|
super(...arguments), this.type = "triangleUp", this.pathStr = "M0.5,0.5 L-0.5,0.5 L0,-0.5 Z";
|
|
15330
15346
|
}
|
|
15331
15347
|
draw(ctx, size, x, y) {
|
|
15332
|
-
return trianglUpOffset(ctx, size / 2, x, y);
|
|
15348
|
+
return trianglUpOffset(ctx, this.parseSize(size) / 2, x, y);
|
|
15333
15349
|
}
|
|
15334
15350
|
drawOffset(ctx, size, x, y, offset) {
|
|
15335
|
-
return trianglUpOffset(ctx, size / 2, x, y, offset);
|
|
15351
|
+
return trianglUpOffset(ctx, this.parseSize(size) / 2, x, y, offset);
|
|
15336
15352
|
}
|
|
15337
15353
|
}
|
|
15338
15354
|
var triangleUp = new TriangleUpSymbol();
|
|
@@ -15364,10 +15380,10 @@ class StarSymbol extends BaseSymbol {
|
|
|
15364
15380
|
super(...arguments), this.type = "star", this.pathStr = "M0 -1L0.22451398828979266 -0.3090169943749474L0.9510565162951535 -0.30901699437494745L0.3632712640026804 0.1180339887498948L0.5877852522924732 0.8090169943749473L8.326672684688674e-17 0.3819660112501051L-0.587785252292473 0.8090169943749476L-0.3632712640026804 0.11803398874989487L-0.9510565162951536 -0.30901699437494723L-0.22451398828979274 -0.30901699437494734Z";
|
|
15365
15381
|
}
|
|
15366
15382
|
draw(ctx, size, transX, transY) {
|
|
15367
|
-
return star(ctx, size / 2, transX, transY);
|
|
15383
|
+
return star(ctx, this.parseSize(size) / 2, transX, transY);
|
|
15368
15384
|
}
|
|
15369
15385
|
drawOffset(ctx, size, transX, transY, offset) {
|
|
15370
|
-
return star(ctx, size / 2 + offset, transX, transY);
|
|
15386
|
+
return star(ctx, this.parseSize(size) / 2 + offset, transX, transY);
|
|
15371
15387
|
}
|
|
15372
15388
|
}
|
|
15373
15389
|
var star$1 = new StarSymbol();
|
|
@@ -15385,10 +15401,10 @@ class ArrowSymbol extends BaseSymbol {
|
|
|
15385
15401
|
super(...arguments), this.type = "arrow", this.pathStr = "M-0.07142857142857142,0.5L0.07142857142857142,0.5L0.07142857142857142,-0.0625L0.2,-0.0625L0,-0.5L-0.2,-0.0625L-0.07142857142857142,-0.0625Z";
|
|
15386
15402
|
}
|
|
15387
15403
|
draw(ctx, size, transX, transY) {
|
|
15388
|
-
return arrow(ctx, size / 2, transX, transY);
|
|
15404
|
+
return arrow(ctx, this.parseSize(size) / 2, transX, transY);
|
|
15389
15405
|
}
|
|
15390
15406
|
drawOffset(ctx, size, transX, transY, offset) {
|
|
15391
|
-
return arrow(ctx, size / 2 + offset, transX, transY);
|
|
15407
|
+
return arrow(ctx, this.parseSize(size) / 2 + offset, transX, transY);
|
|
15392
15408
|
}
|
|
15393
15409
|
}
|
|
15394
15410
|
var arrow$1 = new ArrowSymbol();
|
|
@@ -15402,10 +15418,10 @@ class WedgeSymbol extends BaseSymbol {
|
|
|
15402
15418
|
super(...arguments), this.type = "wedge", this.pathStr = "M0,-0.5773502691896257L-0.125,0.28867513459481287L0.125,0.28867513459481287Z";
|
|
15403
15419
|
}
|
|
15404
15420
|
draw(ctx, size, transX, transY) {
|
|
15405
|
-
return wedge(ctx, size / 2, transX, transY);
|
|
15421
|
+
return wedge(ctx, this.parseSize(size) / 2, transX, transY);
|
|
15406
15422
|
}
|
|
15407
15423
|
drawOffset(ctx, size, transX, transY, offset) {
|
|
15408
|
-
return wedge(ctx, size / 2 + offset, transX, transY);
|
|
15424
|
+
return wedge(ctx, this.parseSize(size) / 2 + offset, transX, transY);
|
|
15409
15425
|
}
|
|
15410
15426
|
}
|
|
15411
15427
|
var wedge$1 = new WedgeSymbol();
|
|
@@ -15418,10 +15434,10 @@ class StrokeSymbol extends BaseSymbol {
|
|
|
15418
15434
|
super(...arguments), this.type = "stroke", this.pathStr = "";
|
|
15419
15435
|
}
|
|
15420
15436
|
draw(ctx, size, transX, transY) {
|
|
15421
|
-
return stroke(ctx, size / 2, transX, transY);
|
|
15437
|
+
return stroke(ctx, this.parseSize(size) / 2, transX, transY);
|
|
15422
15438
|
}
|
|
15423
15439
|
drawOffset(ctx, size, transX, transY, offset) {
|
|
15424
|
-
return stroke(ctx, size / 2 + offset, transX, transY);
|
|
15440
|
+
return stroke(ctx, this.parseSize(size) / 2 + offset, transX, transY);
|
|
15425
15441
|
}
|
|
15426
15442
|
}
|
|
15427
15443
|
var stroke$1 = new StrokeSymbol();
|
|
@@ -15443,10 +15459,10 @@ class WyeSymbol extends BaseSymbol {
|
|
|
15443
15459
|
super(...arguments), this.type = "wye", this.pathStr = "M0.25 0.14433756729740646L0.25 0.6443375672974064L-0.25 0.6443375672974064L-0.25 0.14433756729740643L-0.6830127018922193 -0.10566243270259357L-0.4330127018922193 -0.5386751345948129L0 -0.28867513459481287L0.4330127018922193 -0.5386751345948129L0.6830127018922193 -0.10566243270259357Z";
|
|
15444
15460
|
}
|
|
15445
15461
|
draw(ctx, size, transX, transY) {
|
|
15446
|
-
return wye(ctx, size / 2, transX, transY);
|
|
15462
|
+
return wye(ctx, this.parseSize(size) / 2, transX, transY);
|
|
15447
15463
|
}
|
|
15448
15464
|
drawOffset(ctx, size, transX, transY, offset) {
|
|
15449
|
-
return wye(ctx, size / 2 + offset, transX, transY);
|
|
15465
|
+
return wye(ctx, this.parseSize(size) / 2 + offset, transX, transY);
|
|
15450
15466
|
}
|
|
15451
15467
|
}
|
|
15452
15468
|
var wye$1 = new WyeSymbol();
|
|
@@ -15459,10 +15475,10 @@ class TriangleLeftSymbol extends BaseSymbol {
|
|
|
15459
15475
|
super(...arguments), this.type = "triangleLeft", this.pathStr = "M-0.5,0 L0.5,0.5 L0.5,-0.5 Z";
|
|
15460
15476
|
}
|
|
15461
15477
|
draw(ctx, size, x, y) {
|
|
15462
|
-
return trianglLeftOffset(ctx, size / 2, x, y, 0);
|
|
15478
|
+
return trianglLeftOffset(ctx, this.parseSize(size) / 2, x, y, 0);
|
|
15463
15479
|
}
|
|
15464
15480
|
drawOffset(ctx, size, x, y, offset) {
|
|
15465
|
-
return trianglLeftOffset(ctx, size / 2, x, y, offset);
|
|
15481
|
+
return trianglLeftOffset(ctx, this.parseSize(size) / 2, x, y, offset);
|
|
15466
15482
|
}
|
|
15467
15483
|
}
|
|
15468
15484
|
var triangleLeft = new TriangleLeftSymbol();
|
|
@@ -15476,10 +15492,10 @@ class TriangleRightSymbol extends BaseSymbol {
|
|
|
15476
15492
|
super(...arguments), this.type = "triangleRight", this.pathStr = "M-0.5,0.5 L0.5,0 L-0.5,-0.5 Z";
|
|
15477
15493
|
}
|
|
15478
15494
|
draw(ctx, size, x, y) {
|
|
15479
|
-
return trianglRightOffset(ctx, size / 2, x, y);
|
|
15495
|
+
return trianglRightOffset(ctx, this.parseSize(size) / 2, x, y);
|
|
15480
15496
|
}
|
|
15481
15497
|
drawOffset(ctx, size, x, y, offset) {
|
|
15482
|
-
return trianglRightOffset(ctx, size / 2, x, y, offset);
|
|
15498
|
+
return trianglRightOffset(ctx, this.parseSize(size) / 2, x, y, offset);
|
|
15483
15499
|
}
|
|
15484
15500
|
}
|
|
15485
15501
|
var triangleRight = new TriangleRightSymbol();
|
|
@@ -15493,10 +15509,10 @@ class TriangleDownSymbol extends BaseSymbol {
|
|
|
15493
15509
|
super(...arguments), this.type = "triangleDown", this.pathStr = "M-0.5,-0.5 L0.5,-0.5 L0,0.5 Z";
|
|
15494
15510
|
}
|
|
15495
15511
|
draw(ctx, size, x, y) {
|
|
15496
|
-
return trianglDownOffset(ctx, size / 2, x, y);
|
|
15512
|
+
return trianglDownOffset(ctx, this.parseSize(size) / 2, x, y);
|
|
15497
15513
|
}
|
|
15498
15514
|
drawOffset(ctx, size, x, y, offset) {
|
|
15499
|
-
return trianglDownOffset(ctx, size / 2, x, y, offset);
|
|
15515
|
+
return trianglDownOffset(ctx, this.parseSize(size) / 2, x, y, offset);
|
|
15500
15516
|
}
|
|
15501
15517
|
}
|
|
15502
15518
|
var triangleDown = new TriangleDownSymbol();
|
|
@@ -15511,10 +15527,10 @@ class ThinTriangleSymbol extends BaseSymbol {
|
|
|
15511
15527
|
super(...arguments), this.type = "thinTriangle", this.pathStr = "M0,-0.5773502691896257L-0.5,0.28867513459481287L0.5,0.28867513459481287Z";
|
|
15512
15528
|
}
|
|
15513
15529
|
draw(ctx, size, x, y) {
|
|
15514
|
-
return thinTriangle(ctx, size / 2 / sqrt3, x, y);
|
|
15530
|
+
return thinTriangle(ctx, this.parseSize(size) / 2 / sqrt3, x, y);
|
|
15515
15531
|
}
|
|
15516
15532
|
drawOffset(ctx, size, x, y, offset) {
|
|
15517
|
-
return thinTriangle(ctx, size / 2 / sqrt3 + offset, x, y);
|
|
15533
|
+
return thinTriangle(ctx, this.parseSize(size) / 2 / sqrt3 + offset, x, y);
|
|
15518
15534
|
}
|
|
15519
15535
|
}
|
|
15520
15536
|
var thinTriangle$1 = new ThinTriangleSymbol();
|
|
@@ -15528,10 +15544,10 @@ class Arrow2LeftSymbol extends BaseSymbol {
|
|
|
15528
15544
|
super(...arguments), this.type = "arrow2Left", this.pathStr = "M 0.25 -0.5 L -0.25 0 l 0.25 0.5";
|
|
15529
15545
|
}
|
|
15530
15546
|
draw(ctx, size, transX, transY) {
|
|
15531
|
-
return arrow2Left(ctx, size / 4, transX, transY);
|
|
15547
|
+
return arrow2Left(ctx, this.parseSize(size) / 4, transX, transY);
|
|
15532
15548
|
}
|
|
15533
15549
|
drawOffset(ctx, size, transX, transY, offset) {
|
|
15534
|
-
return arrow2Left(ctx, size / 4 + offset, transX, transY);
|
|
15550
|
+
return arrow2Left(ctx, this.parseSize(size) / 4 + offset, transX, transY);
|
|
15535
15551
|
}
|
|
15536
15552
|
}
|
|
15537
15553
|
var arrow2Left$1 = new Arrow2LeftSymbol();
|
|
@@ -15545,10 +15561,10 @@ class Arrow2RightSymbol extends BaseSymbol {
|
|
|
15545
15561
|
super(...arguments), this.type = "arrow2Right", this.pathStr = "M -0.25 -0.5 l 0.25 0 l -0.25 0.5";
|
|
15546
15562
|
}
|
|
15547
15563
|
draw(ctx, size, transX, transY) {
|
|
15548
|
-
return arrow2Right(ctx, size / 4, transX, transY);
|
|
15564
|
+
return arrow2Right(ctx, this.parseSize(size) / 4, transX, transY);
|
|
15549
15565
|
}
|
|
15550
15566
|
drawOffset(ctx, size, transX, transY, offset) {
|
|
15551
|
-
return arrow2Right(ctx, size / 4 + offset, transX, transY);
|
|
15567
|
+
return arrow2Right(ctx, this.parseSize(size) / 4 + offset, transX, transY);
|
|
15552
15568
|
}
|
|
15553
15569
|
}
|
|
15554
15570
|
var arrow2Right$1 = new Arrow2RightSymbol();
|
|
@@ -15562,10 +15578,10 @@ class Arrow2UpSymbol extends BaseSymbol {
|
|
|
15562
15578
|
super(...arguments), this.type = "arrow2Up", this.pathStr = "M -0.5 0.25 L 0 -0.25 l 0.5 0.25";
|
|
15563
15579
|
}
|
|
15564
15580
|
draw(ctx, size, transX, transY) {
|
|
15565
|
-
return arrow2Up(ctx, size / 4, transX, transY);
|
|
15581
|
+
return arrow2Up(ctx, this.parseSize(size) / 4, transX, transY);
|
|
15566
15582
|
}
|
|
15567
15583
|
drawOffset(ctx, size, transX, transY, offset) {
|
|
15568
|
-
return arrow2Up(ctx, size / 4 + offset, transX, transY);
|
|
15584
|
+
return arrow2Up(ctx, this.parseSize(size) / 4 + offset, transX, transY);
|
|
15569
15585
|
}
|
|
15570
15586
|
}
|
|
15571
15587
|
var arrow2Up$1 = new Arrow2UpSymbol();
|
|
@@ -15579,10 +15595,10 @@ class Arrow2DownSymbol extends BaseSymbol {
|
|
|
15579
15595
|
super(...arguments), this.type = "arrow2Down", this.pathStr = "M -0.5 -0.25 L 0 0.25 l 0.5 -0.25";
|
|
15580
15596
|
}
|
|
15581
15597
|
draw(ctx, size, transX, transY) {
|
|
15582
|
-
return arrow2Down(ctx, size / 4, transX, transY);
|
|
15598
|
+
return arrow2Down(ctx, this.parseSize(size) / 4, transX, transY);
|
|
15583
15599
|
}
|
|
15584
15600
|
drawOffset(ctx, size, transX, transY, offset) {
|
|
15585
|
-
return arrow2Down(ctx, size / 4 + offset, transX, transY);
|
|
15601
|
+
return arrow2Down(ctx, this.parseSize(size) / 4 + offset, transX, transY);
|
|
15586
15602
|
}
|
|
15587
15603
|
}
|
|
15588
15604
|
var arrow2Down$1 = new Arrow2DownSymbol();
|
|
@@ -15595,13 +15611,13 @@ class LineVSymbol extends BaseSymbol {
|
|
|
15595
15611
|
super(...arguments), this.type = "lineV", this.pathStr = "M0,-0.5L0,0.5";
|
|
15596
15612
|
}
|
|
15597
15613
|
draw(ctx, size, x, y, z) {
|
|
15598
|
-
return lineV(ctx, size / 2, x, y);
|
|
15614
|
+
return lineV(ctx, this.parseSize(size) / 2, x, y);
|
|
15599
15615
|
}
|
|
15600
15616
|
drawOffset(ctx, size, x, y, offset, z) {
|
|
15601
|
-
return lineV(ctx, size / 2 + offset, x, y);
|
|
15617
|
+
return lineV(ctx, this.parseSize(size) / 2 + offset, x, y);
|
|
15602
15618
|
}
|
|
15603
15619
|
drawToSvgPath(size, x, y, z) {
|
|
15604
|
-
const r = size / 2;
|
|
15620
|
+
const r = this.parseSize(size) / 2;
|
|
15605
15621
|
return `M ${x}, ${y - r} L ${x},${y + r}`;
|
|
15606
15622
|
}
|
|
15607
15623
|
}
|
|
@@ -15615,13 +15631,13 @@ class LineHSymbol extends BaseSymbol {
|
|
|
15615
15631
|
super(...arguments), this.type = "lineH", this.pathStr = "M-0.5,0L0.5,0";
|
|
15616
15632
|
}
|
|
15617
15633
|
draw(ctx, size, x, y, z) {
|
|
15618
|
-
return lineH(ctx, size / 2, x, y);
|
|
15634
|
+
return lineH(ctx, this.parseSize(size) / 2, x, y);
|
|
15619
15635
|
}
|
|
15620
15636
|
drawOffset(ctx, size, x, y, offset, z) {
|
|
15621
|
-
return lineH(ctx, size / 2 + offset, x, y);
|
|
15637
|
+
return lineH(ctx, this.parseSize(size) / 2 + offset, x, y);
|
|
15622
15638
|
}
|
|
15623
15639
|
drawToSvgPath(size, x, y, z) {
|
|
15624
|
-
const r = size / 2;
|
|
15640
|
+
const r = this.parseSize(size) / 2;
|
|
15625
15641
|
return `M ${x - r}, ${y} L ${x + r},${y}`;
|
|
15626
15642
|
}
|
|
15627
15643
|
}
|
|
@@ -15635,13 +15651,13 @@ class CloseSymbol extends BaseSymbol {
|
|
|
15635
15651
|
super(...arguments), this.type = "close", this.pathStr = "M-0.5,-0.5L0.5,0.5,M0.5,-0.5L-0.5,0.5";
|
|
15636
15652
|
}
|
|
15637
15653
|
draw(ctx, size, x, y, z) {
|
|
15638
|
-
return close(ctx, size / 2, x, y);
|
|
15654
|
+
return close(ctx, this.parseSize(size) / 2, x, y);
|
|
15639
15655
|
}
|
|
15640
15656
|
drawOffset(ctx, size, x, y, offset, z) {
|
|
15641
|
-
return close(ctx, size / 2 + offset, x, y);
|
|
15657
|
+
return close(ctx, this.parseSize(size) / 2 + offset, x, y);
|
|
15642
15658
|
}
|
|
15643
15659
|
drawToSvgPath(size, x, y, z) {
|
|
15644
|
-
const r = size / 2;
|
|
15660
|
+
const r = this.parseSize(size) / 2;
|
|
15645
15661
|
return `M ${x - r}, ${y - r} L ${x + r},${y + r} M ${x + r}, ${y - r} L ${x - r},${y + r}`;
|
|
15646
15662
|
}
|
|
15647
15663
|
}
|
|
@@ -15675,15 +15691,18 @@ class CustomSymbolClass {
|
|
|
15675
15691
|
this.pathStr = "", this.type = type, isArray$1(path) ? this.svgCache = path : this.path = path, this.isSvg = isSvg;
|
|
15676
15692
|
}
|
|
15677
15693
|
drawOffset(ctx, size, x, y, offset, z, cb) {
|
|
15678
|
-
return this.isSvg ? !!this.svgCache && (this.svgCache.forEach(item => {
|
|
15694
|
+
return size = this.parseSize(size), this.isSvg ? !!this.svgCache && (this.svgCache.forEach(item => {
|
|
15679
15695
|
ctx.beginPath(), renderCommandList(item.path.commandList, ctx, x, y, size, size), cb && cb(item.path, item.attribute);
|
|
15680
15696
|
}), !1) : (renderCommandList(this.path.commandList, ctx, x, y, size + offset, size + offset), !1);
|
|
15681
15697
|
}
|
|
15682
15698
|
draw(ctx, size, x, y, z, cb) {
|
|
15683
|
-
return this.drawOffset(ctx, size, x, y, 0, z, cb);
|
|
15699
|
+
return size = this.parseSize(size), this.drawOffset(ctx, size, x, y, 0, z, cb);
|
|
15700
|
+
}
|
|
15701
|
+
parseSize(size) {
|
|
15702
|
+
return isNumber$1(size) ? size : Math.min(size[0], size[1]);
|
|
15684
15703
|
}
|
|
15685
15704
|
bounds(size, bounds) {
|
|
15686
|
-
if (this.isSvg) {
|
|
15705
|
+
if (size = this.parseSize(size), this.isSvg) {
|
|
15687
15706
|
if (!this.svgCache) return;
|
|
15688
15707
|
return bounds.clear(), void this.svgCache.forEach(_ref => {
|
|
15689
15708
|
let {
|
|
@@ -16366,7 +16385,11 @@ class Paragraph {
|
|
|
16366
16385
|
case "sub":
|
|
16367
16386
|
baseline += this.descent / 2;
|
|
16368
16387
|
}
|
|
16369
|
-
"vertical" === direction && (ctx.save(), ctx.rotateAbout(Math.PI / 2, left, baseline), ctx.translate(-this.heightOrigin || -this.lineHeight / 2, -this.descent / 2), ctx.translate(left, baseline), left = 0, baseline = 0)
|
|
16388
|
+
"vertical" === direction && (ctx.save(), ctx.rotateAbout(Math.PI / 2, left, baseline), ctx.translate(-this.heightOrigin || -this.lineHeight / 2, -this.descent / 2), ctx.translate(left, baseline), left = 0, baseline = 0);
|
|
16389
|
+
const {
|
|
16390
|
+
lineWidth = 1
|
|
16391
|
+
} = this.character;
|
|
16392
|
+
this.character.stroke && lineWidth && (applyStrokeStyle(ctx, this.character), ctx.strokeText(text, left, baseline)), applyFillStyle(ctx, this.character), this.character.fill && ctx.fillText(text, left, baseline), this.character.fill && ("boolean" == typeof this.character.lineThrough || "boolean" == typeof this.character.underline ? (this.character.underline && ctx.fillRect(left, 1 + baseline, this.widthOrigin || this.width, this.character.fontSize ? Math.max(1, Math.floor(this.character.fontSize / 10)) : 1), this.character.lineThrough && ctx.fillRect(left, 1 + baseline - this.ascent / 2, this.widthOrigin || this.width, this.character.fontSize ? Math.max(1, Math.floor(this.character.fontSize / 10)) : 1)) : "underline" === this.character.textDecoration ? ctx.fillRect(left, 1 + baseline, this.widthOrigin || this.width, this.character.fontSize ? Math.max(1, Math.floor(this.character.fontSize / 10)) : 1) : "line-through" === this.character.textDecoration && ctx.fillRect(left, 1 + baseline - this.ascent / 2, this.widthOrigin || this.width, this.character.fontSize ? Math.max(1, Math.floor(this.character.fontSize / 10)) : 1)), "vertical" === direction && ctx.restore();
|
|
16370
16393
|
}
|
|
16371
16394
|
getWidthWithEllips(direction) {
|
|
16372
16395
|
let text = this.text;
|
|
@@ -18583,7 +18606,7 @@ class Stage extends Group {
|
|
|
18583
18606
|
constructor() {
|
|
18584
18607
|
let params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
18585
18608
|
var _a;
|
|
18586
|
-
super({}), this._onVisibleChange = visible => {
|
|
18609
|
+
super({}), this.tickedBeforeRender = !0, this._onVisibleChange = visible => {
|
|
18587
18610
|
if (!(this._skipRender < 0)) if (visible) {
|
|
18588
18611
|
if (this.dirtyBounds) {
|
|
18589
18612
|
const b = this.window.getViewBox();
|
|
@@ -18594,7 +18617,10 @@ class Stage extends Group {
|
|
|
18594
18617
|
}, this.beforeRender = stage => {
|
|
18595
18618
|
this._beforeRender && this._beforeRender(stage);
|
|
18596
18619
|
}, this.afterRender = stage => {
|
|
18597
|
-
this.renderCount++, this._afterRender && this._afterRender(stage), this._afterNextRenderCbs && this._afterNextRenderCbs.forEach(cb => cb(stage)), this._afterNextRenderCbs = null;
|
|
18620
|
+
this.renderCount++, this._afterRender && this._afterRender(stage), this._afterNextRenderCbs && this._afterNextRenderCbs.forEach(cb => cb(stage)), this._afterNextRenderCbs = null, this.tickedBeforeRender = !1;
|
|
18621
|
+
}, this.afterTickCb = () => {
|
|
18622
|
+
var _a;
|
|
18623
|
+
this.tickedBeforeRender = !0, "performance" === (null === (_a = this.params.optimize) || void 0 === _a ? void 0 : _a.tickRenderMode) || "rendering" !== this.state && this.render();
|
|
18598
18624
|
}, this.params = params, this.theme = new Theme(), this.hooks = {
|
|
18599
18625
|
beforeRender: new SyncHook(["stage"]),
|
|
18600
18626
|
afterRender: new SyncHook(["stage"])
|
|
@@ -18611,7 +18637,7 @@ class Stage extends Group {
|
|
|
18611
18637
|
main: !0
|
|
18612
18638
|
})), this.nextFrameRenderLayerSet = new Set(), this.willNextFrameRender = !1, this.stage = this, this.renderStyle = params.renderStyle, params.autoRender && this.enableAutoRender(), params.autoRefresh && this.enableAutoRefresh(), !1 === params.disableDirtyBounds && this.enableDirtyBounds(), params.enableHtmlAttribute && this.enableHtmlAttribute(params.enableHtmlAttribute), params.ReactDOM && this.enableReactAttribute(params.ReactDOM), params.enableLayout && this.enableLayout(), this.hooks.beforeRender.tap("constructor", this.beforeRender), this.hooks.afterRender.tap("constructor", this.afterRender), this._beforeRender = params.beforeRender, this._afterRender = params.afterRender, this.ticker = params.ticker || defaultTicker, this.supportInteractiveLayer = !1 !== params.interactiveLayer, this.timeline = new DefaultTimeline(), this.ticker.addTimeline(this.timeline), this.timeline.pause(), params.optimize || (params.optimize = {}), this.optmize(params.optimize), params.background && isString$1(this._background) && this._background.includes("/") && this.setAttributes({
|
|
18613
18639
|
background: this._background
|
|
18614
|
-
});
|
|
18640
|
+
}), this.ticker.on("afterTick", this.afterTickCb);
|
|
18615
18641
|
}
|
|
18616
18642
|
pauseRender() {
|
|
18617
18643
|
let sr = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : -1;
|
|
@@ -18840,7 +18866,7 @@ class Stage extends Group {
|
|
|
18840
18866
|
if ("released" === this.releaseStatus) return;
|
|
18841
18867
|
this.ticker.start(), this.timeline.resume();
|
|
18842
18868
|
const state = this.state;
|
|
18843
|
-
this.state = "rendering", this.layerService.prepareStageLayer(this), this._skipRender || (this.lastRenderparams = params, this.hooks.beforeRender.call(this), this._skipRender || (this.renderLayerList(this.children), this.combineLayersToWindow(), this.nextFrameRenderLayerSet.clear()), this.hooks.afterRender.call(this)), this.state = state, this._skipRender && this._skipRender++;
|
|
18869
|
+
this.state = "rendering", this.tickedBeforeRender || this.ticker.trySyncTickStatus(), this.layerService.prepareStageLayer(this), this._skipRender || (this.lastRenderparams = params, this.hooks.beforeRender.call(this), this._skipRender || (this.renderLayerList(this.children), this.combineLayersToWindow(), this.nextFrameRenderLayerSet.clear()), this.hooks.afterRender.call(this)), this.state = state, this._skipRender && this._skipRender++;
|
|
18844
18870
|
}
|
|
18845
18871
|
combineLayersToWindow() {
|
|
18846
18872
|
if ("harmony" === this.global.env) {
|
|
@@ -18946,7 +18972,7 @@ class Stage extends Group {
|
|
|
18946
18972
|
layer.release();
|
|
18947
18973
|
}), this.interactiveLayer && (this.interactiveLayer.forEachChildren(item => {
|
|
18948
18974
|
item.setStage && item.setStage(null, null), this.interactiveLayer.removeChild(item);
|
|
18949
|
-
}), this.interactiveLayer.release()), this.window.release(), this.ticker.remTimeline(this.timeline), this.renderService.renderTreeRoots = [];
|
|
18975
|
+
}), this.interactiveLayer.release()), this.window.release(), this.ticker.remTimeline(this.timeline), this.ticker.removeListener("afterTick", this.afterTickCb), this.renderService.renderTreeRoots = [];
|
|
18950
18976
|
}
|
|
18951
18977
|
setStage(stage) {}
|
|
18952
18978
|
dirty(b, matrix) {
|
|
@@ -23646,11 +23672,9 @@ function jsx(type, config) {
|
|
|
23646
23672
|
name: name,
|
|
23647
23673
|
id: id,
|
|
23648
23674
|
attribute: attribute,
|
|
23649
|
-
stateProxy: stateProxy
|
|
23650
|
-
animation: animation,
|
|
23651
|
-
timeline: timeline
|
|
23675
|
+
stateProxy: stateProxy
|
|
23652
23676
|
} = _a,
|
|
23653
|
-
props = __rest(_a, ["key", "name", "id", "attribute", "stateProxy"
|
|
23677
|
+
props = __rest(_a, ["key", "name", "id", "attribute", "stateProxy"]);
|
|
23654
23678
|
let c = type;
|
|
23655
23679
|
isString$1(type) && (c = graphicCreator[type]);
|
|
23656
23680
|
const childrenList = [];
|
|
@@ -23659,13 +23683,7 @@ function jsx(type, config) {
|
|
|
23659
23683
|
}
|
|
23660
23684
|
children.length && flatten(1 === children.length ? children[0] : children, childrenList);
|
|
23661
23685
|
const g = "Group" === c.name ? new c(attribute) : c(config);
|
|
23662
|
-
|
|
23663
|
-
const animate = g.animate();
|
|
23664
|
-
timeline && animate.setTimeline(timeline), animation.forEach(item => {
|
|
23665
|
-
animate[item[0]](...item.slice(1));
|
|
23666
|
-
});
|
|
23667
|
-
}
|
|
23668
|
-
return g;
|
|
23686
|
+
return parseToGraphic$1(g, childrenList, props), stateProxy && (g.stateProxy = stateProxy), g;
|
|
23669
23687
|
}
|
|
23670
23688
|
function parseToGraphic$1(g, childrenList, props) {
|
|
23671
23689
|
let out,
|
|
@@ -23933,7 +23951,7 @@ class Gesture extends EventEmitter {
|
|
|
23933
23951
|
startTime: startTime,
|
|
23934
23952
|
startPoints: startPoints
|
|
23935
23953
|
} = this;
|
|
23936
|
-
if (eventType) return eventType;
|
|
23954
|
+
if ("press" === eventType) return eventType;
|
|
23937
23955
|
let type;
|
|
23938
23956
|
return type = clock.now() - startTime > this.config.press.time && calcDistance(startPoints[0], point) < this.config.press.threshold ? "press" : "pan", this.eventType = type, type;
|
|
23939
23957
|
}
|
|
@@ -24465,9 +24483,10 @@ let BrowserContext2d = class {
|
|
|
24465
24483
|
lineJoin = defaultParams.lineJoin,
|
|
24466
24484
|
lineDash = defaultParams.lineDash,
|
|
24467
24485
|
lineCap = defaultParams.lineCap,
|
|
24468
|
-
miterLimit = defaultParams.miterLimit
|
|
24486
|
+
miterLimit = defaultParams.miterLimit,
|
|
24487
|
+
keepStrokeScale = defaultParams.keepStrokeScale
|
|
24469
24488
|
} = attribute;
|
|
24470
|
-
_context.lineWidth = getScaledStroke(this, lineWidth, this.dpr), _context.strokeStyle = createColor(this, stroke, params, offsetX, offsetY), _context.lineJoin = lineJoin, lineDash && _context.setLineDash(lineDash), _context.lineCap = lineCap, _context.miterLimit = miterLimit;
|
|
24489
|
+
_context.lineWidth = keepStrokeScale ? lineWidth : getScaledStroke(this, lineWidth, this.dpr), _context.strokeStyle = createColor(this, stroke, params, offsetX, offsetY), _context.lineJoin = lineJoin, lineDash && _context.setLineDash(lineDash), _context.lineCap = lineCap, _context.miterLimit = miterLimit;
|
|
24471
24490
|
}
|
|
24472
24491
|
}
|
|
24473
24492
|
setTextStyleWithoutAlignBaseline(params, defaultParams, z) {
|
|
@@ -25367,8 +25386,9 @@ class PickerBase {
|
|
|
25367
25386
|
return this.canvasRenderer.drawShape(graphic, pickContext, x, y, {}, null, (context, arcAttribute, themeAttribute) => !!picked || (picked = context.isPointInPath(point.x, point.y), picked), (context, arcAttribute, themeAttribute) => {
|
|
25368
25387
|
if (picked) return !0;
|
|
25369
25388
|
const lineWidth = arcAttribute.lineWidth || themeAttribute.lineWidth,
|
|
25370
|
-
pickStrokeBuffer = arcAttribute.pickStrokeBuffer || themeAttribute.pickStrokeBuffer
|
|
25371
|
-
|
|
25389
|
+
pickStrokeBuffer = arcAttribute.pickStrokeBuffer || themeAttribute.pickStrokeBuffer,
|
|
25390
|
+
keepStrokeScale = arcAttribute.keepStrokeScale || themeAttribute.keepStrokeScale;
|
|
25391
|
+
return pickContext.lineWidth = keepStrokeScale ? lineWidth + pickStrokeBuffer : getScaledStroke(pickContext, lineWidth + pickStrokeBuffer, pickContext.dpr), picked = context.isPointInStroke(point.x, point.y), picked;
|
|
25372
25392
|
}), pickContext.highPerformanceRestore(), picked;
|
|
25373
25393
|
}
|
|
25374
25394
|
}
|
|
@@ -25641,8 +25661,9 @@ class RectPickerBase {
|
|
|
25641
25661
|
if (!onlyTranslate || rect.shadowRoot || isNumber$1(cornerRadius, !0) && 0 !== cornerRadius || isArray$1(cornerRadius) && cornerRadius.some(num => 0 !== num)) picked = !1, this.canvasRenderer.drawShape(rect, pickContext, x, y, {}, null, (context, rectAttribute, themeAttribute) => !!picked || (picked = context.isPointInPath(point.x, point.y), picked), (context, rectAttribute, themeAttribute) => {
|
|
25642
25662
|
if (picked) return !0;
|
|
25643
25663
|
const lineWidth = rectAttribute.lineWidth || themeAttribute.lineWidth,
|
|
25644
|
-
pickStrokeBuffer = rectAttribute.pickStrokeBuffer || themeAttribute.pickStrokeBuffer
|
|
25645
|
-
|
|
25664
|
+
pickStrokeBuffer = rectAttribute.pickStrokeBuffer || themeAttribute.pickStrokeBuffer,
|
|
25665
|
+
keepStrokeScale = rectAttribute.keepStrokeScale || themeAttribute.keepStrokeScale;
|
|
25666
|
+
return pickContext.lineWidth = keepStrokeScale ? lineWidth + pickStrokeBuffer : getScaledStroke(pickContext, lineWidth + pickStrokeBuffer, pickContext.dpr), picked = context.isPointInStroke(point.x, point.y), picked;
|
|
25646
25667
|
});else {
|
|
25647
25668
|
const {
|
|
25648
25669
|
fill = rectAttribute.fill,
|
|
@@ -25956,9 +25977,10 @@ let LynxContext2d = class extends BrowserContext2d {
|
|
|
25956
25977
|
lineJoin = defaultParams.lineJoin,
|
|
25957
25978
|
lineDash = defaultParams.lineDash,
|
|
25958
25979
|
lineCap = defaultParams.lineCap,
|
|
25959
|
-
miterLimit = defaultParams.miterLimit
|
|
25980
|
+
miterLimit = defaultParams.miterLimit,
|
|
25981
|
+
keepStrokeScale = defaultParams.keepStrokeScale
|
|
25960
25982
|
} = attribute;
|
|
25961
|
-
_context.globalAlpha = strokeOpacity * opacity * this.baseGlobalAlpha, _context.lineWidth = getScaledStroke(this, lineWidth, this.dpr), _context.strokeStyle = createColor(this, stroke, params, offsetX, offsetY), _context.lineJoin = lineJoin, 0 === lineDash[0] && 0 === lineDash[1] || lineDash && _context.setLineDash(lineDash), _context.lineCap = lineCap, _context.miterLimit = miterLimit;
|
|
25983
|
+
_context.globalAlpha = strokeOpacity * opacity * this.baseGlobalAlpha, _context.lineWidth = keepStrokeScale ? lineWidth : getScaledStroke(this, lineWidth, this.dpr), _context.strokeStyle = createColor(this, stroke, params, offsetX, offsetY), _context.lineJoin = lineJoin, 0 === lineDash[0] && 0 === lineDash[1] || lineDash && _context.setLineDash(lineDash), _context.lineCap = lineCap, _context.miterLimit = miterLimit;
|
|
25962
25984
|
}
|
|
25963
25985
|
}
|
|
25964
25986
|
measureText(text) {
|
|
@@ -26586,9 +26608,10 @@ let TaroContext2d = class extends BrowserContext2d {
|
|
|
26586
26608
|
lineJoin = defaultParams.lineJoin,
|
|
26587
26609
|
lineDash = defaultParams.lineDash,
|
|
26588
26610
|
lineCap = defaultParams.lineCap,
|
|
26589
|
-
miterLimit = defaultParams.miterLimit
|
|
26611
|
+
miterLimit = defaultParams.miterLimit,
|
|
26612
|
+
keepStrokeScale = defaultParams.keepStrokeScale
|
|
26590
26613
|
} = attribute;
|
|
26591
|
-
_context.setGlobalAlpha(strokeOpacity * opacity), _context.setLineWidth(getScaledStroke(this, lineWidth, this.dpr)), _context.setStrokeStyle(createColor(this, stroke, params, offsetX, offsetY)), _context.setLineJoin(lineJoin), lineDash && _context.setLineDash(lineDash), _context.setLineCap(lineCap), _context.setMiterLimit(miterLimit);
|
|
26614
|
+
_context.setGlobalAlpha(strokeOpacity * opacity), _context.setLineWidth(keepStrokeScale ? lineWidth : getScaledStroke(this, lineWidth, this.dpr)), _context.setStrokeStyle(createColor(this, stroke, params, offsetX, offsetY)), _context.setLineJoin(lineJoin), lineDash && _context.setLineDash(lineDash), _context.setLineCap(lineCap), _context.setMiterLimit(miterLimit);
|
|
26592
26615
|
}
|
|
26593
26616
|
}
|
|
26594
26617
|
setTextStyleWithoutAlignBaseline(params, defaultParams) {
|
|
@@ -27628,9 +27651,10 @@ let HarmonyContext2d = class extends BrowserContext2d {
|
|
|
27628
27651
|
lineJoin = defaultParams.lineJoin,
|
|
27629
27652
|
lineDash = defaultParams.lineDash,
|
|
27630
27653
|
lineCap = defaultParams.lineCap,
|
|
27631
|
-
miterLimit = defaultParams.miterLimit
|
|
27654
|
+
miterLimit = defaultParams.miterLimit,
|
|
27655
|
+
keepStrokeScale = defaultParams.keepStrokeScale
|
|
27632
27656
|
} = attribute;
|
|
27633
|
-
_context.globalAlpha = strokeOpacity * opacity * this.baseGlobalAlpha, _context.lineWidth = getScaledStroke(this, lineWidth, this.dpr), _context.strokeStyle = createColor(this, stroke, params, offsetX, offsetY), _context.lineJoin = lineJoin, 0 === lineDash[0] && 0 === lineDash[1] || lineDash && _context.setLineDash(lineDash), _context.lineCap = lineCap, _context.miterLimit = miterLimit;
|
|
27657
|
+
_context.globalAlpha = strokeOpacity * opacity * this.baseGlobalAlpha, _context.lineWidth = keepStrokeScale ? lineWidth : getScaledStroke(this, lineWidth, this.dpr), _context.strokeStyle = createColor(this, stroke, params, offsetX, offsetY), _context.lineJoin = lineJoin, 0 === lineDash[0] && 0 === lineDash[1] || lineDash && _context.setLineDash(lineDash), _context.lineCap = lineCap, _context.miterLimit = miterLimit;
|
|
27634
27658
|
}
|
|
27635
27659
|
}
|
|
27636
27660
|
measureText(text) {
|
|
@@ -28037,8 +28061,9 @@ class BaseLinePicker extends BaseRender {
|
|
|
28037
28061
|
return this.canvasRenderer.drawShape(graphic, pickContext, x, y, {}, null, context => !!picked || (picked = context.isPointInPath(pickPoint.x, pickPoint.y), picked), (context, lineAttribute, themeAttribute) => {
|
|
28038
28062
|
if (picked) return !0;
|
|
28039
28063
|
const lineWidth = lineAttribute.lineWidth || themeAttribute.lineWidth,
|
|
28040
|
-
pickStrokeBuffer = lineAttribute.pickStrokeBuffer || themeAttribute.pickStrokeBuffer
|
|
28041
|
-
|
|
28064
|
+
pickStrokeBuffer = lineAttribute.pickStrokeBuffer || themeAttribute.pickStrokeBuffer,
|
|
28065
|
+
keepStrokeScale = lineAttribute.keepStrokeScale || themeAttribute.keepStrokeScale;
|
|
28066
|
+
return pickContext.lineWidth = keepStrokeScale ? lineWidth + pickStrokeBuffer : getScaledStroke(pickContext, lineWidth + pickStrokeBuffer, pickContext.dpr), picked = context.isPointInStroke(pickPoint.x, pickPoint.y), picked;
|
|
28042
28067
|
}), this.canvasRenderer.z = 0, pickContext.modelMatrix !== lastModelMatrix && mat4Allocate.free(pickContext.modelMatrix), pickContext.modelMatrix = lastModelMatrix, pickContext.highPerformanceRestore(), picked;
|
|
28043
28068
|
}
|
|
28044
28069
|
}
|
|
@@ -28173,8 +28198,9 @@ let DefaultCanvasSymbolPicker = class extends Base3dPicker {
|
|
|
28173
28198
|
return this.canvasRenderer.drawShape(symbol, pickContext, x, y, {}, null, (context, symbolAttribute, themeAttribute) => !!picked || (picked = context.isPointInPath(pickPoint.x, pickPoint.y), picked), (context, symbolAttribute, themeAttribute) => {
|
|
28174
28199
|
if (picked) return !0;
|
|
28175
28200
|
const lineWidth = symbolAttribute.lineWidth || themeAttribute.lineWidth,
|
|
28176
|
-
pickStrokeBuffer = symbolAttribute.pickStrokeBuffer || themeAttribute.pickStrokeBuffer
|
|
28177
|
-
|
|
28201
|
+
pickStrokeBuffer = symbolAttribute.pickStrokeBuffer || themeAttribute.pickStrokeBuffer,
|
|
28202
|
+
keepStrokeScale = symbolAttribute.keepStrokeScale || themeAttribute.keepStrokeScale;
|
|
28203
|
+
return pickContext.lineWidth = keepStrokeScale ? lineWidth + pickStrokeBuffer : getScaledStroke(pickContext, lineWidth + pickStrokeBuffer, pickContext.dpr), picked = context.isPointInStroke(pickPoint.x, pickPoint.y), picked;
|
|
28178
28204
|
}), this.canvasRenderer.z = 0, pickContext.modelMatrix !== lastModelMatrix && mat4Allocate.free(pickContext.modelMatrix), pickContext.modelMatrix = lastModelMatrix, pickContext.highPerformanceRestore(), picked;
|
|
28179
28205
|
}
|
|
28180
28206
|
};
|
|
@@ -28611,7 +28637,7 @@ const registerWrapText = _registerWrapText;
|
|
|
28611
28637
|
|
|
28612
28638
|
const roughModule = _roughModule;
|
|
28613
28639
|
|
|
28614
|
-
const version = "0.21.0-
|
|
28640
|
+
const version = "0.21.0-beta.0";
|
|
28615
28641
|
preLoadAllModule();
|
|
28616
28642
|
if (isBrowserEnv()) {
|
|
28617
28643
|
loadBrowserEnv(container);
|