@antv/g-lite 2.2.11 → 2.2.12

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.11
5
- * @date 12/26/2024, 8:33:47 AM
4
+ * @version 2.2.12
5
+ * @date 12/26/2024, 12:57:25 PM
6
6
  * @author AntVis
7
7
  * @docs https://g.antv.antgroup.com/
8
8
  */
@@ -11522,7 +11522,7 @@ var TextService = /*#__PURE__*/function () {
11522
11522
  textCharIndex += 1;
11523
11523
  txt += chars[textCharIndex];
11524
11524
  }
11525
- while (calcWidth(txt) > widthThreshold) {
11525
+ while (calcWidth(txt) > widthThreshold && textCharIndex > 0) {
11526
11526
  textCharIndex -= 1;
11527
11527
  txt = txt.slice(0, -1);
11528
11528
  }
@@ -11554,7 +11554,7 @@ var TextService = /*#__PURE__*/function () {
11554
11554
  if (currentLineIndex + 1 >= maxLines) {
11555
11555
  parsedStyle.isOverflowing = true;
11556
11556
  if (i < chars.length - 1) {
11557
- appendEllipsis(currentLineIndex, i);
11557
+ appendEllipsis(currentLineIndex, i - 1);
11558
11558
  }
11559
11559
  break;
11560
11560
  }
@@ -11564,13 +11564,13 @@ var TextService = /*#__PURE__*/function () {
11564
11564
  continue;
11565
11565
  }
11566
11566
  if (currentLineWidth > 0 && currentLineWidth + charWidth > maxWidth) {
11567
- var result = findCharIndexClosestWidthThreshold(lines[currentLineIndex], i, maxWidth);
11568
- if (result.textCharIndex !== i) {
11567
+ var result = findCharIndexClosestWidthThreshold(lines[currentLineIndex], i - 1, maxWidth);
11568
+ if (result.textCharIndex !== i - 1) {
11569
11569
  lines[currentLineIndex] = result.txt;
11570
11570
  if (result.textCharIndex === chars.length - 1) {
11571
11571
  break;
11572
11572
  }
11573
- i = result.textCharIndex;
11573
+ i = result.textCharIndex + 1;
11574
11574
  _char2 = chars[i];
11575
11575
  prevChar = chars[i - 1];
11576
11576
  nextChar = chars[i + 1];
@@ -11578,7 +11578,7 @@ var TextService = /*#__PURE__*/function () {
11578
11578
  }
11579
11579
  if (currentLineIndex + 1 >= maxLines) {
11580
11580
  parsedStyle.isOverflowing = true;
11581
- appendEllipsis(currentLineIndex, i);
11581
+ appendEllipsis(currentLineIndex, i - 1);
11582
11582
  break;
11583
11583
  }
11584
11584
  currentLineIndex += 1;