@antv/g-lite 2.2.18 → 2.2.19

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.esm.js CHANGED
@@ -1,8 +1,8 @@
1
1
  /*!
2
2
  * @antv/g-lite
3
3
  * @description A core module for rendering engine implements DOM API.
4
- * @version 2.2.18
5
- * @date 4/14/2025, 2:53:27 AM
4
+ * @version 2.2.19
5
+ * @date 5/9/2025, 8:18:56 AM
6
6
  * @author AntVis
7
7
  * @docs https://g.antv.antgroup.com/
8
8
  */
@@ -12044,7 +12044,8 @@ var TextService = /*#__PURE__*/function () {
12044
12044
  var lines = [];
12045
12045
  var currentLineIndex = 0;
12046
12046
  var currentLineWidth = 0;
12047
- var prevLineLastCharIndex = 0;
12047
+ // @see https://github.com/antvis/G/issues/1932
12048
+ var prevLineLastCharIndex = -1;
12048
12049
  var cache = {};
12049
12050
  var calcWidth = function calcWidth(txt) {
12050
12051
  return _this2.getFromCache(txt, letterSpacing, cache, context);
@@ -12068,7 +12069,9 @@ var TextService = /*#__PURE__*/function () {
12068
12069
  txtLastCharIndex += 1;
12069
12070
  lineTxt += chars[txtLastCharIndex];
12070
12071
  }
12071
- while (calcWidth(lineTxt) > widthThreshold && txtLastCharIndex > txtStartCharIndex) {
12072
+ while (calcWidth(lineTxt) > widthThreshold &&
12073
+ // @see https://github.com/antvis/G/issues/1932
12074
+ txtLastCharIndex >= txtStartCharIndex) {
12072
12075
  txtLastCharIndex -= 1;
12073
12076
  lineTxt = lineTxt.slice(0, -1);
12074
12077
  }
@@ -16430,7 +16433,7 @@ var Canvas = /*#__PURE__*/function (_EventTarget) {
16430
16433
  }, {
16431
16434
  key: "mountChildren",
16432
16435
  value: function mountChildren(child) {
16433
- var _this10 = this;
16436
+ var _this0 = this;
16434
16437
  var skipTriggerEvent = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : isInFragment(child);
16435
16438
  if (this.inited) {
16436
16439
  if (!child.isConnected) {
@@ -16451,7 +16454,7 @@ var Canvas = /*#__PURE__*/function (_EventTarget) {
16451
16454
 
16452
16455
  // recursively mount children
16453
16456
  child.childNodes.forEach(function (c) {
16454
- _this10.mountChildren(c, skipTriggerEvent);
16457
+ _this0.mountChildren(c, skipTriggerEvent);
16455
16458
  });
16456
16459
 
16457
16460
  // trigger after mounted