@visactor/vrender-core 0.20.0-alpha.4 → 0.20.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.
Files changed (38) hide show
  1. package/cjs/common/Reflect-metadata.js +4 -205
  2. package/cjs/common/Reflect-metadata.js.map +1 -1
  3. package/cjs/common/shape/rect.d.ts +3 -1
  4. package/cjs/common/shape/rect.js +13 -8
  5. package/cjs/common/shape/rect.js.map +1 -1
  6. package/cjs/graphic/richtext/wrapper.d.ts +2 -2
  7. package/cjs/graphic/richtext/wrapper.js +4 -4
  8. package/cjs/graphic/richtext/wrapper.js.map +1 -1
  9. package/cjs/graphic/richtext.js +7 -6
  10. package/cjs/graphic/richtext.js.map +1 -1
  11. package/cjs/render/contributions/render/area-render.js +1 -1
  12. package/cjs/render/contributions/render/area-render.js.map +1 -1
  13. package/cjs/render/contributions/render/contributions/rect-contribution-render.js +12 -3
  14. package/cjs/render/contributions/render/contributions/rect-contribution-render.js.map +1 -1
  15. package/cjs/render/contributions/render/draw-interceptor.js +1 -1
  16. package/cjs/render/contributions/render/draw-interceptor.js.map +1 -1
  17. package/cjs/render/contributions/render/group-render.js +5 -2
  18. package/cjs/render/contributions/render/group-render.js.map +1 -1
  19. package/dist/index.es.js +68 -323
  20. package/es/common/Reflect-metadata.js +4 -205
  21. package/es/common/Reflect-metadata.js.map +1 -1
  22. package/es/common/shape/rect.d.ts +3 -1
  23. package/es/common/shape/rect.js +13 -8
  24. package/es/common/shape/rect.js.map +1 -1
  25. package/es/graphic/richtext/wrapper.d.ts +2 -2
  26. package/es/graphic/richtext/wrapper.js +4 -4
  27. package/es/graphic/richtext/wrapper.js.map +1 -1
  28. package/es/graphic/richtext.js +7 -6
  29. package/es/graphic/richtext.js.map +1 -1
  30. package/es/render/contributions/render/area-render.js +1 -1
  31. package/es/render/contributions/render/area-render.js.map +1 -1
  32. package/es/render/contributions/render/contributions/rect-contribution-render.js +11 -3
  33. package/es/render/contributions/render/contributions/rect-contribution-render.js.map +1 -1
  34. package/es/render/contributions/render/draw-interceptor.js +2 -2
  35. package/es/render/contributions/render/draw-interceptor.js.map +1 -1
  36. package/es/render/contributions/render/group-render.js +5 -2
  37. package/es/render/contributions/render/group-render.js.map +1 -1
  38. package/package.json +4 -4
package/dist/index.es.js CHANGED
@@ -48,49 +48,12 @@ var Reflect$1 = (function (Reflect) {
48
48
  };
49
49
  }
50
50
  })(function (exporter) {
51
- const hasOwn = Object.prototype.hasOwnProperty;
52
51
  const supportsSymbol = typeof Symbol === 'function';
53
52
  const toPrimitiveSymbol = supportsSymbol && typeof Symbol.toPrimitive !== 'undefined' ? Symbol.toPrimitive : '@@toPrimitive';
54
- const iteratorSymbol = supportsSymbol && typeof Symbol.iterator !== 'undefined' ? Symbol.iterator : '@@iterator';
55
- const supportsCreate = typeof Object.create === 'function';
56
- const supportsProto = { __proto__: [] } instanceof Array;
57
- const downLevel = !supportsCreate && !supportsProto;
58
- const HashMap = {
59
- create: supportsCreate
60
- ? function () {
61
- return MakeDictionary(Object.create(null));
62
- }
63
- : supportsProto
64
- ? function () {
65
- return MakeDictionary({ __proto__: null });
66
- }
67
- : function () {
68
- return MakeDictionary({});
69
- },
70
- has: downLevel
71
- ? function (map, key) {
72
- return hasOwn.call(map, key);
73
- }
74
- : function (map, key) {
75
- return key in map;
76
- },
77
- get: downLevel
78
- ? function (map, key) {
79
- return hasOwn.call(map, key) ? map[key] : undefined;
80
- }
81
- : function (map, key) {
82
- return map[key];
83
- }
84
- };
85
53
  const functionPrototype = Object.getPrototypeOf(Function);
86
- const usePolyfill = typeof process === 'object' && process.env && process.env.REFLECT_METADATA_USE_MAP_POLYFILL === 'true';
87
- const _Map = !usePolyfill && typeof Map === 'function' && typeof Map.prototype.entries === 'function'
88
- ? Map
89
- : CreateMapPolyfill();
90
- !usePolyfill && typeof Set === 'function' && typeof Set.prototype.entries === 'function'
91
- ? Set
92
- : CreateSetPolyfill();
93
- const _WeakMap = !usePolyfill && typeof WeakMap === 'function' ? WeakMap : CreateWeakMapPolyfill();
54
+ typeof process === 'object' && process.env && process.env.REFLECT_METADATA_USE_MAP_POLYFILL === 'true';
55
+ const _Map = Map;
56
+ const _WeakMap = WeakMap;
94
57
  const Metadata = new _WeakMap();
95
58
  function defineMetadata(metadataKey, metadataValue, target, propertyKey) {
96
59
  if (!IsObject(target)) {
@@ -330,271 +293,6 @@ var Reflect$1 = (function (Reflect) {
330
293
  }
331
294
  return constructor;
332
295
  }
333
- function CreateMapPolyfill() {
334
- const cacheSentinel = {};
335
- const arraySentinel = [];
336
- const MapIterator = (function () {
337
- function MapIterator(keys, values, selector) {
338
- this._index = 0;
339
- this._keys = keys;
340
- this._values = values;
341
- this._selector = selector;
342
- }
343
- MapIterator.prototype['@@iterator'] = function () {
344
- return this;
345
- };
346
- MapIterator.prototype[iteratorSymbol] = function () {
347
- return this;
348
- };
349
- MapIterator.prototype.next = function () {
350
- const index = this._index;
351
- if (index >= 0 && index < this._keys.length) {
352
- const result = this._selector(this._keys[index], this._values[index]);
353
- if (index + 1 >= this._keys.length) {
354
- this._index = -1;
355
- this._keys = arraySentinel;
356
- this._values = arraySentinel;
357
- }
358
- else {
359
- this._index++;
360
- }
361
- return { value: result, done: false };
362
- }
363
- return { value: undefined, done: true };
364
- };
365
- MapIterator.prototype.throw = function (error) {
366
- if (this._index >= 0) {
367
- this._index = -1;
368
- this._keys = arraySentinel;
369
- this._values = arraySentinel;
370
- }
371
- throw error;
372
- };
373
- MapIterator.prototype.return = function (value) {
374
- if (this._index >= 0) {
375
- this._index = -1;
376
- this._keys = arraySentinel;
377
- this._values = arraySentinel;
378
- }
379
- return { value: value, done: true };
380
- };
381
- return MapIterator;
382
- })();
383
- return (function () {
384
- function Map() {
385
- this._keys = [];
386
- this._values = [];
387
- this._cacheKey = cacheSentinel;
388
- this._cacheIndex = -2;
389
- }
390
- Object.defineProperty(Map.prototype, 'size', {
391
- get: function () {
392
- return this._keys.length;
393
- },
394
- enumerable: true,
395
- configurable: true
396
- });
397
- Map.prototype.has = function (key) {
398
- return this._find(key, false) >= 0;
399
- };
400
- Map.prototype.get = function (key) {
401
- const index = this._find(key, false);
402
- return index >= 0 ? this._values[index] : undefined;
403
- };
404
- Map.prototype.set = function (key, value) {
405
- const index = this._find(key, true);
406
- this._values[index] = value;
407
- return this;
408
- };
409
- Map.prototype.delete = function (key) {
410
- const index = this._find(key, false);
411
- if (index >= 0) {
412
- const size = this._keys.length;
413
- for (let i = index + 1; i < size; i++) {
414
- this._keys[i - 1] = this._keys[i];
415
- this._values[i - 1] = this._values[i];
416
- }
417
- this._keys.length--;
418
- this._values.length--;
419
- if (key === this._cacheKey) {
420
- this._cacheKey = cacheSentinel;
421
- this._cacheIndex = -2;
422
- }
423
- return true;
424
- }
425
- return false;
426
- };
427
- Map.prototype.clear = function () {
428
- this._keys.length = 0;
429
- this._values.length = 0;
430
- this._cacheKey = cacheSentinel;
431
- this._cacheIndex = -2;
432
- };
433
- Map.prototype.keys = function () {
434
- return new MapIterator(this._keys, this._values, getKey);
435
- };
436
- Map.prototype.values = function () {
437
- return new MapIterator(this._keys, this._values, getValue);
438
- };
439
- Map.prototype.entries = function () {
440
- return new MapIterator(this._keys, this._values, getEntry);
441
- };
442
- Map.prototype['@@iterator'] = function () {
443
- return this.entries();
444
- };
445
- Map.prototype[iteratorSymbol] = function () {
446
- return this.entries();
447
- };
448
- Map.prototype._find = function (key, insert) {
449
- if (this._cacheKey !== key) {
450
- this._cacheIndex = this._keys.indexOf((this._cacheKey = key));
451
- }
452
- if (this._cacheIndex < 0 && insert) {
453
- this._cacheIndex = this._keys.length;
454
- this._keys.push(key);
455
- this._values.push(undefined);
456
- }
457
- return this._cacheIndex;
458
- };
459
- return Map;
460
- })();
461
- function getKey(key, _) {
462
- return key;
463
- }
464
- function getValue(_, value) {
465
- return value;
466
- }
467
- function getEntry(key, value) {
468
- return [key, value];
469
- }
470
- }
471
- function CreateSetPolyfill() {
472
- return (function () {
473
- function Set() {
474
- this._map = new _Map();
475
- }
476
- Object.defineProperty(Set.prototype, 'size', {
477
- get: function () {
478
- return this._map.size;
479
- },
480
- enumerable: true,
481
- configurable: true
482
- });
483
- Set.prototype.has = function (value) {
484
- return this._map.has(value);
485
- };
486
- Set.prototype.add = function (value) {
487
- return this._map.set(value, value), this;
488
- };
489
- Set.prototype.delete = function (value) {
490
- return this._map.delete(value);
491
- };
492
- Set.prototype.clear = function () {
493
- this._map.clear();
494
- };
495
- Set.prototype.keys = function () {
496
- return this._map.keys();
497
- };
498
- Set.prototype.values = function () {
499
- return this._map.values();
500
- };
501
- Set.prototype.entries = function () {
502
- return this._map.entries();
503
- };
504
- Set.prototype['@@iterator'] = function () {
505
- return this.keys();
506
- };
507
- Set.prototype[iteratorSymbol] = function () {
508
- return this.keys();
509
- };
510
- return Set;
511
- })();
512
- }
513
- function CreateWeakMapPolyfill() {
514
- const UUID_SIZE = 16;
515
- const keys = HashMap.create();
516
- const rootKey = CreateUniqueKey();
517
- return (function () {
518
- function WeakMap() {
519
- this._key = CreateUniqueKey();
520
- }
521
- WeakMap.prototype.has = function (target) {
522
- const table = GetOrCreateWeakMapTable(target, false);
523
- return table !== undefined ? HashMap.has(table, this._key) : false;
524
- };
525
- WeakMap.prototype.get = function (target) {
526
- const table = GetOrCreateWeakMapTable(target, false);
527
- return table !== undefined ? HashMap.get(table, this._key) : undefined;
528
- };
529
- WeakMap.prototype.set = function (target, value) {
530
- const table = GetOrCreateWeakMapTable(target, true);
531
- table[this._key] = value;
532
- return this;
533
- };
534
- WeakMap.prototype.delete = function (target) {
535
- const table = GetOrCreateWeakMapTable(target, false);
536
- return table !== undefined ? delete table[this._key] : false;
537
- };
538
- WeakMap.prototype.clear = function () {
539
- this._key = CreateUniqueKey();
540
- };
541
- return WeakMap;
542
- })();
543
- function CreateUniqueKey() {
544
- let key;
545
- do {
546
- key = '@@WeakMap@@' + CreateUUID();
547
- } while (HashMap.has(keys, key));
548
- keys[key] = true;
549
- return key;
550
- }
551
- function GetOrCreateWeakMapTable(target, create) {
552
- if (!hasOwn.call(target, rootKey)) {
553
- if (!create) {
554
- return undefined;
555
- }
556
- Object.defineProperty(target, rootKey, { value: HashMap.create() });
557
- }
558
- return target[rootKey];
559
- }
560
- function FillRandomBytes(buffer, size) {
561
- for (let i = 0; i < size; ++i) {
562
- buffer[i] = (Math.random() * 0xff) | 0;
563
- }
564
- return buffer;
565
- }
566
- function GenRandomBytes(size) {
567
- if (typeof Uint8Array === 'function') {
568
- if (typeof crypto !== 'undefined') {
569
- return crypto.getRandomValues(new Uint8Array(size));
570
- }
571
- return FillRandomBytes(new Uint8Array(size), size);
572
- }
573
- return FillRandomBytes(new Array(size), size);
574
- }
575
- function CreateUUID() {
576
- const data = GenRandomBytes(UUID_SIZE);
577
- data[6] = (data[6] & 0x4f) | 0x40;
578
- data[8] = (data[8] & 0xbf) | 0x80;
579
- let result = '';
580
- for (let offset = 0; offset < UUID_SIZE; ++offset) {
581
- const byte = data[offset];
582
- if (offset === 4 || offset === 6 || offset === 8) {
583
- result += '-';
584
- }
585
- if (byte < 16) {
586
- result += '0';
587
- }
588
- result += byte.toString(16).toLowerCase();
589
- }
590
- return result;
591
- }
592
- }
593
- function MakeDictionary(obj) {
594
- obj.__ = undefined;
595
- delete obj.__;
596
- return obj;
597
- }
598
296
  });
599
297
  return Reflect;
600
298
  })({});
@@ -15708,7 +15406,7 @@ class DefaultGroupBackgroundRenderContribution extends DefaultBaseBackgroundRend
15708
15406
  const defaultGroupBackgroundRenderContribution = new DefaultGroupBackgroundRenderContribution();
15709
15407
 
15710
15408
  const halfPi = pi / 2;
15711
- function createRectPath(path, x, y, width, height, rectCornerRadius) {
15409
+ function createRectPath(path, x, y, width, height, rectCornerRadius, edgeCb) {
15712
15410
  if (width < 0) {
15713
15411
  x += width;
15714
15412
  width = -width;
@@ -15782,31 +15480,43 @@ function createRectPath(path, x, y, width, height, rectCornerRadius) {
15782
15480
  const leftBottomPoint1 = [leftBottom[0] + _cornerRadius[3], leftBottom[1]];
15783
15481
  const leftBottomPoint2 = [leftBottom[0], leftBottom[1] - _cornerRadius[3]];
15784
15482
  path.moveTo(leftTopPoint1[0], leftTopPoint1[1]);
15785
- path.lineTo(rightTopPoint1[0], rightTopPoint1[1]);
15483
+ edgeCb && edgeCb[0]
15484
+ ? edgeCb[0](leftTopPoint1[0], leftTopPoint1[1], rightTopPoint1[0], rightTopPoint1[1])
15485
+ : path.lineTo(rightTopPoint1[0], rightTopPoint1[1]);
15786
15486
  if (!arrayEqual(rightTopPoint1, rightTopPoint2)) {
15487
+ edgeCb && edgeCb[0] && path.moveTo(rightTopPoint1[0], rightTopPoint1[1]);
15787
15488
  const centerX = rightTopPoint1[0];
15788
15489
  const centerY = rightTopPoint1[1] + _cornerRadius[1];
15789
15490
  path.arc(centerX, centerY, _cornerRadius[1], -halfPi, 0, false);
15790
15491
  }
15791
- path.lineTo(rightBottomPoint2[0], rightBottomPoint2[1]);
15492
+ edgeCb && edgeCb[1]
15493
+ ? edgeCb[1](rightTopPoint2[0], rightTopPoint2[1], rightBottomPoint2[0], rightBottomPoint2[1])
15494
+ : path.lineTo(rightBottomPoint2[0], rightBottomPoint2[1]);
15792
15495
  if (!arrayEqual(rightBottomPoint1, rightBottomPoint2)) {
15793
15496
  const centerX = rightBottomPoint2[0] - _cornerRadius[2];
15794
15497
  const centerY = rightBottomPoint2[1];
15498
+ edgeCb && edgeCb[1] && path.moveTo(rightBottomPoint2[0], rightBottomPoint2[1]);
15795
15499
  path.arc(centerX, centerY, _cornerRadius[2], 0, halfPi, false);
15796
15500
  }
15797
- path.lineTo(leftBottomPoint1[0], leftBottomPoint1[1]);
15501
+ edgeCb && edgeCb[2]
15502
+ ? edgeCb[2](rightBottomPoint1[0], rightBottomPoint1[1], leftBottomPoint1[0], leftBottomPoint1[1])
15503
+ : path.lineTo(leftBottomPoint1[0], leftBottomPoint1[1]);
15798
15504
  if (!arrayEqual(leftBottomPoint1, leftBottomPoint2)) {
15799
15505
  const centerX = leftBottomPoint1[0];
15800
15506
  const centerY = leftBottomPoint1[1] - _cornerRadius[3];
15507
+ edgeCb && edgeCb[2] && path.moveTo(leftBottomPoint1[0], leftBottomPoint1[1]);
15801
15508
  path.arc(centerX, centerY, _cornerRadius[3], halfPi, pi, false);
15802
15509
  }
15803
- path.lineTo(leftTopPoint2[0], leftTopPoint2[1]);
15510
+ edgeCb && edgeCb[3]
15511
+ ? edgeCb[3](leftBottomPoint2[0], leftBottomPoint2[1], leftTopPoint2[0], leftTopPoint2[1])
15512
+ : path.lineTo(leftTopPoint2[0], leftTopPoint2[1]);
15804
15513
  if (!arrayEqual(leftTopPoint1, leftTopPoint2)) {
15805
15514
  const centerX = leftTopPoint1[0];
15806
15515
  const centerY = leftTopPoint1[1] + _cornerRadius[0];
15516
+ edgeCb && edgeCb[3] && path.moveTo(leftTopPoint2[0], leftTopPoint2[1]);
15807
15517
  path.arc(centerX, centerY, _cornerRadius[0], pi, pi + halfPi, false);
15808
15518
  }
15809
- path.closePath();
15519
+ !edgeCb && path.closePath();
15810
15520
  return path;
15811
15521
  }
15812
15522
 
@@ -15882,7 +15592,7 @@ let SplitRectAfterRenderContribution = class SplitRectAfterRenderContribution {
15882
15592
  this.order = 0;
15883
15593
  }
15884
15594
  drawShape(rect, context, x, y, doFill, doStroke, fVisible, sVisible, groupAttribute, drawContext, fillCb, strokeCb) {
15885
- const { x1, y1, x: originX = groupAttribute.x, y: originY = groupAttribute.y, stroke = groupAttribute.stroke } = rect.attribute;
15595
+ const { x1, y1, x: originX = groupAttribute.x, y: originY = groupAttribute.y, stroke = groupAttribute.stroke, cornerRadius = groupAttribute.cornerRadius } = rect.attribute;
15886
15596
  let { width, height } = rect.attribute;
15887
15597
  width = (width !== null && width !== void 0 ? width : x1 - originX) || 0;
15888
15598
  height = (height !== null && height !== void 0 ? height : y1 - originY) || 0;
@@ -15890,6 +15600,28 @@ let SplitRectAfterRenderContribution = class SplitRectAfterRenderContribution {
15890
15600
  return;
15891
15601
  }
15892
15602
  context.setStrokeStyle(rect, rect.attribute, x, y, groupAttribute);
15603
+ if (!(cornerRadius === 0 || (isArray(cornerRadius) && cornerRadius.every(num => num === 0)))) {
15604
+ let lastStrokeI = 0;
15605
+ let lastStroke;
15606
+ createRectPath(context, x, y, width, height, cornerRadius, new Array(4).fill(0).map((_, i) => (x1, y1, x2, y2) => {
15607
+ if (stroke[i]) {
15608
+ if (!(lastStrokeI === i - 1 && stroke[i] === lastStroke)) {
15609
+ context.setStrokeStyle(rect, Object.assign(Object.assign({}, rect.attribute), { stroke: stroke[i] }), x, y, groupAttribute);
15610
+ context.beginPath();
15611
+ context.moveTo(x1, y1);
15612
+ lastStroke = stroke[i];
15613
+ }
15614
+ lastStrokeI = i;
15615
+ context.lineTo(x2, y2);
15616
+ context.stroke();
15617
+ if (i === 3) {
15618
+ context.beginPath();
15619
+ }
15620
+ }
15621
+ }));
15622
+ context.stroke();
15623
+ return;
15624
+ }
15893
15625
  context.beginPath();
15894
15626
  context.moveTo(x, y);
15895
15627
  if (stroke[0]) {
@@ -17154,7 +16886,8 @@ let DefaultCanvasAreaRender = class DefaultCanvasAreaRender extends BaseRender {
17154
16886
  if (!data) {
17155
16887
  return;
17156
16888
  }
17157
- const { doFill, doStroke } = data;
16889
+ const { doFill } = data;
16890
+ const doStroke = data.doStroke && data.sVisible;
17158
16891
  const { clipRange = areaAttribute.clipRange, closePath, points, segments } = area.attribute;
17159
16892
  let { curveType = areaAttribute.curveType } = area.attribute;
17160
16893
  if (closePath && curveType === 'linear') {
@@ -18322,6 +18055,7 @@ let DefaultCanvasGroupRender = class DefaultCanvasGroupRender {
18322
18055
  else {
18323
18056
  context.highPerformanceSave();
18324
18057
  }
18058
+ const baseGlobalAlpha = context.baseGlobalAlpha;
18325
18059
  context.baseGlobalAlpha *= baseOpacity;
18326
18060
  const groupAttribute = getTheme(group, params === null || params === void 0 ? void 0 : params.theme).group;
18327
18061
  const lastModelMatrix = context.modelMatrix;
@@ -18362,7 +18096,7 @@ let DefaultCanvasGroupRender = class DefaultCanvasGroupRender {
18362
18096
  mat4Allocate.free(context.modelMatrix);
18363
18097
  }
18364
18098
  context.modelMatrix = lastModelMatrix;
18365
- context.baseGlobalAlpha /= baseOpacity;
18099
+ context.baseGlobalAlpha = baseGlobalAlpha;
18366
18100
  if (p && p.then) {
18367
18101
  p.then(() => {
18368
18102
  if (clip) {
@@ -18655,7 +18389,7 @@ class ShadowRootDrawItemInterceptorContribution {
18655
18389
  drawContribution.dirtyBounds.copy(drawContribution.backupDirtyBounds).transformWithMatrix(m);
18656
18390
  drawContribution.backupDirtyBounds.copy(drawContribution.dirtyBounds);
18657
18391
  }
18658
- drawContribution.renderGroup(graphic.shadowRoot, drawContext, graphic.parent.globalTransMatrix);
18392
+ drawContribution.renderGroup(graphic.shadowRoot, drawContext, matrixAllocate.allocate(1, 0, 0, 1, 0, 0));
18659
18393
  context.highPerformanceRestore();
18660
18394
  if (drawContribution.dirtyBounds && drawContribution.backupDirtyBounds) {
18661
18395
  drawContribution.dirtyBounds.copy(tempDirtyBounds);
@@ -21987,7 +21721,7 @@ class Wrapper {
21987
21721
  this.lineBuffer.length = 0;
21988
21722
  this.lineWidth = this.maxAscent = this.maxDescent = this.maxAscentForBlank = this.maxDescentForBlank = 0;
21989
21723
  }
21990
- deal(paragraph) {
21724
+ deal(paragraph, singleLine = false) {
21991
21725
  if (paragraph instanceof RichTextIcon) {
21992
21726
  if ((this.direction === 'horizontal' && this.width === 0) ||
21993
21727
  (this.direction === 'vertical' && this.height === 0)) {
@@ -22029,18 +21763,23 @@ class Wrapper {
22029
21763
  this.deal(paragraph);
22030
21764
  }
22031
21765
  else {
22032
- this.cut(paragraph);
21766
+ this.cut(paragraph, singleLine);
22033
21767
  }
22034
21768
  }
22035
21769
  }
22036
- cut(paragraph) {
21770
+ cut(paragraph, singleLine) {
22037
21771
  const availableWidth = this[this.directionKey.width] - this.lineWidth || 0;
22038
21772
  const guessIndex = Math.ceil((availableWidth / paragraph[this.directionKey.width]) * paragraph.length) || 0;
22039
21773
  const index = getStrByWithCanvas(paragraph.text, availableWidth, paragraph.character, guessIndex, this.frame.wordBreak === 'break-word');
22040
21774
  if (index !== 0) {
22041
21775
  const [p1, p2] = seperateParagraph(paragraph, index);
22042
21776
  this.store(p1);
22043
- this.deal(p2);
21777
+ if (singleLine) {
21778
+ this.send();
21779
+ }
21780
+ else {
21781
+ this.deal(p2);
21782
+ }
22044
21783
  }
22045
21784
  else if (this.lineBuffer.length !== 0) {
22046
21785
  this.send();
@@ -22061,6 +21800,9 @@ const RICHTEXT_UPDATE_TAG_KEY = [
22061
21800
  'textBaseline',
22062
21801
  'textConfig',
22063
21802
  'layoutDirection',
21803
+ 'fill',
21804
+ 'stroke',
21805
+ 'fontSize',
22064
21806
  ...GRAPHIC_UPDATE_TAG_KEY
22065
21807
  ];
22066
21808
  class RichText extends Graphic {
@@ -22318,7 +22060,7 @@ class RichText extends Graphic {
22318
22060
  !p.newLine && frame.lines[frame.lines.length - 1].paragraphs.push(p);
22319
22061
  }
22320
22062
  else {
22321
- wrapper.deal(p);
22063
+ wrapper.deal(p, true);
22322
22064
  }
22323
22065
  if (frame.lines.length !== lineCount) {
22324
22066
  lineCount = frame.lines.length;
@@ -22333,6 +22075,7 @@ class RichText extends Graphic {
22333
22075
  skip = false;
22334
22076
  wrapper.lineWidth = 0;
22335
22077
  }
22078
+ wrapper.send();
22336
22079
  }
22337
22080
  }
22338
22081
  else {
@@ -22399,10 +22142,12 @@ class RichText extends Graphic {
22399
22142
  let pickIcon;
22400
22143
  frameCache.icons.forEach(icon => {
22401
22144
  var _a, _b;
22402
- if (icon.AABBBounds.containsPoint({ x: point.x - x, y: point.y - y })) {
22145
+ const bounds = icon.AABBBounds.clone();
22146
+ bounds.translate(icon._marginArray[3], icon._marginArray[0]);
22147
+ if (bounds.containsPoint({ x: point.x - x, y: point.y - y })) {
22403
22148
  pickIcon = icon;
22404
- pickIcon.globalX = ((_a = pickIcon.attribute.x) !== null && _a !== void 0 ? _a : 0) + x;
22405
- pickIcon.globalY = ((_b = pickIcon.attribute.y) !== null && _b !== void 0 ? _b : 0) + y;
22149
+ pickIcon.globalX = ((_a = pickIcon.attribute.x) !== null && _a !== void 0 ? _a : 0) + x + icon._marginArray[3];
22150
+ pickIcon.globalY = ((_b = pickIcon.attribute.y) !== null && _b !== void 0 ? _b : 0) + y + icon._marginArray[0];
22406
22151
  }
22407
22152
  });
22408
22153
  return pickIcon;