@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/dist/index.js CHANGED
@@ -3996,7 +3996,8 @@
3996
3996
  globalZIndex: 1,
3997
3997
  globalCompositeOperation: "",
3998
3998
  overflow: "hidden",
3999
- shadowPickMode: "graphic"
3999
+ shadowPickMode: "graphic",
4000
+ keepStrokeScale: !1
4000
4001
  }, DefaultDebugAttribute), DefaultStyle), DefaultTransform);
4001
4002
  function addAttributeToPrototype(obj, c, keys) {
4002
4003
  keys.forEach(key => {
@@ -6412,7 +6413,7 @@
6412
6413
  }
6413
6414
  }
6414
6415
 
6415
- class DefaultTicker {
6416
+ class DefaultTicker extends EventEmitter {
6416
6417
  set mode(m) {
6417
6418
  this._mode !== m && (this._mode = m, this.setupTickHandler());
6418
6419
  }
@@ -6421,17 +6422,17 @@
6421
6422
  }
6422
6423
  constructor() {
6423
6424
  let timelines = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
6424
- this.handleTick = (handler, params) => {
6425
+ super(), this.handleTick = (handler, params) => {
6425
6426
  const {
6426
6427
  once = !1
6427
6428
  } = null != params ? params : {};
6428
- this.ifCanStop() ? this.stop() : (this._handlerTick(handler), once || handler.tick(this.interval, this.handleTick));
6429
- }, this._handlerTick = handler => {
6429
+ this.ifCanStop() ? this.stop() : (this._handlerTick(), once || handler.tick(this.interval, this.handleTick));
6430
+ }, this._handlerTick = () => {
6430
6431
  const time = this.tickerHandler.getTime();
6431
6432
  let delta = 0;
6432
6433
  this.lastFrameTime >= 0 && (delta = time - this.lastFrameTime), this.lastFrameTime = time, this.status === STATUS$1.RUNNING && (this.tickCounts++, this.timelines.forEach(t => {
6433
6434
  t.tick(delta);
6434
- }));
6435
+ }), this.emit("afterTick"));
6435
6436
  }, this.init(), this.lastFrameTime = -1, this.tickCounts = 0, this.timelines = timelines, this.autoStop = !0;
6436
6437
  }
6437
6438
  init() {
@@ -6527,6 +6528,9 @@
6527
6528
  stop() {
6528
6529
  this.status = STATUS$1.INITIAL, this.setupTickHandler(), this.lastFrameTime = -1;
6529
6530
  }
6531
+ trySyncTickStatus() {
6532
+ this.status === STATUS$1.RUNNING && this._handlerTick();
6533
+ }
6530
6534
  }
6531
6535
 
6532
6536
  class ManualTickHandler {
@@ -7668,7 +7672,7 @@
7668
7672
  lastMatchedIndex = i, lastMatchedPoint = tagMap.get(this.toPoints[i].context);
7669
7673
  break;
7670
7674
  }
7671
- "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);
7675
+ "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);
7672
7676
  let prevMatchedPoint = this.toPoints[0];
7673
7677
  this.interpolatePoints = this.toPoints.map((point, index) => {
7674
7678
  const matchedPoint = tagMap.get(point.context);
@@ -7680,11 +7684,19 @@
7680
7684
  return newPoint.defined = toPoint.defined, newPoint.context = toPoint.context, newPoint;
7681
7685
  });
7682
7686
  }
7687
+ onFirstRun() {
7688
+ const lastClipRange = this.target.attribute.clipRange;
7689
+ isValidNumber$1(lastClipRange * this.clipRange) && (this.clipRange *= lastClipRange);
7690
+ }
7683
7691
  onUpdate(end, ratio, out) {
7684
7692
  if (this.points = this.points.map((point, index) => {
7685
7693
  const newPoint = pointInterpolation(this.interpolatePoints[index][0], this.interpolatePoints[index][1], ratio);
7686
7694
  return newPoint.context = point.context, newPoint;
7687
- }), this.clipRange && (out.clipRange = this.clipRange + (1 - this.clipRange) * ratio), this.segmentsCache && this.to.segments) {
7695
+ }), this.clipRange) {
7696
+ 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));
7697
+ out.clipRange = this.clipRange + (1 - this.clipRange) * ratio;
7698
+ }
7699
+ if (this.segmentsCache && this.to.segments) {
7688
7700
  let start = 0;
7689
7701
  out.segments = this.to.segments.map((segment, index) => {
7690
7702
  const end = start + this.segmentsCache[index],
@@ -9100,7 +9112,7 @@
9100
9112
  }
9101
9113
  static GetFile(url, type) {
9102
9114
  let data = ResourceLoader.cache.get(url);
9103
- return data ? "fail" === data.loadState ? Promise.reject() : "init" === data.loadState || "loading" === data.loadState ? data.dataPromise.then(data => data.data) : Promise.resolve(data.data) : (data = {
9115
+ return data ? "init" === data.loadState || "fail" === data.loadState ? Promise.reject() : "loading" === data.loadState ? data.dataPromise.then(data => data.data) : Promise.resolve(data.data) : (data = {
9104
9116
  type: type,
9105
9117
  loadState: "init"
9106
9118
  }, 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));
@@ -12038,7 +12050,8 @@
12038
12050
  x: originX = arcAttribute.x,
12039
12051
  y: originY = arcAttribute.y,
12040
12052
  scaleX = arcAttribute.scaleX,
12041
- scaleY = arcAttribute.scaleY
12053
+ scaleY = arcAttribute.scaleY,
12054
+ keepStrokeScale = arcAttribute.keepStrokeScale
12042
12055
  } = arc.attribute;
12043
12056
  let {
12044
12057
  innerRadius = arcAttribute.innerRadius,
@@ -12050,7 +12063,7 @@
12050
12063
  {
12051
12064
  distance = arcAttribute[key].distance
12052
12065
  } = borderStyle,
12053
- d = getScaledStroke(context, distance, context.dpr),
12066
+ d = keepStrokeScale ? distance : getScaledStroke(context, distance, context.dpr),
12054
12067
  deltaAngle = distance / outerRadius,
12055
12068
  sign = "outerBorder" === key ? 1 : -1;
12056
12069
  if (arc.setAttributes({
@@ -12095,14 +12108,15 @@
12095
12108
  x: originX = circleAttribute.x,
12096
12109
  y: originY = circleAttribute.y,
12097
12110
  scaleX = circleAttribute.scaleX,
12098
- scaleY = circleAttribute.scaleY
12111
+ scaleY = circleAttribute.scaleY,
12112
+ keepStrokeScale = circleAttribute.keepStrokeScale
12099
12113
  } = circle.attribute,
12100
12114
  renderBorder = (borderStyle, key) => {
12101
12115
  const doStroke = !(!borderStyle || !borderStyle.stroke),
12102
12116
  {
12103
12117
  distance = circleAttribute[key].distance
12104
12118
  } = borderStyle,
12105
- d = getScaledStroke(context, distance, context.dpr),
12119
+ d = keepStrokeScale ? distance : getScaledStroke(context, distance, context.dpr),
12106
12120
  sign = "outerBorder" === key ? 1 : -1;
12107
12121
  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) {
12108
12122
  const lastOpacity = circleAttribute[key].opacity;
@@ -12221,7 +12235,8 @@
12221
12235
  scaleX = rectAttribute.scaleX,
12222
12236
  scaleY = rectAttribute.scaleY,
12223
12237
  x1: x1,
12224
- y1: y1
12238
+ y1: y1,
12239
+ keepStrokeScale = rectAttribute.keepStrokeScale
12225
12240
  } = rect.attribute;
12226
12241
  let {
12227
12242
  width: width,
@@ -12234,7 +12249,7 @@
12234
12249
  {
12235
12250
  distance = rectAttribute[key].distance
12236
12251
  } = borderStyle,
12237
- d = getScaledStroke(context, distance, context.dpr),
12252
+ d = keepStrokeScale ? distance : getScaledStroke(context, distance, context.dpr),
12238
12253
  nextX = x + sign * d,
12239
12254
  nextY = y + sign * d,
12240
12255
  dw = 2 * d;
@@ -12364,9 +12379,8 @@
12364
12379
  constructor() {
12365
12380
  super(...arguments), this.time = exports.BaseRenderContributionTime.afterFillStroke, this.useStyle = !0, this.order = 0;
12366
12381
  }
12367
- drawShape(image, context, x, y, doFill, doStroke, fVisible, sVisible, rectAttribute, drawContext, fillCb, strokeCb) {
12368
- if (!(image.isGifImage && image.renderFrame && image.playing)) return super.drawShape(image, context, x, y, doFill, doStroke, fVisible, sVisible, rectAttribute, drawContext, fillCb, strokeCb);
12369
- image.renderFrame(context, x, y);
12382
+ drawShape(rect, context, x, y, doFill, doStroke, fVisible, sVisible, rectAttribute, drawContext, fillCb, strokeCb) {
12383
+ return super.drawShape(rect, context, x, y, doFill, doStroke, fVisible, sVisible, rectAttribute, drawContext, fillCb, strokeCb);
12370
12384
  }
12371
12385
  }
12372
12386
  const defaultImageRenderContribution = new DefaultImageRenderContribution();
@@ -12392,14 +12406,15 @@
12392
12406
  x: originX = symbolAttribute.x,
12393
12407
  y: originY = symbolAttribute.y,
12394
12408
  scaleX = symbolAttribute.scaleX,
12395
- scaleY = symbolAttribute.scaleY
12409
+ scaleY = symbolAttribute.scaleY,
12410
+ keepStrokeScale = symbolAttribute.keepStrokeScale
12396
12411
  } = symbol.attribute,
12397
12412
  renderBorder = (borderStyle, key) => {
12398
12413
  const doStroke = !(!borderStyle || !borderStyle.stroke),
12399
12414
  {
12400
12415
  distance = symbolAttribute[key].distance
12401
12416
  } = borderStyle,
12402
- d = getScaledStroke(context, distance, context.dpr),
12417
+ d = keepStrokeScale ? distance : getScaledStroke(context, distance, context.dpr),
12403
12418
  sign = "outerBorder" === key ? 1 : -1;
12404
12419
  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) {
12405
12420
  const lastOpacity = symbolAttribute[key].opacity;
@@ -14116,12 +14131,10 @@
14116
14131
  const {
14117
14132
  image: url
14118
14133
  } = image.attribute;
14119
- if (!image.isGifImage) {
14120
- if (!url || !image.resources) return;
14121
- const res = image.resources.get(url);
14122
- if ("loading" === res.state && isString$1(url)) return void ResourceLoader.improveImageLoading(url);
14123
- if ("success" !== res.state) return;
14124
- }
14134
+ if (!url || !image.resources) return;
14135
+ const res = image.resources.get(url);
14136
+ if ("loading" === res.state && isString$1(url)) return void ResourceLoader.improveImageLoading(url);
14137
+ if ("success" !== res.state) return;
14125
14138
  const {
14126
14139
  context: context
14127
14140
  } = renderService.drawParams;
@@ -15249,6 +15262,9 @@
15249
15262
  bounds.x1 = -halfS, bounds.x2 = halfS, bounds.y1 = -halfS, bounds.y2 = halfS;
15250
15263
  } else bounds.x1 = -size[0] / 2, bounds.x2 = size[0] / 2, bounds.y1 = -size[1] / 2, bounds.y2 = size[1] / 2;
15251
15264
  }
15265
+ parseSize(size) {
15266
+ return isNumber$1(size) ? size : Math.min(size[0], size[1]);
15267
+ }
15252
15268
  }
15253
15269
 
15254
15270
  function circle(ctx, r, x, y, z) {
@@ -15259,13 +15275,13 @@
15259
15275
  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";
15260
15276
  }
15261
15277
  draw(ctx, size, x, y, z) {
15262
- return circle(ctx, size / 2, x, y, z);
15278
+ return circle(ctx, this.parseSize(size) / 2, x, y, z);
15263
15279
  }
15264
15280
  drawOffset(ctx, size, x, y, offset, z) {
15265
- return circle(ctx, size / 2 + offset, x, y, z);
15281
+ return circle(ctx, this.parseSize(size) / 2 + offset, x, y, z);
15266
15282
  }
15267
15283
  drawToSvgPath(size, x, y, z) {
15268
- const r = size / 2;
15284
+ const r = this.parseSize(size) / 2;
15269
15285
  return `M ${x - r}, ${y} a ${r},${r} 0 1,0 ${2 * r},0 a ${r},${r} 0 1,0 -${2 * r},0`;
15270
15286
  }
15271
15287
  }
@@ -15282,10 +15298,10 @@
15282
15298
  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";
15283
15299
  }
15284
15300
  draw(ctx, size, x, y, z) {
15285
- return cross(ctx, size / 6, x, y, z);
15301
+ return cross(ctx, this.parseSize(size) / 6, x, y, z);
15286
15302
  }
15287
15303
  drawOffset(ctx, size, x, y, offset, z) {
15288
- return crossOffset(ctx, size / 6, x, y, offset, z);
15304
+ return crossOffset(ctx, this.parseSize(size) / 6, x, y, offset, z);
15289
15305
  }
15290
15306
  }
15291
15307
  var cross$1 = new CrossSymbol();
@@ -15298,13 +15314,13 @@
15298
15314
  super(...arguments), this.type = "diamond", this.pathStr = "M-0.5,0L0,-0.5L0.5,0L0,0.5Z";
15299
15315
  }
15300
15316
  draw(ctx, size, x, y, z) {
15301
- return diamond(ctx, size / 2, x, y, z);
15317
+ return diamond(ctx, this.parseSize(size) / 2, x, y, z);
15302
15318
  }
15303
15319
  drawFitDir(ctx, size, x, y, z) {
15304
- return diamond(ctx, size / 2, x, y, z);
15320
+ return diamond(ctx, this.parseSize(size) / 2, x, y, z);
15305
15321
  }
15306
15322
  drawOffset(ctx, size, x, y, offset, z) {
15307
- return diamond(ctx, size / 2 + offset, x, y, z);
15323
+ return diamond(ctx, this.parseSize(size) / 2 + offset, x, y, z);
15308
15324
  }
15309
15325
  }
15310
15326
  var diamond$1 = new DiamondSymbol();
@@ -15318,10 +15334,10 @@
15318
15334
  super(...arguments), this.type = "square", this.pathStr = "M-0.5,-0.5h1v1h-1Z";
15319
15335
  }
15320
15336
  draw(ctx, size, x, y) {
15321
- return square(ctx, size / 2, x, y);
15337
+ return square(ctx, this.parseSize(size) / 2, x, y);
15322
15338
  }
15323
15339
  drawOffset(ctx, size, x, y, offset) {
15324
- return square(ctx, size / 2 + offset, x, y);
15340
+ return square(ctx, this.parseSize(size) / 2 + offset, x, y);
15325
15341
  }
15326
15342
  }
15327
15343
  var square$1 = new SquareSymbol();
@@ -15335,10 +15351,10 @@
15335
15351
  super(...arguments), this.type = "triangleUp", this.pathStr = "M0.5,0.5 L-0.5,0.5 L0,-0.5 Z";
15336
15352
  }
15337
15353
  draw(ctx, size, x, y) {
15338
- return trianglUpOffset(ctx, size / 2, x, y);
15354
+ return trianglUpOffset(ctx, this.parseSize(size) / 2, x, y);
15339
15355
  }
15340
15356
  drawOffset(ctx, size, x, y, offset) {
15341
- return trianglUpOffset(ctx, size / 2, x, y, offset);
15357
+ return trianglUpOffset(ctx, this.parseSize(size) / 2, x, y, offset);
15342
15358
  }
15343
15359
  }
15344
15360
  var triangleUp = new TriangleUpSymbol();
@@ -15370,10 +15386,10 @@
15370
15386
  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";
15371
15387
  }
15372
15388
  draw(ctx, size, transX, transY) {
15373
- return star(ctx, size / 2, transX, transY);
15389
+ return star(ctx, this.parseSize(size) / 2, transX, transY);
15374
15390
  }
15375
15391
  drawOffset(ctx, size, transX, transY, offset) {
15376
- return star(ctx, size / 2 + offset, transX, transY);
15392
+ return star(ctx, this.parseSize(size) / 2 + offset, transX, transY);
15377
15393
  }
15378
15394
  }
15379
15395
  var star$1 = new StarSymbol();
@@ -15391,10 +15407,10 @@
15391
15407
  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";
15392
15408
  }
15393
15409
  draw(ctx, size, transX, transY) {
15394
- return arrow(ctx, size / 2, transX, transY);
15410
+ return arrow(ctx, this.parseSize(size) / 2, transX, transY);
15395
15411
  }
15396
15412
  drawOffset(ctx, size, transX, transY, offset) {
15397
- return arrow(ctx, size / 2 + offset, transX, transY);
15413
+ return arrow(ctx, this.parseSize(size) / 2 + offset, transX, transY);
15398
15414
  }
15399
15415
  }
15400
15416
  var arrow$1 = new ArrowSymbol();
@@ -15408,10 +15424,10 @@
15408
15424
  super(...arguments), this.type = "wedge", this.pathStr = "M0,-0.5773502691896257L-0.125,0.28867513459481287L0.125,0.28867513459481287Z";
15409
15425
  }
15410
15426
  draw(ctx, size, transX, transY) {
15411
- return wedge(ctx, size / 2, transX, transY);
15427
+ return wedge(ctx, this.parseSize(size) / 2, transX, transY);
15412
15428
  }
15413
15429
  drawOffset(ctx, size, transX, transY, offset) {
15414
- return wedge(ctx, size / 2 + offset, transX, transY);
15430
+ return wedge(ctx, this.parseSize(size) / 2 + offset, transX, transY);
15415
15431
  }
15416
15432
  }
15417
15433
  var wedge$1 = new WedgeSymbol();
@@ -15424,10 +15440,10 @@
15424
15440
  super(...arguments), this.type = "stroke", this.pathStr = "";
15425
15441
  }
15426
15442
  draw(ctx, size, transX, transY) {
15427
- return stroke(ctx, size / 2, transX, transY);
15443
+ return stroke(ctx, this.parseSize(size) / 2, transX, transY);
15428
15444
  }
15429
15445
  drawOffset(ctx, size, transX, transY, offset) {
15430
- return stroke(ctx, size / 2 + offset, transX, transY);
15446
+ return stroke(ctx, this.parseSize(size) / 2 + offset, transX, transY);
15431
15447
  }
15432
15448
  }
15433
15449
  var stroke$1 = new StrokeSymbol();
@@ -15449,10 +15465,10 @@
15449
15465
  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";
15450
15466
  }
15451
15467
  draw(ctx, size, transX, transY) {
15452
- return wye(ctx, size / 2, transX, transY);
15468
+ return wye(ctx, this.parseSize(size) / 2, transX, transY);
15453
15469
  }
15454
15470
  drawOffset(ctx, size, transX, transY, offset) {
15455
- return wye(ctx, size / 2 + offset, transX, transY);
15471
+ return wye(ctx, this.parseSize(size) / 2 + offset, transX, transY);
15456
15472
  }
15457
15473
  }
15458
15474
  var wye$1 = new WyeSymbol();
@@ -15465,10 +15481,10 @@
15465
15481
  super(...arguments), this.type = "triangleLeft", this.pathStr = "M-0.5,0 L0.5,0.5 L0.5,-0.5 Z";
15466
15482
  }
15467
15483
  draw(ctx, size, x, y) {
15468
- return trianglLeftOffset(ctx, size / 2, x, y, 0);
15484
+ return trianglLeftOffset(ctx, this.parseSize(size) / 2, x, y, 0);
15469
15485
  }
15470
15486
  drawOffset(ctx, size, x, y, offset) {
15471
- return trianglLeftOffset(ctx, size / 2, x, y, offset);
15487
+ return trianglLeftOffset(ctx, this.parseSize(size) / 2, x, y, offset);
15472
15488
  }
15473
15489
  }
15474
15490
  var triangleLeft = new TriangleLeftSymbol();
@@ -15482,10 +15498,10 @@
15482
15498
  super(...arguments), this.type = "triangleRight", this.pathStr = "M-0.5,0.5 L0.5,0 L-0.5,-0.5 Z";
15483
15499
  }
15484
15500
  draw(ctx, size, x, y) {
15485
- return trianglRightOffset(ctx, size / 2, x, y);
15501
+ return trianglRightOffset(ctx, this.parseSize(size) / 2, x, y);
15486
15502
  }
15487
15503
  drawOffset(ctx, size, x, y, offset) {
15488
- return trianglRightOffset(ctx, size / 2, x, y, offset);
15504
+ return trianglRightOffset(ctx, this.parseSize(size) / 2, x, y, offset);
15489
15505
  }
15490
15506
  }
15491
15507
  var triangleRight = new TriangleRightSymbol();
@@ -15499,10 +15515,10 @@
15499
15515
  super(...arguments), this.type = "triangleDown", this.pathStr = "M-0.5,-0.5 L0.5,-0.5 L0,0.5 Z";
15500
15516
  }
15501
15517
  draw(ctx, size, x, y) {
15502
- return trianglDownOffset(ctx, size / 2, x, y);
15518
+ return trianglDownOffset(ctx, this.parseSize(size) / 2, x, y);
15503
15519
  }
15504
15520
  drawOffset(ctx, size, x, y, offset) {
15505
- return trianglDownOffset(ctx, size / 2, x, y, offset);
15521
+ return trianglDownOffset(ctx, this.parseSize(size) / 2, x, y, offset);
15506
15522
  }
15507
15523
  }
15508
15524
  var triangleDown = new TriangleDownSymbol();
@@ -15517,10 +15533,10 @@
15517
15533
  super(...arguments), this.type = "thinTriangle", this.pathStr = "M0,-0.5773502691896257L-0.5,0.28867513459481287L0.5,0.28867513459481287Z";
15518
15534
  }
15519
15535
  draw(ctx, size, x, y) {
15520
- return thinTriangle(ctx, size / 2 / sqrt3, x, y);
15536
+ return thinTriangle(ctx, this.parseSize(size) / 2 / sqrt3, x, y);
15521
15537
  }
15522
15538
  drawOffset(ctx, size, x, y, offset) {
15523
- return thinTriangle(ctx, size / 2 / sqrt3 + offset, x, y);
15539
+ return thinTriangle(ctx, this.parseSize(size) / 2 / sqrt3 + offset, x, y);
15524
15540
  }
15525
15541
  }
15526
15542
  var thinTriangle$1 = new ThinTriangleSymbol();
@@ -15534,10 +15550,10 @@
15534
15550
  super(...arguments), this.type = "arrow2Left", this.pathStr = "M 0.25 -0.5 L -0.25 0 l 0.25 0.5";
15535
15551
  }
15536
15552
  draw(ctx, size, transX, transY) {
15537
- return arrow2Left(ctx, size / 4, transX, transY);
15553
+ return arrow2Left(ctx, this.parseSize(size) / 4, transX, transY);
15538
15554
  }
15539
15555
  drawOffset(ctx, size, transX, transY, offset) {
15540
- return arrow2Left(ctx, size / 4 + offset, transX, transY);
15556
+ return arrow2Left(ctx, this.parseSize(size) / 4 + offset, transX, transY);
15541
15557
  }
15542
15558
  }
15543
15559
  var arrow2Left$1 = new Arrow2LeftSymbol();
@@ -15551,10 +15567,10 @@
15551
15567
  super(...arguments), this.type = "arrow2Right", this.pathStr = "M -0.25 -0.5 l 0.25 0 l -0.25 0.5";
15552
15568
  }
15553
15569
  draw(ctx, size, transX, transY) {
15554
- return arrow2Right(ctx, size / 4, transX, transY);
15570
+ return arrow2Right(ctx, this.parseSize(size) / 4, transX, transY);
15555
15571
  }
15556
15572
  drawOffset(ctx, size, transX, transY, offset) {
15557
- return arrow2Right(ctx, size / 4 + offset, transX, transY);
15573
+ return arrow2Right(ctx, this.parseSize(size) / 4 + offset, transX, transY);
15558
15574
  }
15559
15575
  }
15560
15576
  var arrow2Right$1 = new Arrow2RightSymbol();
@@ -15568,10 +15584,10 @@
15568
15584
  super(...arguments), this.type = "arrow2Up", this.pathStr = "M -0.5 0.25 L 0 -0.25 l 0.5 0.25";
15569
15585
  }
15570
15586
  draw(ctx, size, transX, transY) {
15571
- return arrow2Up(ctx, size / 4, transX, transY);
15587
+ return arrow2Up(ctx, this.parseSize(size) / 4, transX, transY);
15572
15588
  }
15573
15589
  drawOffset(ctx, size, transX, transY, offset) {
15574
- return arrow2Up(ctx, size / 4 + offset, transX, transY);
15590
+ return arrow2Up(ctx, this.parseSize(size) / 4 + offset, transX, transY);
15575
15591
  }
15576
15592
  }
15577
15593
  var arrow2Up$1 = new Arrow2UpSymbol();
@@ -15585,10 +15601,10 @@
15585
15601
  super(...arguments), this.type = "arrow2Down", this.pathStr = "M -0.5 -0.25 L 0 0.25 l 0.5 -0.25";
15586
15602
  }
15587
15603
  draw(ctx, size, transX, transY) {
15588
- return arrow2Down(ctx, size / 4, transX, transY);
15604
+ return arrow2Down(ctx, this.parseSize(size) / 4, transX, transY);
15589
15605
  }
15590
15606
  drawOffset(ctx, size, transX, transY, offset) {
15591
- return arrow2Down(ctx, size / 4 + offset, transX, transY);
15607
+ return arrow2Down(ctx, this.parseSize(size) / 4 + offset, transX, transY);
15592
15608
  }
15593
15609
  }
15594
15610
  var arrow2Down$1 = new Arrow2DownSymbol();
@@ -15601,13 +15617,13 @@
15601
15617
  super(...arguments), this.type = "lineV", this.pathStr = "M0,-0.5L0,0.5";
15602
15618
  }
15603
15619
  draw(ctx, size, x, y, z) {
15604
- return lineV(ctx, size / 2, x, y);
15620
+ return lineV(ctx, this.parseSize(size) / 2, x, y);
15605
15621
  }
15606
15622
  drawOffset(ctx, size, x, y, offset, z) {
15607
- return lineV(ctx, size / 2 + offset, x, y);
15623
+ return lineV(ctx, this.parseSize(size) / 2 + offset, x, y);
15608
15624
  }
15609
15625
  drawToSvgPath(size, x, y, z) {
15610
- const r = size / 2;
15626
+ const r = this.parseSize(size) / 2;
15611
15627
  return `M ${x}, ${y - r} L ${x},${y + r}`;
15612
15628
  }
15613
15629
  }
@@ -15621,13 +15637,13 @@
15621
15637
  super(...arguments), this.type = "lineH", this.pathStr = "M-0.5,0L0.5,0";
15622
15638
  }
15623
15639
  draw(ctx, size, x, y, z) {
15624
- return lineH(ctx, size / 2, x, y);
15640
+ return lineH(ctx, this.parseSize(size) / 2, x, y);
15625
15641
  }
15626
15642
  drawOffset(ctx, size, x, y, offset, z) {
15627
- return lineH(ctx, size / 2 + offset, x, y);
15643
+ return lineH(ctx, this.parseSize(size) / 2 + offset, x, y);
15628
15644
  }
15629
15645
  drawToSvgPath(size, x, y, z) {
15630
- const r = size / 2;
15646
+ const r = this.parseSize(size) / 2;
15631
15647
  return `M ${x - r}, ${y} L ${x + r},${y}`;
15632
15648
  }
15633
15649
  }
@@ -15641,13 +15657,13 @@
15641
15657
  super(...arguments), this.type = "close", this.pathStr = "M-0.5,-0.5L0.5,0.5,M0.5,-0.5L-0.5,0.5";
15642
15658
  }
15643
15659
  draw(ctx, size, x, y, z) {
15644
- return close(ctx, size / 2, x, y);
15660
+ return close(ctx, this.parseSize(size) / 2, x, y);
15645
15661
  }
15646
15662
  drawOffset(ctx, size, x, y, offset, z) {
15647
- return close(ctx, size / 2 + offset, x, y);
15663
+ return close(ctx, this.parseSize(size) / 2 + offset, x, y);
15648
15664
  }
15649
15665
  drawToSvgPath(size, x, y, z) {
15650
- const r = size / 2;
15666
+ const r = this.parseSize(size) / 2;
15651
15667
  return `M ${x - r}, ${y - r} L ${x + r},${y + r} M ${x + r}, ${y - r} L ${x - r},${y + r}`;
15652
15668
  }
15653
15669
  }
@@ -15681,15 +15697,18 @@
15681
15697
  this.pathStr = "", this.type = type, isArray$1(path) ? this.svgCache = path : this.path = path, this.isSvg = isSvg;
15682
15698
  }
15683
15699
  drawOffset(ctx, size, x, y, offset, z, cb) {
15684
- return this.isSvg ? !!this.svgCache && (this.svgCache.forEach(item => {
15700
+ return size = this.parseSize(size), this.isSvg ? !!this.svgCache && (this.svgCache.forEach(item => {
15685
15701
  ctx.beginPath(), renderCommandList(item.path.commandList, ctx, x, y, size, size), cb && cb(item.path, item.attribute);
15686
15702
  }), !1) : (renderCommandList(this.path.commandList, ctx, x, y, size + offset, size + offset), !1);
15687
15703
  }
15688
15704
  draw(ctx, size, x, y, z, cb) {
15689
- return this.drawOffset(ctx, size, x, y, 0, z, cb);
15705
+ return size = this.parseSize(size), this.drawOffset(ctx, size, x, y, 0, z, cb);
15706
+ }
15707
+ parseSize(size) {
15708
+ return isNumber$1(size) ? size : Math.min(size[0], size[1]);
15690
15709
  }
15691
15710
  bounds(size, bounds) {
15692
- if (this.isSvg) {
15711
+ if (size = this.parseSize(size), this.isSvg) {
15693
15712
  if (!this.svgCache) return;
15694
15713
  return bounds.clear(), void this.svgCache.forEach(_ref => {
15695
15714
  let {
@@ -16372,7 +16391,11 @@
16372
16391
  case "sub":
16373
16392
  baseline += this.descent / 2;
16374
16393
  }
16375
- "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), this.character.stroke && (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();
16394
+ "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);
16395
+ const {
16396
+ lineWidth = 1
16397
+ } = this.character;
16398
+ 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();
16376
16399
  }
16377
16400
  getWidthWithEllips(direction) {
16378
16401
  let text = this.text;
@@ -18589,7 +18612,7 @@
18589
18612
  constructor() {
18590
18613
  let params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
18591
18614
  var _a;
18592
- super({}), this._onVisibleChange = visible => {
18615
+ super({}), this.tickedBeforeRender = !0, this._onVisibleChange = visible => {
18593
18616
  if (!(this._skipRender < 0)) if (visible) {
18594
18617
  if (this.dirtyBounds) {
18595
18618
  const b = this.window.getViewBox();
@@ -18600,7 +18623,10 @@
18600
18623
  }, this.beforeRender = stage => {
18601
18624
  this._beforeRender && this._beforeRender(stage);
18602
18625
  }, this.afterRender = stage => {
18603
- this.renderCount++, this._afterRender && this._afterRender(stage), this._afterNextRenderCbs && this._afterNextRenderCbs.forEach(cb => cb(stage)), this._afterNextRenderCbs = null;
18626
+ this.renderCount++, this._afterRender && this._afterRender(stage), this._afterNextRenderCbs && this._afterNextRenderCbs.forEach(cb => cb(stage)), this._afterNextRenderCbs = null, this.tickedBeforeRender = !1;
18627
+ }, this.afterTickCb = () => {
18628
+ var _a;
18629
+ this.tickedBeforeRender = !0, "performance" === (null === (_a = this.params.optimize) || void 0 === _a ? void 0 : _a.tickRenderMode) || "rendering" !== this.state && this.render();
18604
18630
  }, this.params = params, this.theme = new Theme(), this.hooks = {
18605
18631
  beforeRender: new SyncHook(["stage"]),
18606
18632
  afterRender: new SyncHook(["stage"])
@@ -18617,7 +18643,7 @@
18617
18643
  main: !0
18618
18644
  })), 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({
18619
18645
  background: this._background
18620
- });
18646
+ }), this.ticker.on("afterTick", this.afterTickCb);
18621
18647
  }
18622
18648
  pauseRender() {
18623
18649
  let sr = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : -1;
@@ -18846,7 +18872,7 @@
18846
18872
  if ("released" === this.releaseStatus) return;
18847
18873
  this.ticker.start(), this.timeline.resume();
18848
18874
  const state = this.state;
18849
- 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++;
18875
+ 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++;
18850
18876
  }
18851
18877
  combineLayersToWindow() {
18852
18878
  if ("harmony" === this.global.env) {
@@ -18952,7 +18978,7 @@
18952
18978
  layer.release();
18953
18979
  }), this.interactiveLayer && (this.interactiveLayer.forEachChildren(item => {
18954
18980
  item.setStage && item.setStage(null, null), this.interactiveLayer.removeChild(item);
18955
- }), this.interactiveLayer.release()), this.window.release(), this.ticker.remTimeline(this.timeline), this.renderService.renderTreeRoots = [];
18981
+ }), this.interactiveLayer.release()), this.window.release(), this.ticker.remTimeline(this.timeline), this.ticker.removeListener("afterTick", this.afterTickCb), this.renderService.renderTreeRoots = [];
18956
18982
  }
18957
18983
  setStage(stage) {}
18958
18984
  dirty(b, matrix) {
@@ -23652,11 +23678,9 @@
23652
23678
  name: name,
23653
23679
  id: id,
23654
23680
  attribute: attribute,
23655
- stateProxy: stateProxy,
23656
- animation: animation,
23657
- timeline: timeline
23681
+ stateProxy: stateProxy
23658
23682
  } = _a,
23659
- props = __rest(_a, ["key", "name", "id", "attribute", "stateProxy", "animation", "timeline"]);
23683
+ props = __rest(_a, ["key", "name", "id", "attribute", "stateProxy"]);
23660
23684
  let c = type;
23661
23685
  isString$1(type) && (c = graphicCreator[type]);
23662
23686
  const childrenList = [];
@@ -23665,13 +23689,7 @@
23665
23689
  }
23666
23690
  children.length && flatten(1 === children.length ? children[0] : children, childrenList);
23667
23691
  const g = "Group" === c.name ? new c(attribute) : c(config);
23668
- if (parseToGraphic$1(g, childrenList, props), stateProxy && (g.stateProxy = stateProxy), name && (g.name = name), isArray$1(animation)) {
23669
- const animate = g.animate();
23670
- timeline && animate.setTimeline(timeline), animation.forEach(item => {
23671
- animate[item[0]](...item.slice(1));
23672
- });
23673
- }
23674
- return g;
23692
+ return parseToGraphic$1(g, childrenList, props), stateProxy && (g.stateProxy = stateProxy), g;
23675
23693
  }
23676
23694
  function parseToGraphic$1(g, childrenList, props) {
23677
23695
  let out,
@@ -23939,7 +23957,7 @@
23939
23957
  startTime: startTime,
23940
23958
  startPoints: startPoints
23941
23959
  } = this;
23942
- if (eventType) return eventType;
23960
+ if ("press" === eventType) return eventType;
23943
23961
  let type;
23944
23962
  return type = clock.now() - startTime > this.config.press.time && calcDistance(startPoints[0], point) < this.config.press.threshold ? "press" : "pan", this.eventType = type, type;
23945
23963
  }
@@ -24471,9 +24489,10 @@
24471
24489
  lineJoin = defaultParams.lineJoin,
24472
24490
  lineDash = defaultParams.lineDash,
24473
24491
  lineCap = defaultParams.lineCap,
24474
- miterLimit = defaultParams.miterLimit
24492
+ miterLimit = defaultParams.miterLimit,
24493
+ keepStrokeScale = defaultParams.keepStrokeScale
24475
24494
  } = attribute;
24476
- _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;
24495
+ _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;
24477
24496
  }
24478
24497
  }
24479
24498
  setTextStyleWithoutAlignBaseline(params, defaultParams, z) {
@@ -25373,8 +25392,9 @@
25373
25392
  return this.canvasRenderer.drawShape(graphic, pickContext, x, y, {}, null, (context, arcAttribute, themeAttribute) => !!picked || (picked = context.isPointInPath(point.x, point.y), picked), (context, arcAttribute, themeAttribute) => {
25374
25393
  if (picked) return !0;
25375
25394
  const lineWidth = arcAttribute.lineWidth || themeAttribute.lineWidth,
25376
- pickStrokeBuffer = arcAttribute.pickStrokeBuffer || themeAttribute.pickStrokeBuffer;
25377
- return pickContext.lineWidth = getScaledStroke(pickContext, lineWidth + pickStrokeBuffer, pickContext.dpr), picked = context.isPointInStroke(point.x, point.y), picked;
25395
+ pickStrokeBuffer = arcAttribute.pickStrokeBuffer || themeAttribute.pickStrokeBuffer,
25396
+ keepStrokeScale = arcAttribute.keepStrokeScale || themeAttribute.keepStrokeScale;
25397
+ return pickContext.lineWidth = keepStrokeScale ? lineWidth + pickStrokeBuffer : getScaledStroke(pickContext, lineWidth + pickStrokeBuffer, pickContext.dpr), picked = context.isPointInStroke(point.x, point.y), picked;
25378
25398
  }), pickContext.highPerformanceRestore(), picked;
25379
25399
  }
25380
25400
  }
@@ -25647,8 +25667,9 @@
25647
25667
  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) => {
25648
25668
  if (picked) return !0;
25649
25669
  const lineWidth = rectAttribute.lineWidth || themeAttribute.lineWidth,
25650
- pickStrokeBuffer = rectAttribute.pickStrokeBuffer || themeAttribute.pickStrokeBuffer;
25651
- return pickContext.lineWidth = getScaledStroke(pickContext, lineWidth + pickStrokeBuffer, pickContext.dpr), picked = context.isPointInStroke(point.x, point.y), picked;
25670
+ pickStrokeBuffer = rectAttribute.pickStrokeBuffer || themeAttribute.pickStrokeBuffer,
25671
+ keepStrokeScale = rectAttribute.keepStrokeScale || themeAttribute.keepStrokeScale;
25672
+ return pickContext.lineWidth = keepStrokeScale ? lineWidth + pickStrokeBuffer : getScaledStroke(pickContext, lineWidth + pickStrokeBuffer, pickContext.dpr), picked = context.isPointInStroke(point.x, point.y), picked;
25652
25673
  });else {
25653
25674
  const {
25654
25675
  fill = rectAttribute.fill,
@@ -25962,9 +25983,10 @@
25962
25983
  lineJoin = defaultParams.lineJoin,
25963
25984
  lineDash = defaultParams.lineDash,
25964
25985
  lineCap = defaultParams.lineCap,
25965
- miterLimit = defaultParams.miterLimit
25986
+ miterLimit = defaultParams.miterLimit,
25987
+ keepStrokeScale = defaultParams.keepStrokeScale
25966
25988
  } = attribute;
25967
- _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;
25989
+ _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;
25968
25990
  }
25969
25991
  }
25970
25992
  measureText(text) {
@@ -26592,9 +26614,10 @@
26592
26614
  lineJoin = defaultParams.lineJoin,
26593
26615
  lineDash = defaultParams.lineDash,
26594
26616
  lineCap = defaultParams.lineCap,
26595
- miterLimit = defaultParams.miterLimit
26617
+ miterLimit = defaultParams.miterLimit,
26618
+ keepStrokeScale = defaultParams.keepStrokeScale
26596
26619
  } = attribute;
26597
- _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);
26620
+ _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);
26598
26621
  }
26599
26622
  }
26600
26623
  setTextStyleWithoutAlignBaseline(params, defaultParams) {
@@ -27634,9 +27657,10 @@
27634
27657
  lineJoin = defaultParams.lineJoin,
27635
27658
  lineDash = defaultParams.lineDash,
27636
27659
  lineCap = defaultParams.lineCap,
27637
- miterLimit = defaultParams.miterLimit
27660
+ miterLimit = defaultParams.miterLimit,
27661
+ keepStrokeScale = defaultParams.keepStrokeScale
27638
27662
  } = attribute;
27639
- _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;
27663
+ _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;
27640
27664
  }
27641
27665
  }
27642
27666
  measureText(text) {
@@ -28043,8 +28067,9 @@
28043
28067
  return this.canvasRenderer.drawShape(graphic, pickContext, x, y, {}, null, context => !!picked || (picked = context.isPointInPath(pickPoint.x, pickPoint.y), picked), (context, lineAttribute, themeAttribute) => {
28044
28068
  if (picked) return !0;
28045
28069
  const lineWidth = lineAttribute.lineWidth || themeAttribute.lineWidth,
28046
- pickStrokeBuffer = lineAttribute.pickStrokeBuffer || themeAttribute.pickStrokeBuffer;
28047
- return pickContext.lineWidth = getScaledStroke(pickContext, lineWidth + pickStrokeBuffer, pickContext.dpr), picked = context.isPointInStroke(pickPoint.x, pickPoint.y), picked;
28070
+ pickStrokeBuffer = lineAttribute.pickStrokeBuffer || themeAttribute.pickStrokeBuffer,
28071
+ keepStrokeScale = lineAttribute.keepStrokeScale || themeAttribute.keepStrokeScale;
28072
+ return pickContext.lineWidth = keepStrokeScale ? lineWidth + pickStrokeBuffer : getScaledStroke(pickContext, lineWidth + pickStrokeBuffer, pickContext.dpr), picked = context.isPointInStroke(pickPoint.x, pickPoint.y), picked;
28048
28073
  }), this.canvasRenderer.z = 0, pickContext.modelMatrix !== lastModelMatrix && mat4Allocate.free(pickContext.modelMatrix), pickContext.modelMatrix = lastModelMatrix, pickContext.highPerformanceRestore(), picked;
28049
28074
  }
28050
28075
  }
@@ -28179,8 +28204,9 @@
28179
28204
  return this.canvasRenderer.drawShape(symbol, pickContext, x, y, {}, null, (context, symbolAttribute, themeAttribute) => !!picked || (picked = context.isPointInPath(pickPoint.x, pickPoint.y), picked), (context, symbolAttribute, themeAttribute) => {
28180
28205
  if (picked) return !0;
28181
28206
  const lineWidth = symbolAttribute.lineWidth || themeAttribute.lineWidth,
28182
- pickStrokeBuffer = symbolAttribute.pickStrokeBuffer || themeAttribute.pickStrokeBuffer;
28183
- return pickContext.lineWidth = getScaledStroke(pickContext, lineWidth + pickStrokeBuffer, pickContext.dpr), picked = context.isPointInStroke(pickPoint.x, pickPoint.y), picked;
28207
+ pickStrokeBuffer = symbolAttribute.pickStrokeBuffer || themeAttribute.pickStrokeBuffer,
28208
+ keepStrokeScale = symbolAttribute.keepStrokeScale || themeAttribute.keepStrokeScale;
28209
+ return pickContext.lineWidth = keepStrokeScale ? lineWidth + pickStrokeBuffer : getScaledStroke(pickContext, lineWidth + pickStrokeBuffer, pickContext.dpr), picked = context.isPointInStroke(pickPoint.x, pickPoint.y), picked;
28184
28210
  }), this.canvasRenderer.z = 0, pickContext.modelMatrix !== lastModelMatrix && mat4Allocate.free(pickContext.modelMatrix), pickContext.modelMatrix = lastModelMatrix, pickContext.highPerformanceRestore(), picked;
28185
28211
  }
28186
28212
  };
@@ -28617,7 +28643,7 @@
28617
28643
 
28618
28644
  const roughModule = _roughModule;
28619
28645
 
28620
- const version = "0.21.0-alpha.4";
28646
+ const version = "0.21.0-beta.0";
28621
28647
  preLoadAllModule();
28622
28648
  if (isBrowserEnv()) {
28623
28649
  loadBrowserEnv(container);