@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.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
  */
@@ -12046,7 +12046,8 @@ var TextService = /*#__PURE__*/function () {
12046
12046
  var lines = [];
12047
12047
  var currentLineIndex = 0;
12048
12048
  var currentLineWidth = 0;
12049
- var prevLineLastCharIndex = 0;
12049
+ // @see https://github.com/antvis/G/issues/1932
12050
+ var prevLineLastCharIndex = -1;
12050
12051
  var cache = {};
12051
12052
  var calcWidth = function calcWidth(txt) {
12052
12053
  return _this2.getFromCache(txt, letterSpacing, cache, context);
@@ -12070,7 +12071,9 @@ var TextService = /*#__PURE__*/function () {
12070
12071
  txtLastCharIndex += 1;
12071
12072
  lineTxt += chars[txtLastCharIndex];
12072
12073
  }
12073
- while (calcWidth(lineTxt) > widthThreshold && txtLastCharIndex > txtStartCharIndex) {
12074
+ while (calcWidth(lineTxt) > widthThreshold &&
12075
+ // @see https://github.com/antvis/G/issues/1932
12076
+ txtLastCharIndex >= txtStartCharIndex) {
12074
12077
  txtLastCharIndex -= 1;
12075
12078
  lineTxt = lineTxt.slice(0, -1);
12076
12079
  }
@@ -16432,7 +16435,7 @@ var Canvas = /*#__PURE__*/function (_EventTarget) {
16432
16435
  }, {
16433
16436
  key: "mountChildren",
16434
16437
  value: function mountChildren(child) {
16435
- var _this10 = this;
16438
+ var _this0 = this;
16436
16439
  var skipTriggerEvent = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : isInFragment(child);
16437
16440
  if (this.inited) {
16438
16441
  if (!child.isConnected) {
@@ -16453,7 +16456,7 @@ var Canvas = /*#__PURE__*/function (_EventTarget) {
16453
16456
 
16454
16457
  // recursively mount children
16455
16458
  child.childNodes.forEach(function (c) {
16456
- _this10.mountChildren(c, skipTriggerEvent);
16459
+ _this0.mountChildren(c, skipTriggerEvent);
16457
16460
  });
16458
16461
 
16459
16462
  // trigger after mounted