@visactor/vrender-core 0.21.0-alpha.12 → 0.21.0-alpha.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.
Files changed (240) hide show
  1. package/cjs/animate/Ticker/default-ticker.d.ts +2 -4
  2. package/cjs/animate/Ticker/default-ticker.js +5 -8
  3. package/cjs/animate/Ticker/default-ticker.js.map +1 -1
  4. package/cjs/animate/custom-animate.d.ts +0 -2
  5. package/cjs/animate/custom-animate.js +2 -11
  6. package/cjs/animate/custom-animate.js.map +1 -1
  7. package/cjs/color-string/interpolate.js +1 -1
  8. package/cjs/color-string/store.js +1 -1
  9. package/cjs/common/3d-interceptor.js +1 -2
  10. package/cjs/common/canvas-utils.js +1 -0
  11. package/cjs/common/render-command-list.js +1 -2
  12. package/cjs/common/simplify.js +2 -1
  13. package/cjs/common/text.js +1 -1
  14. package/cjs/common/utils.d.ts +0 -1
  15. package/cjs/common/utils.js +3 -10
  16. package/cjs/common/utils.js.map +1 -1
  17. package/cjs/core/contributions/textMeasure/AtextMeasure.d.ts +4 -56
  18. package/cjs/core/contributions/textMeasure/AtextMeasure.js +14 -107
  19. package/cjs/core/contributions/textMeasure/AtextMeasure.js.map +1 -1
  20. package/cjs/core/contributions/textMeasure/layout.d.ts +3 -8
  21. package/cjs/core/contributions/textMeasure/layout.js +44 -50
  22. package/cjs/core/contributions/textMeasure/layout.js.map +1 -1
  23. package/cjs/core/global.d.ts +3 -0
  24. package/cjs/core/global.js +7 -1
  25. package/cjs/core/global.js.map +1 -1
  26. package/cjs/core/stage.d.ts +0 -2
  27. package/cjs/core/stage.js +5 -9
  28. package/cjs/core/stage.js.map +1 -1
  29. package/cjs/graphic/builtin-symbol/arrow.js +2 -2
  30. package/cjs/graphic/builtin-symbol/arrow.js.map +1 -1
  31. package/cjs/graphic/builtin-symbol/arrow2-down.js +2 -2
  32. package/cjs/graphic/builtin-symbol/arrow2-down.js.map +1 -1
  33. package/cjs/graphic/builtin-symbol/arrow2-left.js +2 -2
  34. package/cjs/graphic/builtin-symbol/arrow2-left.js.map +1 -1
  35. package/cjs/graphic/builtin-symbol/arrow2-right.js +2 -2
  36. package/cjs/graphic/builtin-symbol/arrow2-right.js.map +1 -1
  37. package/cjs/graphic/builtin-symbol/arrow2-up.js +2 -2
  38. package/cjs/graphic/builtin-symbol/arrow2-up.js.map +1 -1
  39. package/cjs/graphic/builtin-symbol/base.d.ts +0 -1
  40. package/cjs/graphic/builtin-symbol/base.js +0 -3
  41. package/cjs/graphic/builtin-symbol/base.js.map +1 -1
  42. package/cjs/graphic/builtin-symbol/circle.js +3 -3
  43. package/cjs/graphic/builtin-symbol/circle.js.map +1 -1
  44. package/cjs/graphic/builtin-symbol/close.js +3 -3
  45. package/cjs/graphic/builtin-symbol/close.js.map +1 -1
  46. package/cjs/graphic/builtin-symbol/cross.js +2 -2
  47. package/cjs/graphic/builtin-symbol/cross.js.map +1 -1
  48. package/cjs/graphic/builtin-symbol/diamond.js +3 -3
  49. package/cjs/graphic/builtin-symbol/diamond.js.map +1 -1
  50. package/cjs/graphic/builtin-symbol/line-h.js +3 -3
  51. package/cjs/graphic/builtin-symbol/line-h.js.map +1 -1
  52. package/cjs/graphic/builtin-symbol/line-v.js +3 -3
  53. package/cjs/graphic/builtin-symbol/line-v.js.map +1 -1
  54. package/cjs/graphic/builtin-symbol/square.js +2 -2
  55. package/cjs/graphic/builtin-symbol/square.js.map +1 -1
  56. package/cjs/graphic/builtin-symbol/star.js +2 -2
  57. package/cjs/graphic/builtin-symbol/star.js.map +1 -1
  58. package/cjs/graphic/builtin-symbol/stroke.js +2 -2
  59. package/cjs/graphic/builtin-symbol/stroke.js.map +1 -1
  60. package/cjs/graphic/builtin-symbol/thin-triangle.js +2 -2
  61. package/cjs/graphic/builtin-symbol/thin-triangle.js.map +1 -1
  62. package/cjs/graphic/builtin-symbol/triangle-down.js +2 -2
  63. package/cjs/graphic/builtin-symbol/triangle-down.js.map +1 -1
  64. package/cjs/graphic/builtin-symbol/triangle-left.js +2 -2
  65. package/cjs/graphic/builtin-symbol/triangle-left.js.map +1 -1
  66. package/cjs/graphic/builtin-symbol/triangle-right.js +2 -2
  67. package/cjs/graphic/builtin-symbol/triangle-right.js.map +1 -1
  68. package/cjs/graphic/builtin-symbol/triangle-up.js +2 -2
  69. package/cjs/graphic/builtin-symbol/triangle-up.js.map +1 -1
  70. package/cjs/graphic/builtin-symbol/utils.d.ts +0 -1
  71. package/cjs/graphic/builtin-symbol/utils.js +3 -6
  72. package/cjs/graphic/builtin-symbol/utils.js.map +1 -1
  73. package/cjs/graphic/builtin-symbol/wedge.js +2 -2
  74. package/cjs/graphic/builtin-symbol/wedge.js.map +1 -1
  75. package/cjs/graphic/builtin-symbol/wye.js +2 -2
  76. package/cjs/graphic/builtin-symbol/wye.js.map +1 -1
  77. package/cjs/graphic/config.d.ts +1 -1
  78. package/cjs/graphic/config.js +3 -7
  79. package/cjs/graphic/config.js.map +1 -1
  80. package/cjs/graphic/richtext/paragraph.js +1 -3
  81. package/cjs/graphic/richtext/paragraph.js.map +1 -1
  82. package/cjs/graphic/text.d.ts +11 -11
  83. package/cjs/graphic/text.js +170 -104
  84. package/cjs/graphic/text.js.map +1 -1
  85. package/cjs/graphic/wrap-text.js +4 -16
  86. package/cjs/graphic/wrap-text.js.map +1 -1
  87. package/cjs/interface/animate.d.ts +1 -3
  88. package/cjs/interface/animate.js.map +1 -1
  89. package/cjs/interface/context.d.ts +0 -1
  90. package/cjs/interface/context.js.map +1 -1
  91. package/cjs/interface/global.d.ts +1 -0
  92. package/cjs/interface/global.js.map +1 -1
  93. package/cjs/interface/graphic/text.d.ts +3 -11
  94. package/cjs/interface/graphic/text.js +1 -6
  95. package/cjs/interface/graphic/text.js.map +1 -1
  96. package/cjs/interface/graphic.d.ts +0 -1
  97. package/cjs/interface/graphic.js.map +1 -1
  98. package/cjs/interface/stage.d.ts +0 -1
  99. package/cjs/interface/stage.js.map +1 -1
  100. package/cjs/interface/text.d.ts +1 -9
  101. package/cjs/interface/text.js.map +1 -1
  102. package/cjs/render/contributions/render/contributions/arc-contribution-render.js +2 -2
  103. package/cjs/render/contributions/render/contributions/arc-contribution-render.js.map +1 -1
  104. package/cjs/render/contributions/render/contributions/circle-contribution-render.js +2 -2
  105. package/cjs/render/contributions/render/contributions/circle-contribution-render.js.map +1 -1
  106. package/cjs/render/contributions/render/contributions/image-contribution-render.d.ts +1 -1
  107. package/cjs/render/contributions/render/contributions/image-contribution-render.js +3 -2
  108. package/cjs/render/contributions/render/contributions/image-contribution-render.js.map +1 -1
  109. package/cjs/render/contributions/render/contributions/rect-contribution-render.js +2 -2
  110. package/cjs/render/contributions/render/contributions/rect-contribution-render.js.map +1 -1
  111. package/cjs/render/contributions/render/contributions/symbol-contribution-render.js +2 -2
  112. package/cjs/render/contributions/render/contributions/symbol-contribution-render.js.map +1 -1
  113. package/cjs/render/contributions/render/image-render.js +6 -4
  114. package/cjs/render/contributions/render/image-render.js.map +1 -1
  115. package/cjs/render/contributions/render/text-render.d.ts +1 -1
  116. package/cjs/render/contributions/render/text-render.js +46 -24
  117. package/cjs/render/contributions/render/text-render.js.map +1 -1
  118. package/cjs/resource-loader/loader.js +1 -1
  119. package/cjs/resource-loader/loader.js.map +1 -1
  120. package/dist/index.es.js +549 -568
  121. package/es/animate/Ticker/default-ticker.d.ts +2 -4
  122. package/es/animate/Ticker/default-ticker.js +6 -9
  123. package/es/animate/Ticker/default-ticker.js.map +1 -1
  124. package/es/animate/custom-animate.d.ts +0 -2
  125. package/es/animate/custom-animate.js +2 -11
  126. package/es/animate/custom-animate.js.map +1 -1
  127. package/es/color-string/interpolate.js +1 -1
  128. package/es/color-string/store.js +1 -1
  129. package/es/common/3d-interceptor.js +1 -2
  130. package/es/common/canvas-utils.js +2 -1
  131. package/es/common/render-command-list.js +1 -2
  132. package/es/common/simplify.js +2 -1
  133. package/es/common/text.js +1 -1
  134. package/es/common/utils.d.ts +0 -1
  135. package/es/common/utils.js +2 -7
  136. package/es/common/utils.js.map +1 -1
  137. package/es/core/contributions/textMeasure/AtextMeasure.d.ts +4 -56
  138. package/es/core/contributions/textMeasure/AtextMeasure.js +13 -108
  139. package/es/core/contributions/textMeasure/AtextMeasure.js.map +1 -1
  140. package/es/core/contributions/textMeasure/layout.d.ts +3 -8
  141. package/es/core/contributions/textMeasure/layout.js +44 -50
  142. package/es/core/contributions/textMeasure/layout.js.map +1 -1
  143. package/es/core/global.d.ts +3 -0
  144. package/es/core/global.js +8 -1
  145. package/es/core/global.js.map +1 -1
  146. package/es/core/stage.d.ts +0 -2
  147. package/es/core/stage.js +5 -9
  148. package/es/core/stage.js.map +1 -1
  149. package/es/graphic/builtin-symbol/arrow.js +2 -2
  150. package/es/graphic/builtin-symbol/arrow.js.map +1 -1
  151. package/es/graphic/builtin-symbol/arrow2-down.js +2 -2
  152. package/es/graphic/builtin-symbol/arrow2-down.js.map +1 -1
  153. package/es/graphic/builtin-symbol/arrow2-left.js +2 -2
  154. package/es/graphic/builtin-symbol/arrow2-left.js.map +1 -1
  155. package/es/graphic/builtin-symbol/arrow2-right.js +2 -2
  156. package/es/graphic/builtin-symbol/arrow2-right.js.map +1 -1
  157. package/es/graphic/builtin-symbol/arrow2-up.js +2 -2
  158. package/es/graphic/builtin-symbol/arrow2-up.js.map +1 -1
  159. package/es/graphic/builtin-symbol/base.d.ts +0 -1
  160. package/es/graphic/builtin-symbol/base.js +0 -3
  161. package/es/graphic/builtin-symbol/base.js.map +1 -1
  162. package/es/graphic/builtin-symbol/circle.js +3 -3
  163. package/es/graphic/builtin-symbol/circle.js.map +1 -1
  164. package/es/graphic/builtin-symbol/close.js +3 -3
  165. package/es/graphic/builtin-symbol/close.js.map +1 -1
  166. package/es/graphic/builtin-symbol/cross.js +2 -2
  167. package/es/graphic/builtin-symbol/cross.js.map +1 -1
  168. package/es/graphic/builtin-symbol/diamond.js +3 -3
  169. package/es/graphic/builtin-symbol/diamond.js.map +1 -1
  170. package/es/graphic/builtin-symbol/line-h.js +3 -3
  171. package/es/graphic/builtin-symbol/line-h.js.map +1 -1
  172. package/es/graphic/builtin-symbol/line-v.js +3 -3
  173. package/es/graphic/builtin-symbol/line-v.js.map +1 -1
  174. package/es/graphic/builtin-symbol/square.js +2 -2
  175. package/es/graphic/builtin-symbol/square.js.map +1 -1
  176. package/es/graphic/builtin-symbol/star.js +2 -2
  177. package/es/graphic/builtin-symbol/star.js.map +1 -1
  178. package/es/graphic/builtin-symbol/stroke.js +2 -2
  179. package/es/graphic/builtin-symbol/stroke.js.map +1 -1
  180. package/es/graphic/builtin-symbol/thin-triangle.js +2 -2
  181. package/es/graphic/builtin-symbol/thin-triangle.js.map +1 -1
  182. package/es/graphic/builtin-symbol/triangle-down.js +2 -2
  183. package/es/graphic/builtin-symbol/triangle-down.js.map +1 -1
  184. package/es/graphic/builtin-symbol/triangle-left.js +2 -2
  185. package/es/graphic/builtin-symbol/triangle-left.js.map +1 -1
  186. package/es/graphic/builtin-symbol/triangle-right.js +2 -2
  187. package/es/graphic/builtin-symbol/triangle-right.js.map +1 -1
  188. package/es/graphic/builtin-symbol/triangle-up.js +2 -2
  189. package/es/graphic/builtin-symbol/triangle-up.js.map +1 -1
  190. package/es/graphic/builtin-symbol/utils.d.ts +0 -1
  191. package/es/graphic/builtin-symbol/utils.js +4 -7
  192. package/es/graphic/builtin-symbol/utils.js.map +1 -1
  193. package/es/graphic/builtin-symbol/wedge.js +2 -2
  194. package/es/graphic/builtin-symbol/wedge.js.map +1 -1
  195. package/es/graphic/builtin-symbol/wye.js +2 -2
  196. package/es/graphic/builtin-symbol/wye.js.map +1 -1
  197. package/es/graphic/config.d.ts +1 -1
  198. package/es/graphic/config.js +2 -8
  199. package/es/graphic/config.js.map +1 -1
  200. package/es/graphic/richtext/paragraph.js +2 -4
  201. package/es/graphic/richtext/paragraph.js.map +1 -1
  202. package/es/graphic/text.d.ts +11 -11
  203. package/es/graphic/text.js +165 -103
  204. package/es/graphic/text.js.map +1 -1
  205. package/es/graphic/wrap-text.js +4 -16
  206. package/es/graphic/wrap-text.js.map +1 -1
  207. package/es/interface/animate.d.ts +1 -3
  208. package/es/interface/animate.js.map +1 -1
  209. package/es/interface/context.d.ts +0 -1
  210. package/es/interface/context.js.map +1 -1
  211. package/es/interface/global.d.ts +1 -0
  212. package/es/interface/global.js.map +1 -1
  213. package/es/interface/graphic/text.d.ts +3 -11
  214. package/es/interface/graphic/text.js +1 -6
  215. package/es/interface/graphic/text.js.map +1 -1
  216. package/es/interface/graphic.d.ts +0 -1
  217. package/es/interface/graphic.js.map +1 -1
  218. package/es/interface/stage.d.ts +0 -1
  219. package/es/interface/stage.js.map +1 -1
  220. package/es/interface/text.d.ts +1 -9
  221. package/es/interface/text.js.map +1 -1
  222. package/es/render/contributions/render/contributions/arc-contribution-render.js +2 -2
  223. package/es/render/contributions/render/contributions/arc-contribution-render.js.map +1 -1
  224. package/es/render/contributions/render/contributions/circle-contribution-render.js +2 -2
  225. package/es/render/contributions/render/contributions/circle-contribution-render.js.map +1 -1
  226. package/es/render/contributions/render/contributions/image-contribution-render.d.ts +1 -1
  227. package/es/render/contributions/render/contributions/image-contribution-render.js +3 -2
  228. package/es/render/contributions/render/contributions/image-contribution-render.js.map +1 -1
  229. package/es/render/contributions/render/contributions/rect-contribution-render.js +2 -2
  230. package/es/render/contributions/render/contributions/rect-contribution-render.js.map +1 -1
  231. package/es/render/contributions/render/contributions/symbol-contribution-render.js +2 -2
  232. package/es/render/contributions/render/contributions/symbol-contribution-render.js.map +1 -1
  233. package/es/render/contributions/render/image-render.js +6 -4
  234. package/es/render/contributions/render/image-render.js.map +1 -1
  235. package/es/render/contributions/render/text-render.d.ts +1 -1
  236. package/es/render/contributions/render/text-render.js +45 -23
  237. package/es/render/contributions/render/text-render.js.map +1 -1
  238. package/es/resource-loader/loader.js +1 -1
  239. package/es/resource-loader/loader.js.map +1 -1
  240. package/package.json +3 -4
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: !0
5
5
  }), exports.createText = exports.Text = void 0;
6
6
 
7
- const vutils_1 = require("@visactor/vutils"), text_1 = require("../common/text"), layout_1 = require("../core/contributions/textMeasure/layout"), application_1 = require("../application"), graphic_1 = require("./graphic"), theme_1 = require("./theme"), utils_1 = require("../common/utils"), constants_1 = require("./constants"), tools_1 = require("./tools"), TEXT_UPDATE_TAG_KEY = [ "text", "maxLineWidth", "maxWidth", "textAlign", "textBaseline", "heightLimit", "lineClamp", "fontSize", "fontFamily", "fontWeight", "ellipsis", "lineHeight", "direction", "wordBreak", "heightLimit", "lineClamp", ...graphic_1.GRAPHIC_UPDATE_TAG_KEY ];
7
+ const vutils_1 = require("@visactor/vutils"), text_1 = require("../common/text"), layout_1 = require("../core/contributions/textMeasure/layout"), application_1 = require("../application"), graphic_1 = require("./graphic"), theme_1 = require("./theme"), utils_1 = require("../common/utils"), constants_1 = require("./constants"), tools_1 = require("./tools"), TEXT_UPDATE_TAG_KEY = [ "text", "maxLineWidth", "textAlign", "textBaseline", "heightLimit", "lineClamp", "fontSize", "fontFamily", "fontWeight", "ellipsis", "lineHeight", "direction", "wordBreak", "heightLimit", "lineClamp", ...graphic_1.GRAPHIC_UPDATE_TAG_KEY ];
8
8
 
9
9
  class Text extends graphic_1.Graphic {
10
10
  get font() {
@@ -14,17 +14,18 @@ class Text extends graphic_1.Graphic {
14
14
  }
15
15
  get clipedText() {
16
16
  var _a;
17
- const attribute = this.attribute, textTheme = this.getGraphicTheme(), maxWidth = this.getMaxWidth(textTheme);
18
- return Number.isFinite(maxWidth) ? (this.tryUpdateAABBBounds(), this.cache.clipedText) : (null !== (_a = attribute.text) && void 0 !== _a ? _a : textTheme.text).toString();
17
+ const attribute = this.attribute, textTheme = this.getGraphicTheme();
18
+ if (!this.isSimplify()) return;
19
+ const {maxLineWidth: maxLineWidth = textTheme.maxLineWidth} = attribute;
20
+ return Number.isFinite(maxLineWidth) ? (this.tryUpdateAABBBounds(), this.cache.clipedText) : (null !== (_a = attribute.text) && void 0 !== _a ? _a : textTheme.text).toString();
19
21
  }
20
22
  get clipedWidth() {
21
- return this.tryUpdateAABBBounds(), this.cache.clipedWidth;
23
+ if (this.isSimplify()) return this.tryUpdateAABBBounds(), this.cache.clipedWidth;
22
24
  }
23
25
  get cliped() {
24
26
  var _a, _b;
25
- const textTheme = this.getGraphicTheme(), attribute = this.attribute, maxWidth = this.getMaxWidth(textTheme);
26
- if (!Number.isFinite(maxWidth)) return !1;
27
- const {text: text} = this.attribute;
27
+ const textTheme = this.getGraphicTheme(), attribute = this.attribute, {maxLineWidth: maxLineWidth = textTheme.maxLineWidth, text: text, whiteSpace: whiteSpace = textTheme.whiteSpace} = attribute;
28
+ if (!Number.isFinite(maxLineWidth)) return !1;
28
29
  if (this.tryUpdateAABBBounds(), null === (_b = null === (_a = this.cache) || void 0 === _a ? void 0 : _a.layoutData) || void 0 === _b ? void 0 : _b.lines) {
29
30
  let mergedText = "";
30
31
  this.cache.layoutData.lines.forEach((item => {
@@ -35,7 +36,10 @@ class Text extends graphic_1.Graphic {
35
36
  return "vertical" === attribute.direction && this.cache.verticalList && this.cache.verticalList[0] ? this.cache.verticalList[0].map((item => item.text)).join("") !== attribute.text.toString() : null != this.clipedText && this.clipedText !== attribute.text.toString();
36
37
  }
37
38
  get multilineLayout() {
38
- return this.tryUpdateAABBBounds(), this.cache.layoutData;
39
+ if (this.isMultiLine) return this.tryUpdateAABBBounds(), this.cache.layoutData;
40
+ }
41
+ isSimplify() {
42
+ return !this.isMultiLine && "vertical" !== this.attribute.direction;
39
43
  }
40
44
  get isMultiLine() {
41
45
  return Array.isArray(this.attribute.text) || "normal" === this.attribute.whiteSpace;
@@ -91,61 +95,20 @@ class Text extends graphic_1.Graphic {
91
95
  (0, vutils_1.transformBoundsWithMatrix)(aabbBounds, aabbBounds, this.transMatrix),
92
96
  aabbBounds;
93
97
  }
94
- updateSingallineAABBBounds(text) {
95
- this.updateMultilineAABBBounds([ text ]);
96
- const layoutData = this.cache.layoutData;
97
- if (layoutData && layoutData.lines && layoutData.lines.length) {
98
- const line = layoutData.lines[0];
99
- this.cache.clipedText = line.str, this.cache.clipedWidth = line.width;
100
- }
101
- return this._AABBBounds;
102
- }
103
- updateMultilineAABBBounds(text) {
104
- const textTheme = this.getGraphicTheme(), {direction: direction = textTheme.direction, underlineOffset: underlineOffset = textTheme.underlineOffset} = this.attribute, b = "horizontal" === direction ? this.updateHorizontalMultilineAABBBounds(text) : this.updateVerticalMultilineAABBBounds(text);
105
- return "horizontal" === direction && underlineOffset && this._AABBBounds.add(this._AABBBounds.x1, this._AABBBounds.y2 + underlineOffset),
106
- b;
107
- }
108
- guessLineHeightBuf(fontSize) {
109
- return fontSize ? .1 * fontSize : 0;
110
- }
111
- updateHorizontalMultilineAABBBounds(text) {
112
- var _a;
113
- const textTheme = this.getGraphicTheme(), attribute = this.attribute, {fontFamily: fontFamily = textTheme.fontFamily, textAlign: textAlign = textTheme.textAlign, textBaseline: textBaseline = textTheme.textBaseline, fontSize: fontSize = textTheme.fontSize, fontWeight: fontWeight = textTheme.fontWeight, ellipsis: ellipsis = textTheme.ellipsis, maxLineWidth: maxLineWidth, stroke: stroke = textTheme.stroke, wrap: wrap = textTheme.wrap, measureMode: measureMode = textTheme.measureMode, lineWidth: lineWidth = textTheme.lineWidth, whiteSpace: whiteSpace = textTheme.whiteSpace, suffixPosition: suffixPosition = textTheme.suffixPosition, ignoreBuf: ignoreBuf = textTheme.ignoreBuf, keepCenterInLine: keepCenterInLine = textTheme.keepCenterInLine} = attribute, buf = ignoreBuf ? 0 : this.guessLineHeightBuf(fontSize), lineHeight = this.getLineHeight(attribute, textTheme, buf);
114
- if ("normal" === whiteSpace || wrap) return this.updateWrapAABBBounds(text);
115
- if (!this.shouldUpdateShape() && (null === (_a = this.cache) || void 0 === _a ? void 0 : _a.layoutData)) {
116
- const bbox = this.cache.layoutData.bbox;
117
- return this._AABBBounds.set(bbox.xOffset, bbox.yOffset, bbox.xOffset + bbox.width, bbox.yOffset + bbox.height),
118
- stroke && this._AABBBounds.expand(lineWidth / 2), this._AABBBounds;
119
- }
120
- const textMeasure = application_1.application.graphicUtil.textMeasure, layoutData = new layout_1.CanvasTextLayout(fontFamily, {
121
- fontSize: fontSize,
122
- fontWeight: fontWeight,
123
- fontFamily: fontFamily,
124
- lineHeight: lineHeight
125
- }, textMeasure).GetLayoutByLines(text, textAlign, textBaseline, lineHeight, !0 === ellipsis ? textTheme.ellipsis : ellipsis || void 0, !1, {
126
- lineWidth: maxLineWidth,
127
- suffixPosition: suffixPosition,
128
- measureMode: measureMode,
129
- keepCenterInLine: keepCenterInLine
130
- }), {bbox: bbox} = layoutData;
131
- return this.cache.layoutData = layoutData, this.clearUpdateShapeTag(), this._AABBBounds.set(bbox.xOffset, bbox.yOffset, bbox.xOffset + bbox.width, bbox.yOffset + bbox.height),
132
- stroke && this._AABBBounds.expand(lineWidth / 2), this._AABBBounds;
133
- }
134
98
  updateWrapAABBBounds(text) {
135
- var _a, _b, _c;
136
- const textTheme = this.getGraphicTheme(), {fontFamily: fontFamily = textTheme.fontFamily, textAlign: textAlign = textTheme.textAlign, textBaseline: textBaseline = textTheme.textBaseline, fontSize: fontSize = textTheme.fontSize, ellipsis: ellipsis = textTheme.ellipsis, maxLineWidth: maxLineWidth, stroke: stroke = textTheme.stroke, lineWidth: lineWidth = textTheme.lineWidth, wordBreak: wordBreak = textTheme.wordBreak, fontWeight: fontWeight = textTheme.fontWeight, ignoreBuf: ignoreBuf = textTheme.ignoreBuf, measureMode: measureMode = textTheme.measureMode, suffixPosition: suffixPosition = textTheme.suffixPosition, heightLimit: heightLimit = 0, lineClamp: lineClamp, keepCenterInLine: keepCenterInLine = textTheme.keepCenterInLine} = this.attribute, buf = ignoreBuf ? 0 : this.guessLineHeightBuf(fontSize), lineHeight = this.getLineHeight(this.attribute, textTheme, buf);
137
- if (!this.shouldUpdateShape() && (null === (_a = this.cache) || void 0 === _a ? void 0 : _a.layoutData)) {
99
+ var _a, _b, _c, _d;
100
+ const textTheme = this.getGraphicTheme(), {fontFamily: fontFamily = textTheme.fontFamily, textAlign: textAlign = textTheme.textAlign, textBaseline: textBaseline = textTheme.textBaseline, fontSize: fontSize = textTheme.fontSize, ellipsis: ellipsis = textTheme.ellipsis, maxLineWidth: maxLineWidth, stroke: stroke = textTheme.stroke, lineWidth: lineWidth = textTheme.lineWidth, wordBreak: wordBreak = textTheme.wordBreak, fontWeight: fontWeight = textTheme.fontWeight, ignoreBuf: ignoreBuf = textTheme.ignoreBuf, suffixPosition: suffixPosition = textTheme.suffixPosition, heightLimit: heightLimit = 0, lineClamp: lineClamp} = this.attribute, lineHeight = null !== (_a = (0,
101
+ utils_1.calculateLineHeight)(this.attribute.lineHeight, this.attribute.fontSize || textTheme.fontSize)) && void 0 !== _a ? _a : this.attribute.fontSize || textTheme.fontSize, buf = ignoreBuf ? 0 : 2;
102
+ if (!this.shouldUpdateShape() && (null === (_b = this.cache) || void 0 === _b ? void 0 : _b.layoutData)) {
138
103
  const bbox = this.cache.layoutData.bbox;
139
104
  return this._AABBBounds.set(bbox.xOffset, bbox.yOffset, bbox.xOffset + bbox.width, bbox.yOffset + bbox.height),
140
105
  stroke && this._AABBBounds.expand(lineWidth / 2), this._AABBBounds;
141
106
  }
142
- const textMeasure = application_1.application.graphicUtil.textMeasure, textOptions = {
107
+ const textMeasure = application_1.application.graphicUtil.textMeasure, layoutObj = new layout_1.CanvasTextLayout(fontFamily, {
143
108
  fontSize: fontSize,
144
109
  fontWeight: fontWeight,
145
- fontFamily: fontFamily,
146
- lineHeight: lineHeight
147
- }, layoutObj = new layout_1.CanvasTextLayout(fontFamily, textOptions, textMeasure), lines = (0,
148
- vutils_1.isArray)(text) ? text.map((l => l.toString())) : [ text.toString() ], linesLayout = [], bboxWH = [ 0, 0 ];
110
+ fontFamily: fontFamily
111
+ }, textMeasure), lines = (0, vutils_1.isArray)(text) ? text.map((l => l.toString())) : [ text.toString() ], linesLayout = [], bboxWH = [ 0, 0 ];
149
112
  let lineCountLimit = 1 / 0;
150
113
  if (heightLimit > 0 && (lineCountLimit = Math.max(Math.floor(heightLimit / lineHeight), 1)),
151
114
  lineClamp && (lineCountLimit = Math.min(lineCountLimit, lineClamp)), "number" == typeof maxLineWidth && maxLineWidth !== 1 / 0) {
@@ -153,37 +116,30 @@ class Text extends graphic_1.Graphic {
153
116
  const str = lines[i];
154
117
  let needCut = !0;
155
118
  if (i === lineCountLimit - 1) {
156
- const clip = textMeasure.clipTextWithSuffix(str, textOptions, maxLineWidth, ellipsis, !1, suffixPosition, i !== lines.length - 1), matrics = textMeasure.measureTextPixelADscentAndWidth(clip.str, textOptions, measureMode);
119
+ const clip = layoutObj.textMeasure.clipTextWithSuffix(str, layoutObj.textOptions, maxLineWidth, ellipsis, !1, suffixPosition, i !== lines.length - 1);
157
120
  linesLayout.push({
158
121
  str: clip.str,
159
- width: clip.width,
160
- ascent: matrics.ascent,
161
- descent: matrics.descent,
162
- keepCenterInLine: keepCenterInLine
122
+ width: clip.width
163
123
  });
164
124
  break;
165
125
  }
166
- const clip = textMeasure.clipText(str, textOptions, maxLineWidth, "break-all" !== wordBreak, "keep-all" === wordBreak);
126
+ const clip = layoutObj.textMeasure.clipText(str, layoutObj.textOptions, maxLineWidth, "break-all" !== wordBreak, "keep-all" === wordBreak);
167
127
  if ("" !== str && "" === clip.str || clip.wordBreaked) {
168
128
  if (ellipsis) {
169
- const clipEllipsis = textMeasure.clipTextWithSuffix(str, textOptions, maxLineWidth, ellipsis, !1, suffixPosition);
170
- clip.str = null !== (_b = clipEllipsis.str) && void 0 !== _b ? _b : "", clip.width = null !== (_c = clipEllipsis.width) && void 0 !== _c ? _c : 0;
129
+ const clipEllipsis = layoutObj.textMeasure.clipTextWithSuffix(str, layoutObj.textOptions, maxLineWidth, ellipsis, !1, suffixPosition);
130
+ clip.str = null !== (_c = clipEllipsis.str) && void 0 !== _c ? _c : "", clip.width = null !== (_d = clipEllipsis.width) && void 0 !== _d ? _d : 0;
171
131
  } else clip.str = "", clip.width = 0;
172
132
  needCut = !1;
173
133
  }
174
- const matrics = textMeasure.measureTextPixelADscentAndWidth(clip.str, textOptions, measureMode);
175
134
  linesLayout.push({
176
135
  str: clip.str,
177
- width: clip.width,
178
- ascent: matrics.ascent,
179
- descent: matrics.descent,
180
- keepCenterInLine: keepCenterInLine
136
+ width: clip.width
181
137
  });
182
138
  let cutLength = clip.str.length;
183
139
  if (!clip.wordBreaked || "" !== str && "" === clip.str || (needCut = !0, cutLength = clip.wordBreaked),
184
140
  clip.str.length === str.length) ; else if (needCut) {
185
- const newStr = str.substring(cutLength);
186
- lines.splice(i + 1, 0, newStr);
141
+ let newStr = str.substring(cutLength);
142
+ "keep-all" === wordBreak && (newStr = newStr.replace(/^\s+/g, "")), lines.splice(i + 1, 0, newStr);
187
143
  }
188
144
  }
189
145
  let maxWidth = 0;
@@ -194,50 +150,175 @@ class Text extends graphic_1.Graphic {
194
150
  let width, text, lineWidth = 0;
195
151
  for (let i = 0, len = lines.length; i < len; i++) {
196
152
  if (i === lineCountLimit - 1) {
197
- const clip = textMeasure.clipTextWithSuffix(lines[i], textOptions, maxLineWidth, ellipsis, !1, suffixPosition), matrics = textMeasure.measureTextPixelADscentAndWidth(clip.str, textOptions, measureMode);
153
+ const clip = layoutObj.textMeasure.clipTextWithSuffix(lines[i], layoutObj.textOptions, maxLineWidth, ellipsis, !1, suffixPosition);
198
154
  linesLayout.push({
199
155
  str: clip.str,
200
- width: clip.width,
201
- ascent: matrics.ascent,
202
- descent: matrics.descent,
203
- keepCenterInLine: keepCenterInLine
156
+ width: clip.width
204
157
  }), lineWidth = Math.max(lineWidth, clip.width);
205
158
  break;
206
159
  }
207
- text = lines[i], width = textMeasure.measureTextWidth(text, textOptions), lineWidth = Math.max(lineWidth, width);
208
- const matrics = textMeasure.measureTextPixelADscentAndWidth(text, textOptions, measureMode);
209
- linesLayout.push({
160
+ text = lines[i], width = layoutObj.textMeasure.measureTextWidth(text, layoutObj.textOptions, "break-word" === wordBreak),
161
+ lineWidth = Math.max(lineWidth, width), linesLayout.push({
210
162
  str: text,
211
- width: width,
212
- ascent: matrics.ascent,
213
- descent: matrics.descent,
214
- keepCenterInLine: keepCenterInLine
163
+ width: width
215
164
  });
216
165
  }
217
166
  bboxWH[0] = lineWidth;
218
167
  }
219
- bboxWH[1] = linesLayout.length * lineHeight;
168
+ bboxWH[1] = linesLayout.length * (lineHeight + buf);
220
169
  const bbox = {
221
170
  xOffset: 0,
222
171
  yOffset: 0,
223
172
  width: bboxWH[0],
224
173
  height: bboxWH[1]
225
174
  };
226
- layoutObj.LayoutBBox(bbox, textAlign, textBaseline, linesLayout);
175
+ layoutObj.LayoutBBox(bbox, textAlign, textBaseline);
227
176
  const layoutData = layoutObj.layoutWithBBox(bbox, linesLayout, textAlign, textBaseline, lineHeight);
228
177
  return this.cache.layoutData = layoutData, this.clearUpdateShapeTag(), this._AABBBounds.set(bbox.xOffset, bbox.yOffset, bbox.xOffset + bbox.width, bbox.yOffset + bbox.height),
229
178
  stroke && this._AABBBounds.expand(lineWidth / 2), this._AABBBounds;
230
179
  }
231
- updateVerticalMultilineAABBBounds(text) {
180
+ updateSingallineAABBBounds(text) {
181
+ const textTheme = this.getGraphicTheme(), {direction: direction = textTheme.direction, underlineOffset: underlineOffset = textTheme.underlineOffset} = this.attribute, b = "horizontal" === direction ? this.updateHorizontalSinglelineAABBBounds(text) : this.updateVerticalSinglelineAABBBounds(text);
182
+ return "horizontal" === direction && underlineOffset && this._AABBBounds.add(this._AABBBounds.x1, this._AABBBounds.y2 + underlineOffset),
183
+ b;
184
+ }
185
+ updateMultilineAABBBounds(text) {
186
+ const textTheme = this.getGraphicTheme(), {direction: direction = textTheme.direction, underlineOffset: underlineOffset = textTheme.underlineOffset} = this.attribute, b = "horizontal" === direction ? this.updateHorizontalMultilineAABBBounds(text) : this.updateVerticalMultilineAABBBounds(text);
187
+ return "horizontal" === direction && underlineOffset && this._AABBBounds.add(this._AABBBounds.x1, this._AABBBounds.y2 + underlineOffset),
188
+ b;
189
+ }
190
+ updateHorizontalSinglelineAABBBounds(text) {
191
+ var _a, _b;
192
+ const textTheme = this.getGraphicTheme(), {wrap: wrap = textTheme.wrap} = this.attribute;
193
+ if (wrap) return this.updateWrapAABBBounds([ text ]);
194
+ const textMeasure = application_1.application.graphicUtil.textMeasure;
195
+ let width, str;
196
+ const attribute = this.attribute, {maxLineWidth: maxLineWidth = textTheme.maxLineWidth, ellipsis: ellipsis = textTheme.ellipsis, textAlign: textAlign = textTheme.textAlign, textBaseline: textBaseline = textTheme.textBaseline, fontFamily: fontFamily = textTheme.fontFamily, fontSize: fontSize = textTheme.fontSize, fontWeight: fontWeight = textTheme.fontWeight, stroke: stroke = textTheme.stroke, lineWidth: lineWidth = textTheme.lineWidth, ignoreBuf: ignoreBuf = textTheme.ignoreBuf, whiteSpace: whiteSpace = textTheme.whiteSpace, suffixPosition: suffixPosition = textTheme.suffixPosition} = attribute;
197
+ if ("normal" === whiteSpace) return this.updateWrapAABBBounds(text);
198
+ const buf = ignoreBuf ? 0 : Math.max(2, .075 * fontSize), textFontSize = attribute.fontSize || textTheme.fontSize, lineHeight = null !== (_a = (0,
199
+ utils_1.calculateLineHeight)(attribute.lineHeight, textFontSize)) && void 0 !== _a ? _a : textFontSize + buf;
200
+ if (!this.shouldUpdateShape() && this.cache) {
201
+ width = null !== (_b = this.cache.clipedWidth) && void 0 !== _b ? _b : 0;
202
+ const dx = (0, text_1.textDrawOffsetX)(textAlign, width), dy = (0, text_1.textLayoutOffsetY)(textBaseline, lineHeight, fontSize);
203
+ return this._AABBBounds.set(dx, dy, dx + width, dy + lineHeight), stroke && this._AABBBounds.expand(lineWidth / 2),
204
+ this._AABBBounds;
205
+ }
206
+ if (Number.isFinite(maxLineWidth)) {
207
+ if (ellipsis) {
208
+ const strEllipsis = !0 === ellipsis ? textTheme.ellipsis : ellipsis, data = textMeasure.clipTextWithSuffix(text.toString(), {
209
+ fontSize: fontSize,
210
+ fontWeight: fontWeight,
211
+ fontFamily: fontFamily
212
+ }, maxLineWidth, strEllipsis, !1, suffixPosition);
213
+ str = data.str, width = data.width;
214
+ } else {
215
+ const data = textMeasure.clipText(text.toString(), {
216
+ fontSize: fontSize,
217
+ fontWeight: fontWeight,
218
+ fontFamily: fontFamily
219
+ }, maxLineWidth, !1);
220
+ str = data.str, width = data.width;
221
+ }
222
+ this.cache.clipedText = str, this.cache.clipedWidth = width;
223
+ } else width = textMeasure.measureTextWidth(text.toString(), {
224
+ fontSize: fontSize,
225
+ fontWeight: fontWeight,
226
+ fontFamily: fontFamily
227
+ }), this.cache.clipedText = text.toString(), this.cache.clipedWidth = width;
228
+ this.clearUpdateShapeTag();
229
+ const dx = (0, text_1.textDrawOffsetX)(textAlign, width);
230
+ let lh = lineHeight;
231
+ application_1.application.global && application_1.application.global.isSafari() && (lh += .2 * fontSize);
232
+ const dy = (0, text_1.textLayoutOffsetY)(textBaseline, lh, fontSize, buf);
233
+ return this._AABBBounds.set(dx, dy, dx + width, dy + lh), stroke && this._AABBBounds.expand(lineWidth / 2),
234
+ this._AABBBounds;
235
+ }
236
+ getBaselineMapAlign() {
237
+ return Text.baselineMapAlign;
238
+ }
239
+ getAlignMapBaseline() {
240
+ return Text.alignMapBaseline;
241
+ }
242
+ updateVerticalSinglelineAABBBounds(text) {
243
+ var _a, _b, _c;
244
+ const textTheme = this.getGraphicTheme(), textMeasure = application_1.application.graphicUtil.textMeasure;
245
+ let width;
246
+ const attribute = this.attribute, {ignoreBuf: ignoreBuf = textTheme.ignoreBuf} = attribute, buf = ignoreBuf ? 0 : 2, {maxLineWidth: maxLineWidth = textTheme.maxLineWidth, ellipsis: ellipsis = textTheme.ellipsis, fontSize: fontSize = textTheme.fontSize, fontWeight: fontWeight = textTheme.fontWeight, fontFamily: fontFamily = textTheme.fontFamily, stroke: stroke = textTheme.stroke, lineWidth: lineWidth = textTheme.lineWidth, verticalMode: verticalMode = textTheme.verticalMode, suffixPosition: suffixPosition = textTheme.suffixPosition} = attribute, lineHeight = null !== (_a = (0,
247
+ utils_1.calculateLineHeight)(attribute.lineHeight, attribute.fontSize || textTheme.fontSize)) && void 0 !== _a ? _a : (attribute.fontSize || textTheme.fontSize) + buf;
248
+ let {textAlign: textAlign = textTheme.textAlign, textBaseline: textBaseline = textTheme.textBaseline} = attribute;
249
+ if (!verticalMode) {
250
+ const t = textAlign;
251
+ textAlign = null !== (_b = Text.baselineMapAlign[textBaseline]) && void 0 !== _b ? _b : "left",
252
+ textBaseline = null !== (_c = Text.alignMapBaseline[t]) && void 0 !== _c ? _c : "top";
253
+ }
254
+ if (!this.shouldUpdateShape() && this.cache) {
255
+ width = this.cache.clipedWidth;
256
+ const dx = (0, text_1.textDrawOffsetX)(textAlign, width), dy = (0, text_1.textLayoutOffsetY)(textBaseline, lineHeight, fontSize);
257
+ return this._AABBBounds.set(dy, dx, dy + lineHeight, dx + width), stroke && this._AABBBounds.expand(lineWidth / 2),
258
+ this._AABBBounds;
259
+ }
260
+ let verticalList = [ (0, tools_1.verticalLayout)(text.toString()) ];
261
+ if (Number.isFinite(maxLineWidth)) {
262
+ if (ellipsis) {
263
+ const strEllipsis = !0 === ellipsis ? textTheme.ellipsis : ellipsis, data = textMeasure.clipTextWithSuffixVertical(verticalList[0], {
264
+ fontSize: fontSize,
265
+ fontWeight: fontWeight,
266
+ fontFamily: fontFamily
267
+ }, maxLineWidth, strEllipsis, !1, suffixPosition);
268
+ verticalList = [ data.verticalList ], width = data.width;
269
+ } else {
270
+ const data = textMeasure.clipTextVertical(verticalList[0], {
271
+ fontSize: fontSize,
272
+ fontWeight: fontWeight,
273
+ fontFamily: fontFamily
274
+ }, maxLineWidth, !1);
275
+ verticalList = [ data.verticalList ], width = data.width;
276
+ }
277
+ this.cache.verticalList = verticalList, this.cache.clipedWidth = width;
278
+ } else width = 0, verticalList[0].forEach((t => {
279
+ const w = t.direction === tools_1.TextDirection.HORIZONTAL ? fontSize : textMeasure.measureTextWidth(t.text, {
280
+ fontSize: fontSize,
281
+ fontWeight: fontWeight,
282
+ fontFamily: fontFamily
283
+ });
284
+ width += w, t.width = w;
285
+ })), this.cache.verticalList = verticalList, this.cache.clipedWidth = width;
286
+ this.clearUpdateShapeTag();
287
+ const dx = (0, text_1.textDrawOffsetX)(textAlign, width), dy = (0, text_1.textLayoutOffsetY)(textBaseline, lineHeight, fontSize);
288
+ return this._AABBBounds.set(dy, dx, dy + lineHeight, dx + width), stroke && this._AABBBounds.expand(lineWidth / 2),
289
+ this._AABBBounds;
290
+ }
291
+ updateHorizontalMultilineAABBBounds(text) {
232
292
  var _a, _b;
293
+ const textTheme = this.getGraphicTheme(), {wrap: wrap = textTheme.wrap} = this.attribute;
294
+ if (wrap) return this.updateWrapAABBBounds(text);
295
+ const attribute = this.attribute, {fontFamily: fontFamily = textTheme.fontFamily, textAlign: textAlign = textTheme.textAlign, textBaseline: textBaseline = textTheme.textBaseline, fontSize: fontSize = textTheme.fontSize, fontWeight: fontWeight = textTheme.fontWeight, ellipsis: ellipsis = textTheme.ellipsis, maxLineWidth: maxLineWidth, stroke: stroke = textTheme.stroke, lineWidth: lineWidth = textTheme.lineWidth, whiteSpace: whiteSpace = textTheme.whiteSpace, suffixPosition: suffixPosition = textTheme.suffixPosition} = attribute, lineHeight = null !== (_a = (0,
296
+ utils_1.calculateLineHeight)(attribute.lineHeight, attribute.fontSize || textTheme.fontSize)) && void 0 !== _a ? _a : attribute.fontSize || textTheme.fontSize;
297
+ if ("normal" === whiteSpace) return this.updateWrapAABBBounds(text);
298
+ if (!this.shouldUpdateShape() && (null === (_b = this.cache) || void 0 === _b ? void 0 : _b.layoutData)) {
299
+ const bbox = this.cache.layoutData.bbox;
300
+ return this._AABBBounds.set(bbox.xOffset, bbox.yOffset, bbox.xOffset + bbox.width, bbox.yOffset + bbox.height),
301
+ stroke && this._AABBBounds.expand(lineWidth / 2), this._AABBBounds;
302
+ }
303
+ const textMeasure = application_1.application.graphicUtil.textMeasure, layoutData = new layout_1.CanvasTextLayout(fontFamily, {
304
+ fontSize: fontSize,
305
+ fontWeight: fontWeight,
306
+ fontFamily: fontFamily
307
+ }, textMeasure).GetLayoutByLines(text, textAlign, textBaseline, lineHeight, !0 === ellipsis ? textTheme.ellipsis : ellipsis || void 0, !1, maxLineWidth, suffixPosition), {bbox: bbox} = layoutData;
308
+ return this.cache.layoutData = layoutData, this.clearUpdateShapeTag(), this._AABBBounds.set(bbox.xOffset, bbox.yOffset, bbox.xOffset + bbox.width, bbox.yOffset + bbox.height),
309
+ stroke && this._AABBBounds.expand(lineWidth / 2), this._AABBBounds;
310
+ }
311
+ updateVerticalMultilineAABBBounds(text) {
312
+ var _a, _b, _c;
233
313
  const textTheme = this.getGraphicTheme(), textMeasure = application_1.application.graphicUtil.textMeasure;
234
314
  let width;
235
- const attribute = this.attribute, {maxLineWidth: maxLineWidth = textTheme.maxLineWidth, ellipsis: ellipsis = textTheme.ellipsis, fontFamily: fontFamily = textTheme.fontFamily, fontSize: fontSize = textTheme.fontSize, fontWeight: fontWeight = textTheme.fontWeight, stroke: stroke = textTheme.stroke, lineWidth: lineWidth = textTheme.lineWidth, verticalMode: verticalMode = textTheme.verticalMode, suffixPosition: suffixPosition = textTheme.suffixPosition} = attribute, lineHeight = this.getLineHeight(attribute, textTheme, 0);
315
+ const attribute = this.attribute, {ignoreBuf: ignoreBuf = textTheme.ignoreBuf} = attribute, buf = ignoreBuf ? 0 : 2, {maxLineWidth: maxLineWidth = textTheme.maxLineWidth, ellipsis: ellipsis = textTheme.ellipsis, fontFamily: fontFamily = textTheme.fontFamily, fontSize: fontSize = textTheme.fontSize, fontWeight: fontWeight = textTheme.fontWeight, stroke: stroke = textTheme.stroke, lineWidth: lineWidth = textTheme.lineWidth, verticalMode: verticalMode = textTheme.verticalMode, suffixPosition: suffixPosition = textTheme.suffixPosition} = attribute, lineHeight = null !== (_a = (0,
316
+ utils_1.calculateLineHeight)(attribute.lineHeight, attribute.fontSize || textTheme.fontSize)) && void 0 !== _a ? _a : (attribute.fontSize || textTheme.fontSize) + buf;
236
317
  let {textAlign: textAlign = textTheme.textAlign, textBaseline: textBaseline = textTheme.textBaseline} = attribute;
237
318
  if (!verticalMode) {
238
319
  const t = textAlign;
239
- textAlign = null !== (_a = Text.baselineMapAlign[textBaseline]) && void 0 !== _a ? _a : "left",
240
- textBaseline = null !== (_b = Text.alignMapBaseline[t]) && void 0 !== _b ? _b : "top";
320
+ textAlign = null !== (_b = Text.baselineMapAlign[textBaseline]) && void 0 !== _b ? _b : "left",
321
+ textBaseline = null !== (_c = Text.alignMapBaseline[t]) && void 0 !== _c ? _c : "top";
241
322
  }
242
323
  if (width = 0, !this.shouldUpdateShape() && this.cache) {
243
324
  this.cache.verticalList.forEach((item => {
@@ -282,15 +363,6 @@ class Text extends graphic_1.Graphic {
282
363
  return this._AABBBounds.set(dy, dx, dy + height, dx + width), stroke && this._AABBBounds.expand(lineWidth / 2),
283
364
  this._AABBBounds;
284
365
  }
285
- getMaxWidth(theme) {
286
- var _a, _b;
287
- const attribute = this.attribute;
288
- return null !== (_b = null !== (_a = attribute.maxLineWidth) && void 0 !== _a ? _a : attribute.maxWidth) && void 0 !== _b ? _b : theme.maxWidth;
289
- }
290
- getLineHeight(attribute, textTheme, buf) {
291
- var _a;
292
- return null !== (_a = (0, utils_1.calculateLineHeight)(attribute.lineHeight, attribute.fontSize || textTheme.fontSize)) && void 0 !== _a ? _a : (attribute.fontSize || textTheme.fontSize) + buf;
293
- }
294
366
  needUpdateTags(keys, k = TEXT_UPDATE_TAG_KEY) {
295
367
  return super.needUpdateTags(keys, k);
296
368
  }
@@ -303,12 +375,6 @@ class Text extends graphic_1.Graphic {
303
375
  getNoWorkAnimateAttr() {
304
376
  return Text.NOWORK_ANIMATE_ATTR;
305
377
  }
306
- getBaselineMapAlign() {
307
- return Text.baselineMapAlign;
308
- }
309
- getAlignMapBaseline() {
310
- return Text.alignMapBaseline;
311
- }
312
378
  }
313
379
 
314
380
  function createText(attributes) {