@antv/g-lite 2.2.12 → 2.2.13

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.12
5
- * @date 12/26/2024, 12:57:25 PM
4
+ * @version 2.2.13
5
+ * @date 12/27/2024, 4:20:45 AM
6
6
  * @author AntVis
7
7
  * @docs https://g.antv.antgroup.com/
8
8
  */
@@ -11463,6 +11463,7 @@ var TextService = /*#__PURE__*/function () {
11463
11463
  key: "wordWrap",
11464
11464
  value: function wordWrap(text, parsedStyle, offscreenCanvas) {
11465
11465
  var _this2 = this;
11466
+ var self = this;
11466
11467
  var _parsedStyle$wordWrap2 = parsedStyle.wordWrapWidth,
11467
11468
  wordWrapWidth = _parsedStyle$wordWrap2 === void 0 ? 0 : _parsedStyle$wordWrap2,
11468
11469
  _parsedStyle$letterSp2 = parsedStyle.letterSpacing,
@@ -11498,6 +11499,9 @@ var TextService = /*#__PURE__*/function () {
11498
11499
  */
11499
11500
  function findCharIndexClosestWidthThreshold(txt, textCharIndex, widthThreshold) {
11500
11501
  while (calcWidth(txt) < widthThreshold && textCharIndex < chars.length - 1) {
11502
+ if (self.isNewline(chars[textCharIndex + 1])) {
11503
+ break;
11504
+ }
11501
11505
  textCharIndex += 1;
11502
11506
  txt += chars[textCharIndex];
11503
11507
  }