@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.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
  */
@@ -11484,6 +11484,7 @@ var TextService = /*#__PURE__*/function () {
11484
11484
  key: "wordWrap",
11485
11485
  value: function wordWrap(text, parsedStyle, offscreenCanvas) {
11486
11486
  var _this2 = this;
11487
+ var self = this;
11487
11488
  var _parsedStyle$wordWrap2 = parsedStyle.wordWrapWidth,
11488
11489
  wordWrapWidth = _parsedStyle$wordWrap2 === void 0 ? 0 : _parsedStyle$wordWrap2,
11489
11490
  _parsedStyle$letterSp2 = parsedStyle.letterSpacing,
@@ -11519,6 +11520,9 @@ var TextService = /*#__PURE__*/function () {
11519
11520
  */
11520
11521
  function findCharIndexClosestWidthThreshold(txt, textCharIndex, widthThreshold) {
11521
11522
  while (calcWidth(txt) < widthThreshold && textCharIndex < chars.length - 1) {
11523
+ if (self.isNewline(chars[textCharIndex + 1])) {
11524
+ break;
11525
+ }
11522
11526
  textCharIndex += 1;
11523
11527
  txt += chars[textCharIndex];
11524
11528
  }