@visactor/vrender-core 0.21.0-vstory.2 → 0.21.0

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 (346) hide show
  1. package/cjs/animate/Ticker/default-ticker.d.ts +2 -3
  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/animate.js +1 -1
  5. package/cjs/animate/animate.js.map +1 -1
  6. package/cjs/animate/custom-animate.d.ts +2 -0
  7. package/cjs/animate/custom-animate.js +11 -2
  8. package/cjs/animate/custom-animate.js.map +1 -1
  9. package/cjs/animate/easing.d.ts +0 -3
  10. package/cjs/animate/easing.js +1 -9
  11. package/cjs/animate/easing.js.map +1 -1
  12. package/cjs/color-string/store.js +2 -1
  13. package/cjs/common/3d-interceptor.js +1 -2
  14. package/cjs/common/bezier-utils.d.ts +0 -3
  15. package/cjs/common/bezier-utils.js +2 -17
  16. package/cjs/common/bezier-utils.js.map +1 -1
  17. package/cjs/common/color-utils.js +2 -2
  18. package/cjs/common/color-utils.js.map +1 -1
  19. package/cjs/common/custom-path2d.d.ts +0 -4
  20. package/cjs/common/custom-path2d.js +11 -43
  21. package/cjs/common/custom-path2d.js.map +1 -1
  22. package/cjs/common/render-area.js +1 -0
  23. package/cjs/common/render-command-list.js +1 -2
  24. package/cjs/common/segment/curve/arc.d.ts +1 -4
  25. package/cjs/common/segment/curve/arc.js +1 -10
  26. package/cjs/common/segment/curve/arc.js.map +1 -1
  27. package/cjs/common/segment/curve/base.d.ts +1 -4
  28. package/cjs/common/segment/curve/base.js.map +1 -1
  29. package/cjs/common/segment/curve/cubic-bezier.d.ts +1 -5
  30. package/cjs/common/segment/curve/cubic-bezier.js +3 -24
  31. package/cjs/common/segment/curve/cubic-bezier.js.map +1 -1
  32. package/cjs/common/segment/curve/curve-context.js +4 -5
  33. package/cjs/common/segment/curve/curve-context.js.map +1 -1
  34. package/cjs/common/segment/curve/ellipse.d.ts +1 -4
  35. package/cjs/common/segment/curve/ellipse.js +0 -9
  36. package/cjs/common/segment/curve/ellipse.js.map +1 -1
  37. package/cjs/common/segment/curve/line.d.ts +1 -4
  38. package/cjs/common/segment/curve/line.js +0 -18
  39. package/cjs/common/segment/curve/line.js.map +1 -1
  40. package/cjs/common/segment/curve/move.d.ts +1 -4
  41. package/cjs/common/segment/curve/move.js +0 -9
  42. package/cjs/common/segment/curve/move.js.map +1 -1
  43. package/cjs/common/segment/curve/path.d.ts +1 -2
  44. package/cjs/common/segment/curve/path.js +2 -5
  45. package/cjs/common/segment/curve/path.js.map +1 -1
  46. package/cjs/common/segment/curve/quadratic-bezier.d.ts +2 -6
  47. package/cjs/common/segment/curve/quadratic-bezier.js +5 -23
  48. package/cjs/common/segment/curve/quadratic-bezier.js.map +1 -1
  49. package/cjs/common/store.js +1 -1
  50. package/cjs/common/utils.d.ts +1 -0
  51. package/cjs/common/utils.js +9 -2
  52. package/cjs/common/utils.js.map +1 -1
  53. package/cjs/core/contributions/textMeasure/AtextMeasure.d.ts +56 -4
  54. package/cjs/core/contributions/textMeasure/AtextMeasure.js +119 -18
  55. package/cjs/core/contributions/textMeasure/AtextMeasure.js.map +1 -1
  56. package/cjs/core/contributions/textMeasure/layout.d.ts +8 -3
  57. package/cjs/core/contributions/textMeasure/layout.js +55 -44
  58. package/cjs/core/contributions/textMeasure/layout.js.map +1 -1
  59. package/cjs/core/stage.d.ts +5 -0
  60. package/cjs/core/stage.js +20 -7
  61. package/cjs/core/stage.js.map +1 -1
  62. package/cjs/event/event-manager.d.ts +1 -0
  63. package/cjs/event/event-manager.js +1 -1
  64. package/cjs/event/event-manager.js.map +1 -1
  65. package/cjs/event/event-system.js +2 -1
  66. package/cjs/event/event-system.js.map +1 -1
  67. package/cjs/graphic/builtin-symbol/rect.d.ts +1 -2
  68. package/cjs/graphic/builtin-symbol/rect.js +0 -28
  69. package/cjs/graphic/builtin-symbol/rect.js.map +1 -1
  70. package/cjs/graphic/builtin-symbol/utils.d.ts +1 -2
  71. package/cjs/graphic/builtin-symbol/utils.js +0 -5
  72. package/cjs/graphic/builtin-symbol/utils.js.map +1 -1
  73. package/cjs/graphic/config.d.ts +1 -1
  74. package/cjs/graphic/config.js +8 -9
  75. package/cjs/graphic/config.js.map +1 -1
  76. package/cjs/graphic/graphic.js +1 -2
  77. package/cjs/graphic/graphic.js.map +1 -1
  78. package/cjs/graphic/richtext/line.js +9 -2
  79. package/cjs/graphic/richtext/line.js.map +1 -1
  80. package/cjs/graphic/richtext/paragraph.js +4 -3
  81. package/cjs/graphic/richtext/paragraph.js.map +1 -1
  82. package/cjs/graphic/richtext/utils.d.ts +2 -1
  83. package/cjs/graphic/richtext/utils.js +5 -3
  84. package/cjs/graphic/richtext/utils.js.map +1 -1
  85. package/cjs/graphic/richtext/wrapper.d.ts +0 -1
  86. package/cjs/graphic/richtext/wrapper.js +1 -1
  87. package/cjs/graphic/richtext/wrapper.js.map +1 -1
  88. package/cjs/graphic/richtext.js +1 -2
  89. package/cjs/graphic/richtext.js.map +1 -1
  90. package/cjs/graphic/text.d.ts +11 -11
  91. package/cjs/graphic/text.js +102 -168
  92. package/cjs/graphic/text.js.map +1 -1
  93. package/cjs/graphic/wrap-text.js +16 -4
  94. package/cjs/graphic/wrap-text.js.map +1 -1
  95. package/cjs/index.d.ts +0 -1
  96. package/cjs/index.js +1 -1
  97. package/cjs/index.js.map +1 -1
  98. package/cjs/interface/animate.d.ts +2 -5
  99. package/cjs/interface/animate.js.map +1 -1
  100. package/cjs/interface/context.d.ts +1 -0
  101. package/cjs/interface/context.js.map +1 -1
  102. package/cjs/interface/graphic/path.d.ts +0 -1
  103. package/cjs/interface/graphic/path.js.map +1 -1
  104. package/cjs/interface/graphic/symbol.d.ts +0 -2
  105. package/cjs/interface/graphic/symbol.js.map +1 -1
  106. package/cjs/interface/graphic/text.d.ts +11 -3
  107. package/cjs/interface/graphic/text.js +6 -1
  108. package/cjs/interface/graphic/text.js.map +1 -1
  109. package/cjs/interface/graphic.d.ts +3 -6
  110. package/cjs/interface/graphic.js.map +1 -1
  111. package/cjs/interface/path.d.ts +0 -5
  112. package/cjs/interface/path.js.map +1 -1
  113. package/cjs/interface/picker.d.ts +0 -13
  114. package/cjs/interface/picker.js.map +1 -1
  115. package/cjs/interface/stage.d.ts +2 -0
  116. package/cjs/interface/stage.js.map +1 -1
  117. package/cjs/interface/text.d.ts +9 -1
  118. package/cjs/interface/text.js.map +1 -1
  119. package/cjs/picker/constants.d.ts +0 -2
  120. package/cjs/picker/constants.js +2 -3
  121. package/cjs/picker/constants.js.map +1 -1
  122. package/cjs/picker/pick-interceptor.d.ts +2 -7
  123. package/cjs/picker/pick-interceptor.js +2 -19
  124. package/cjs/picker/pick-interceptor.js.map +1 -1
  125. package/cjs/picker/pick-modules.js +4 -7
  126. package/cjs/picker/pick-modules.js.map +1 -1
  127. package/cjs/picker/picker-service.d.ts +2 -4
  128. package/cjs/picker/picker-service.js +12 -13
  129. package/cjs/picker/picker-service.js.map +1 -1
  130. package/cjs/plugins/builtin-plugin/auto-refresh-plugin.d.ts +16 -0
  131. package/cjs/plugins/builtin-plugin/auto-refresh-plugin.js +48 -0
  132. package/cjs/plugins/builtin-plugin/auto-refresh-plugin.js.map +1 -0
  133. package/cjs/plugins/builtin-plugin/edit-module.d.ts +5 -6
  134. package/cjs/plugins/builtin-plugin/edit-module.js +28 -84
  135. package/cjs/plugins/builtin-plugin/edit-module.js.map +1 -1
  136. package/cjs/plugins/builtin-plugin/richtext-edit-plugin.d.ts +30 -49
  137. package/cjs/plugins/builtin-plugin/richtext-edit-plugin.js +217 -280
  138. package/cjs/plugins/builtin-plugin/richtext-edit-plugin.js.map +1 -1
  139. package/cjs/render/contributions/render/arc3d-render.js.map +1 -1
  140. package/cjs/render/contributions/render/base-render.d.ts +0 -1
  141. package/cjs/render/contributions/render/base-render.js +2 -20
  142. package/cjs/render/contributions/render/base-render.js.map +1 -1
  143. package/cjs/render/contributions/render/contributions/arc-contribution-render.js +2 -2
  144. package/cjs/render/contributions/render/contributions/arc-contribution-render.js.map +1 -1
  145. package/cjs/render/contributions/render/contributions/base-contribution-render.js.map +1 -1
  146. package/cjs/render/contributions/render/contributions/base-texture-contribution-render.js +2 -29
  147. package/cjs/render/contributions/render/contributions/base-texture-contribution-render.js.map +1 -1
  148. package/cjs/render/contributions/render/contributions/circle-contribution-render.js +2 -2
  149. package/cjs/render/contributions/render/contributions/circle-contribution-render.js.map +1 -1
  150. package/cjs/render/contributions/render/contributions/rect-contribution-render.js +2 -2
  151. package/cjs/render/contributions/render/contributions/rect-contribution-render.js.map +1 -1
  152. package/cjs/render/contributions/render/contributions/symbol-contribution-render.d.ts +1 -8
  153. package/cjs/render/contributions/render/contributions/symbol-contribution-render.js +4 -32
  154. package/cjs/render/contributions/render/contributions/symbol-contribution-render.js.map +1 -1
  155. package/cjs/render/contributions/render/draw-interceptor.js +3 -2
  156. package/cjs/render/contributions/render/draw-interceptor.js.map +1 -1
  157. package/cjs/render/contributions/render/path-render.js.map +1 -1
  158. package/cjs/render/contributions/render/polygon-render.js.map +1 -1
  159. package/cjs/render/contributions/render/symbol-render.js +12 -15
  160. package/cjs/render/contributions/render/symbol-render.js.map +1 -1
  161. package/cjs/render/contributions/render/text-render.d.ts +1 -1
  162. package/cjs/render/contributions/render/text-render.js +24 -46
  163. package/cjs/render/contributions/render/text-render.js.map +1 -1
  164. package/cjs/render/contributions/render/utils.d.ts +2 -1
  165. package/cjs/render/contributions/render/utils.js +20 -4
  166. package/cjs/render/contributions/render/utils.js.map +1 -1
  167. package/dist/index.es.js +18297 -18772
  168. package/es/animate/Ticker/default-ticker.d.ts +2 -3
  169. package/es/animate/Ticker/default-ticker.js +5 -8
  170. package/es/animate/Ticker/default-ticker.js.map +1 -1
  171. package/es/animate/animate.js +1 -1
  172. package/es/animate/animate.js.map +1 -1
  173. package/es/animate/custom-animate.d.ts +2 -0
  174. package/es/animate/custom-animate.js +11 -2
  175. package/es/animate/custom-animate.js.map +1 -1
  176. package/es/animate/easing.d.ts +0 -3
  177. package/es/animate/easing.js +1 -9
  178. package/es/animate/easing.js.map +1 -1
  179. package/es/color-string/store.js +2 -1
  180. package/es/common/3d-interceptor.js +1 -2
  181. package/es/common/bezier-utils.d.ts +0 -3
  182. package/es/common/bezier-utils.js +0 -14
  183. package/es/common/bezier-utils.js.map +1 -1
  184. package/es/common/color-utils.js +2 -2
  185. package/es/common/color-utils.js.map +1 -1
  186. package/es/common/custom-path2d.d.ts +0 -4
  187. package/es/common/custom-path2d.js +12 -44
  188. package/es/common/custom-path2d.js.map +1 -1
  189. package/es/common/render-area.js +2 -1
  190. package/es/common/render-command-list.js +1 -2
  191. package/es/common/segment/curve/arc.d.ts +1 -4
  192. package/es/common/segment/curve/arc.js +1 -10
  193. package/es/common/segment/curve/arc.js.map +1 -1
  194. package/es/common/segment/curve/base.d.ts +1 -4
  195. package/es/common/segment/curve/base.js.map +1 -1
  196. package/es/common/segment/curve/cubic-bezier.d.ts +1 -5
  197. package/es/common/segment/curve/cubic-bezier.js +1 -22
  198. package/es/common/segment/curve/cubic-bezier.js.map +1 -1
  199. package/es/common/segment/curve/curve-context.js +3 -6
  200. package/es/common/segment/curve/curve-context.js.map +1 -1
  201. package/es/common/segment/curve/ellipse.d.ts +1 -4
  202. package/es/common/segment/curve/ellipse.js +0 -9
  203. package/es/common/segment/curve/ellipse.js.map +1 -1
  204. package/es/common/segment/curve/line.d.ts +1 -4
  205. package/es/common/segment/curve/line.js +0 -18
  206. package/es/common/segment/curve/line.js.map +1 -1
  207. package/es/common/segment/curve/move.d.ts +1 -4
  208. package/es/common/segment/curve/move.js +0 -9
  209. package/es/common/segment/curve/move.js.map +1 -1
  210. package/es/common/segment/curve/path.d.ts +1 -2
  211. package/es/common/segment/curve/path.js +2 -5
  212. package/es/common/segment/curve/path.js.map +1 -1
  213. package/es/common/segment/curve/quadratic-bezier.d.ts +2 -6
  214. package/es/common/segment/curve/quadratic-bezier.js +5 -28
  215. package/es/common/segment/curve/quadratic-bezier.js.map +1 -1
  216. package/es/common/store.js +1 -1
  217. package/es/common/utils.d.ts +1 -0
  218. package/es/common/utils.js +6 -1
  219. package/es/common/utils.js.map +1 -1
  220. package/es/core/contributions/textMeasure/AtextMeasure.d.ts +56 -4
  221. package/es/core/contributions/textMeasure/AtextMeasure.js +122 -17
  222. package/es/core/contributions/textMeasure/AtextMeasure.js.map +1 -1
  223. package/es/core/contributions/textMeasure/layout.d.ts +8 -3
  224. package/es/core/contributions/textMeasure/layout.js +55 -44
  225. package/es/core/contributions/textMeasure/layout.js.map +1 -1
  226. package/es/core/stage.d.ts +5 -0
  227. package/es/core/stage.js +21 -6
  228. package/es/core/stage.js.map +1 -1
  229. package/es/event/event-manager.d.ts +1 -0
  230. package/es/event/event-manager.js +1 -1
  231. package/es/event/event-manager.js.map +1 -1
  232. package/es/event/event-system.js +2 -1
  233. package/es/event/event-system.js.map +1 -1
  234. package/es/graphic/builtin-symbol/rect.d.ts +1 -2
  235. package/es/graphic/builtin-symbol/rect.js +0 -28
  236. package/es/graphic/builtin-symbol/rect.js.map +1 -1
  237. package/es/graphic/builtin-symbol/utils.d.ts +1 -2
  238. package/es/graphic/builtin-symbol/utils.js +0 -5
  239. package/es/graphic/builtin-symbol/utils.js.map +1 -1
  240. package/es/graphic/config.d.ts +1 -1
  241. package/es/graphic/config.js +9 -8
  242. package/es/graphic/config.js.map +1 -1
  243. package/es/graphic/graphic.js +1 -2
  244. package/es/graphic/graphic.js.map +1 -1
  245. package/es/graphic/richtext/line.js +10 -3
  246. package/es/graphic/richtext/line.js.map +1 -1
  247. package/es/graphic/richtext/paragraph.js +4 -3
  248. package/es/graphic/richtext/paragraph.js.map +1 -1
  249. package/es/graphic/richtext/utils.d.ts +2 -1
  250. package/es/graphic/richtext/utils.js +6 -2
  251. package/es/graphic/richtext/utils.js.map +1 -1
  252. package/es/graphic/richtext/wrapper.d.ts +0 -1
  253. package/es/graphic/richtext/wrapper.js +1 -1
  254. package/es/graphic/richtext/wrapper.js.map +1 -1
  255. package/es/graphic/richtext.js +1 -2
  256. package/es/graphic/richtext.js.map +1 -1
  257. package/es/graphic/text.d.ts +11 -11
  258. package/es/graphic/text.js +101 -163
  259. package/es/graphic/text.js.map +1 -1
  260. package/es/graphic/wrap-text.js +16 -4
  261. package/es/graphic/wrap-text.js.map +1 -1
  262. package/es/index.d.ts +0 -1
  263. package/es/index.js +0 -2
  264. package/es/index.js.map +1 -1
  265. package/es/interface/animate.d.ts +2 -5
  266. package/es/interface/animate.js.map +1 -1
  267. package/es/interface/context.d.ts +1 -0
  268. package/es/interface/context.js.map +1 -1
  269. package/es/interface/graphic/path.d.ts +0 -1
  270. package/es/interface/graphic/path.js.map +1 -1
  271. package/es/interface/graphic/symbol.d.ts +0 -2
  272. package/es/interface/graphic/symbol.js.map +1 -1
  273. package/es/interface/graphic/text.d.ts +11 -3
  274. package/es/interface/graphic/text.js +6 -1
  275. package/es/interface/graphic/text.js.map +1 -1
  276. package/es/interface/graphic.d.ts +3 -6
  277. package/es/interface/graphic.js.map +1 -1
  278. package/es/interface/path.d.ts +0 -5
  279. package/es/interface/path.js.map +1 -1
  280. package/es/interface/picker.d.ts +0 -13
  281. package/es/interface/picker.js.map +1 -1
  282. package/es/interface/stage.d.ts +2 -0
  283. package/es/interface/stage.js.map +1 -1
  284. package/es/interface/text.d.ts +9 -1
  285. package/es/interface/text.js.map +1 -1
  286. package/es/picker/constants.d.ts +0 -2
  287. package/es/picker/constants.js +0 -4
  288. package/es/picker/constants.js.map +1 -1
  289. package/es/picker/pick-interceptor.d.ts +2 -7
  290. package/es/picker/pick-interceptor.js +1 -19
  291. package/es/picker/pick-interceptor.js.map +1 -1
  292. package/es/picker/pick-modules.js +3 -5
  293. package/es/picker/pick-modules.js.map +1 -1
  294. package/es/picker/picker-service.d.ts +2 -4
  295. package/es/picker/picker-service.js +13 -13
  296. package/es/picker/picker-service.js.map +1 -1
  297. package/es/plugins/builtin-plugin/auto-refresh-plugin.d.ts +16 -0
  298. package/es/plugins/builtin-plugin/auto-refresh-plugin.js +41 -0
  299. package/es/plugins/builtin-plugin/auto-refresh-plugin.js.map +1 -0
  300. package/es/plugins/builtin-plugin/edit-module.d.ts +5 -6
  301. package/es/plugins/builtin-plugin/edit-module.js +25 -79
  302. package/es/plugins/builtin-plugin/edit-module.js.map +1 -1
  303. package/es/plugins/builtin-plugin/richtext-edit-plugin.d.ts +30 -49
  304. package/es/plugins/builtin-plugin/richtext-edit-plugin.js +214 -283
  305. package/es/plugins/builtin-plugin/richtext-edit-plugin.js.map +1 -1
  306. package/es/render/contributions/render/arc3d-render.js.map +1 -1
  307. package/es/render/contributions/render/base-render.d.ts +0 -1
  308. package/es/render/contributions/render/base-render.js +2 -21
  309. package/es/render/contributions/render/base-render.js.map +1 -1
  310. package/es/render/contributions/render/contributions/arc-contribution-render.js +2 -2
  311. package/es/render/contributions/render/contributions/arc-contribution-render.js.map +1 -1
  312. package/es/render/contributions/render/contributions/base-contribution-render.js.map +1 -1
  313. package/es/render/contributions/render/contributions/base-texture-contribution-render.js +2 -29
  314. package/es/render/contributions/render/contributions/base-texture-contribution-render.js.map +1 -1
  315. package/es/render/contributions/render/contributions/circle-contribution-render.js +2 -2
  316. package/es/render/contributions/render/contributions/circle-contribution-render.js.map +1 -1
  317. package/es/render/contributions/render/contributions/rect-contribution-render.js +2 -2
  318. package/es/render/contributions/render/contributions/rect-contribution-render.js.map +1 -1
  319. package/es/render/contributions/render/contributions/symbol-contribution-render.d.ts +1 -8
  320. package/es/render/contributions/render/contributions/symbol-contribution-render.js +2 -28
  321. package/es/render/contributions/render/contributions/symbol-contribution-render.js.map +1 -1
  322. package/es/render/contributions/render/draw-interceptor.js +3 -2
  323. package/es/render/contributions/render/draw-interceptor.js.map +1 -1
  324. package/es/render/contributions/render/path-render.js.map +1 -1
  325. package/es/render/contributions/render/polygon-render.js.map +1 -1
  326. package/es/render/contributions/render/symbol-render.js +13 -16
  327. package/es/render/contributions/render/symbol-render.js.map +1 -1
  328. package/es/render/contributions/render/text-render.d.ts +1 -1
  329. package/es/render/contributions/render/text-render.js +23 -45
  330. package/es/render/contributions/render/text-render.js.map +1 -1
  331. package/es/render/contributions/render/utils.d.ts +2 -1
  332. package/es/render/contributions/render/utils.js +18 -0
  333. package/es/render/contributions/render/utils.js.map +1 -1
  334. package/package.json +6 -5
  335. package/cjs/animate/easing-func.d.ts +0 -1
  336. package/cjs/animate/easing-func.js +0 -16
  337. package/cjs/animate/easing-func.js.map +0 -1
  338. package/cjs/plugins/builtin-plugin/richtext-edit-plugin-old.d.ts +0 -1
  339. package/cjs/plugins/builtin-plugin/richtext-edit-plugin-old.js +0 -3
  340. package/cjs/plugins/builtin-plugin/richtext-edit-plugin-old.js.map +0 -1
  341. package/es/animate/easing-func.d.ts +0 -1
  342. package/es/animate/easing-func.js +0 -10
  343. package/es/animate/easing-func.js.map +0 -1
  344. package/es/plugins/builtin-plugin/richtext-edit-plugin-old.d.ts +0 -1
  345. package/es/plugins/builtin-plugin/richtext-edit-plugin-old.js +0 -3
  346. package/es/plugins/builtin-plugin/richtext-edit-plugin-old.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/graphic/text.ts"],"names":[],"mappings":";;;AACA,6CAAwG;AACxG,yCAAoE;AACpE,qEAA4E;AAC5E,gDAA6C;AAE7C,uCAAiF;AACjF,mCAAmC;AACnC,2CAAsD;AACtD,2CAA+C;AAC/C,mCAAqE;AAErE,MAAM,mBAAmB,GAAG;IAC1B,MAAM;IACN,cAAc;IAEd,WAAW;IACX,cAAc;IACd,aAAa;IACb,WAAW;IACX,UAAU;IACV,YAAY;IACZ,YAAY;IACZ,UAAU;IACV,YAAY;IACZ,WAAW;IACX,WAAW;IACX,aAAa;IACb,WAAW;IACX,GAAG,gCAAsB;CAC1B,CAAC;AAEF,MAAa,IAAK,SAAQ,iBAA8B;IAmBtD,IAAI,IAAI;QACN,MAAM,SAAS,GAAG,IAAI,CAAC,eAAe,EAAE,CAAC;QACz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port { max, isArray, getContextFont, transformBoundsWithMatrix, rotatePoint } from '@visactor/vutils';\nimport { textDrawOffsetX, textLayoutOffsetY } from '../common/text';\nimport { CanvasTextLayout } from '../core/contributions/textMeasure/layout';\nimport { application } from '../application';\nimport type { IText, ITextCache, ITextGraphicAttribute, LayoutItemType, LayoutType } from '../interface';\nimport { Graphic, GRAPHIC_UPDATE_TAG_KEY, NOWORK_ANIMATE_ATTR } from './graphic';\nimport { getTheme } from './theme';\nimport { calculateLineHeight } from '../common/utils';\nimport { TEXT_NUMBER_TYPE } from './constants';\nimport { boundStroke, TextDirection, verticalLayout } from './tools';\n\nconst TEXT_UPDATE_TAG_KEY = [\n 'text',\n 'maxLineWidth',\n // 多行文本要用到\n 'textAlign',\n 'textBaseline',\n 'heightLimit',\n 'lineClamp',\n 'fontSize',\n 'fontFamily',\n 'fontWeight',\n 'ellipsis',\n 'lineHeight',\n 'direction',\n 'wordBreak',\n 'heightLimit',\n 'lineClamp',\n ...GRAPHIC_UPDATE_TAG_KEY\n];\n\nexport class Text extends Graphic<ITextGraphicAttribute> implements IText {\n type: 'text' = 'text';\n\n static NOWORK_ANIMATE_ATTR = {\n ellipsis: 1,\n wordBreak: 1,\n direction: 1,\n textAlign: 1,\n textBaseline: 1,\n fontFamily: 1,\n fontWeight: 1,\n ...NOWORK_ANIMATE_ATTR\n };\n\n cache: ITextCache;\n _font: string;\n\n protected declare obbText?: Text;\n\n get font(): string {\n const textTheme = this.getGraphicTheme();\n if (!this._font) {\n this._font = getContextFont(this.attribute, textTheme);\n }\n return this._font as string;\n }\n\n get clipedText(): string | undefined {\n const attribute = this.attribute;\n const textTheme = this.getGraphicTheme();\n if (!this.isSimplify()) {\n return undefined;\n }\n const { maxLineWidth = textTheme.maxLineWidth } = attribute;\n if (!Number.isFinite(maxLineWidth)) {\n return (attribute.text ?? textTheme.text).toString();\n }\n this.tryUpdateAABBBounds();\n return this.cache.clipedText;\n }\n get clipedWidth(): number | undefined {\n if (!this.isSimplify()) {\n return undefined;\n }\n this.tryUpdateAABBBounds();\n return this.cache.clipedWidth;\n }\n get cliped(): boolean | undefined {\n const textTheme = this.getGraphicTheme();\n const attribute = this.attribute;\n const { maxLineWidth = textTheme.maxLineWidth, text, whiteSpace = textTheme.whiteSpace } = attribute;\n if (!Number.isFinite(maxLineWidth)) {\n return false;\n }\n this.tryUpdateAABBBounds();\n if (this.cache?.layoutData?.lines) {\n let mergedText = '';\n this.cache.layoutData.lines.forEach(item => {\n mergedText += item.str;\n });\n const originText = Array.isArray(text) ? text.join('') : text;\n\n return originText !== mergedText;\n }\n if (attribute.direction === 'vertical' && this.cache.verticalList && this.cache.verticalList[0]) {\n return this.cache.verticalList[0].map(item => item.text).join('') !== attribute.text.toString();\n }\n if (this.clipedText == null) {\n return false;\n }\n return this.clipedText !== attribute.text.toString();\n }\n get multilineLayout(): LayoutType | undefined {\n if (!this.isMultiLine) {\n return undefined;\n }\n this.tryUpdateAABBBounds();\n return this.cache.layoutData;\n }\n\n // 是否是简单文字\n // 单行,横排\n private isSimplify(): boolean {\n return !this.isMultiLine && this.attribute.direction !== 'vertical';\n }\n get isMultiLine(): boolean {\n return Array.isArray(this.attribute.text) || this.attribute.whiteSpace === 'normal';\n }\n\n constructor(params: ITextGraphicAttribute = { text: '', fontSize: 16 }) {\n super(params);\n this.numberType = TEXT_NUMBER_TYPE;\n this.cache = {};\n }\n\n isValid(): boolean {\n return super.isValid() && this._isValid();\n }\n protected _isValid(): boolean {\n const { text } = this.attribute;\n if (isArray(text)) {\n return !(text as any[]).every((t: any) => t == null || t === '');\n }\n return text != null && text !== '';\n }\n\n getGraphicTheme(): Required<ITextGraphicAttribute> {\n return getTheme(this).text;\n }\n\n protected doUpdateOBBBounds(): IOBBBounds {\n const graphicTheme = this.getGraphicTheme();\n this._OBBBounds.clear();\n const attribute = this.attribute;\n const { angle = graphicTheme.angle } = attribute;\n if (!angle) {\n const b = this.AABBBounds;\n this._OBBBounds.setValue(b.x1, b.y1, b.x2, b.y2);\n return this._OBBBounds;\n }\n if (!this.obbText) {\n this.obbText = new Text({});\n }\n this.obbText.setAttributes({ ...attribute, angle: 0 });\n const bounds1 = this.obbText.AABBBounds;\n const { x, y } = attribute;\n const boundsCenter = { x: (bounds1.x1 + bounds1.x2) / 2, y: (bounds1.y1 + bounds1.y2) / 2 };\n const center = rotatePoint(boundsCenter, angle, { x, y });\n this._OBBBounds.copy(bounds1);\n this._OBBBounds.translate(center.x - boundsCenter.x, center.y - boundsCenter.y);\n this._OBBBounds.angle = angle;\n return this._OBBBounds;\n }\n\n protected updateAABBBounds(\n attribute: ITextGraphicAttribute,\n textTheme: Required<ITextGraphicAttribute>,\n aabbBounds: IAABBBounds\n ) {\n const { text = textTheme.text } = this.attribute;\n if (Array.isArray(text)) {\n this.updateMultilineAABBBounds(text as (number | string)[]);\n } else {\n this.updateSingallineAABBBounds(text as number | string);\n }\n\n const { tb1 } = application.graphicService.updateTempAABBBounds(aabbBounds);\n\n const {\n scaleX = textTheme.scaleX,\n scaleY = textTheme.scaleY,\n shadowBlur = textTheme.shadowBlur,\n strokeBoundsBuffer = textTheme.strokeBoundsBuffer\n } = attribute;\n if (shadowBlur) {\n const shadowBlurHalfWidth = shadowBlur / Math.abs(scaleX + scaleY);\n boundStroke(tb1, shadowBlurHalfWidth, true, strokeBoundsBuffer);\n aabbBounds.union(tb1);\n }\n // 合并shadowRoot的bounds\n application.graphicService.combindShadowAABBBounds(aabbBounds, this);\n\n if (attribute.forceBoundsHeight != null || attribute.forceBoundsWidth != null) {\n application.graphicService.updateHTMLTextAABBBounds(attribute, textTheme, aabbBounds);\n }\n\n transformBoundsWithMatrix(aabbBounds, aabbBounds, this.transMatrix);\n return aabbBounds;\n }\n\n /**\n * 计算多行文字的bounds,缓存每行文字的布局位置\n * 自动折行params.text是数组,因此只重新updateMultilineAABBBounds\n * @param text\n */\n updateWrapAABBBounds(text: (number | string) | (number | string)[]) {\n const textTheme = this.getGraphicTheme();\n const {\n fontFamily = textTheme.fontFamily,\n textAlign = textTheme.textAlign,\n textBaseline = textTheme.textBaseline,\n fontSize = textTheme.fontSize,\n ellipsis = textTheme.ellipsis,\n maxLineWidth,\n stroke = textTheme.stroke,\n lineWidth = textTheme.lineWidth,\n wordBreak = textTheme.wordBreak,\n fontWeight = textTheme.fontWeight,\n // widthLimit,\n ignoreBuf = textTheme.ignoreBuf,\n suffixPosition = textTheme.suffixPosition,\n heightLimit = 0,\n lineClamp\n } = this.attribute;\n const lineHeight =\n calculateLineHeight(this.attribute.lineHeight, this.attribute.fontSize || textTheme.fontSize) ??\n (this.attribute.fontSize || textTheme.fontSize);\n const buf = ignoreBuf ? 0 : 2;\n if (!this.shouldUpdateShape() && this.cache?.layoutData) {\n const bbox = this.cache.layoutData.bbox;\n this._AABBBounds.set(bbox.xOffset, bbox.yOffset, bbox.xOffset + bbox.width, bbox.yOffset + bbox.height);\n if (stroke) {\n this._AABBBounds.expand(lineWidth / 2);\n }\n return this._AABBBounds;\n }\n\n const textMeasure = application.graphicUtil.textMeasure;\n const layoutObj = new CanvasTextLayout(fontFamily, { fontSize, fontWeight, fontFamily }, textMeasure as any) as any;\n\n // layoutObj内逻辑\n const lines = isArray(text) ? (text.map(l => l.toString()) as string[]) : [text.toString()];\n const linesLayout: LayoutItemType[] = [];\n const bboxWH: [number, number] = [0, 0];\n\n let lineCountLimit = Infinity;\n if (heightLimit > 0) {\n lineCountLimit = Math.max(Math.floor(heightLimit / lineHeight), 1);\n }\n if (lineClamp) {\n // 处理行数限制\n lineCountLimit = Math.min(lineCountLimit, lineClamp);\n }\n\n if (typeof maxLineWidth === 'number' && maxLineWidth !== Infinity) {\n // widthLimit > 0\n if (maxLineWidth > 0) {\n for (let i = 0; i < lines.length; i++) {\n const str = lines[i] as string;\n let needCut = true;\n // // 测量当前行宽度\n // width = Math.min(\n // layoutObj.textMeasure.measureTextWidth(str, layoutObj.textOptions),\n // maxLineWidth\n // );\n\n // 判断是否超过高度限制\n if (i === lineCountLimit - 1) {\n // 当前行为最后一行,如果后面还有行,需要显示省略号\n const clip = layoutObj.textMeasure.clipTextWithSuffix(\n str,\n layoutObj.textOptions,\n maxLineWidth,\n ellipsis,\n false,\n suffixPosition,\n i !== lines.length - 1\n );\n linesLayout.push({\n str: clip.str,\n width: clip.width\n });\n break; // 不处理后续行\n }\n\n // 测量截断位置\n const clip = layoutObj.textMeasure.clipText(\n str,\n layoutObj.textOptions,\n maxLineWidth,\n wordBreak !== 'break-all',\n wordBreak === 'keep-all'\n );\n if ((str !== '' && clip.str === '') || clip.wordBreaked) {\n if (ellipsis) {\n const clipEllipsis = layoutObj.textMeasure.clipTextWithSuffix(\n str,\n layoutObj.textOptions,\n maxLineWidth,\n ellipsis,\n false,\n suffixPosition\n );\n clip.str = clipEllipsis.str ?? '';\n clip.width = clipEllipsis.width ?? 0;\n } else {\n // 宽度限制不足一个字符,不显示\n clip.str = '';\n clip.width = 0;\n }\n needCut = false;\n }\n\n linesLayout.push({\n str: clip.str,\n width: clip.width\n });\n let cutLength = clip.str.length;\n if (clip.wordBreaked && !(str !== '' && clip.str === '')) {\n needCut = true;\n cutLength = clip.wordBreaked;\n }\n if (clip.str.length === str.length) {\n // 不需要截断\n } else if (needCut) {\n let newStr = str.substring(cutLength);\n // 截断后,避免开头有空格很尬,去掉\n if (wordBreak === 'keep-all') {\n newStr = newStr.replace(/^\\s+/g, '');\n }\n lines.splice(i + 1, 0, newStr);\n }\n }\n }\n // bboxWH[0] = maxLineWidth;\n let maxWidth = 0;\n linesLayout.forEach(layout => {\n maxWidth = Math.max(maxWidth, layout.width);\n });\n bboxWH[0] = maxWidth;\n } else {\n // 使用所有行中最长的作为lineWidth\n let lineWidth = 0;\n let width: number;\n let text: string;\n for (let i = 0, len = lines.length; i < len; i++) {\n // 判断是否超过高度限制\n if (i === lineCountLimit - 1) {\n // 当前行为最后一行\n const clip = layoutObj.textMeasure.clipTextWithSuffix(\n lines[i],\n layoutObj.textOptions,\n maxLineWidth,\n ellipsis,\n false,\n suffixPosition\n );\n linesLayout.push({\n str: clip.str,\n width: clip.width\n });\n lineWidth = Math.max(lineWidth, clip.width);\n break; // 不处理后续行\n }\n\n text = lines[i] as string;\n width = layoutObj.textMeasure.measureTextWidth(text, layoutObj.textOptions, wordBreak === 'break-word');\n lineWidth = Math.max(lineWidth, width);\n linesLayout.push({ str: text, width });\n }\n bboxWH[0] = lineWidth;\n }\n bboxWH[1] = linesLayout.length * (lineHeight + buf);\n\n const bbox = {\n xOffset: 0,\n yOffset: 0,\n width: bboxWH[0],\n height: bboxWH[1]\n };\n\n layoutObj.LayoutBBox(bbox, textAlign, textBaseline as any);\n\n const layoutData = layoutObj.layoutWithBBox(bbox, linesLayout, textAlign, textBaseline as any, lineHeight);\n\n // const layoutData = layoutObj.GetLayoutByLines(\n // text,\n // textAlign,\n // textBaseline as any,\n // lineHeight,\n // ellipsis === true ? (DefaultTextAttribute.ellipsis as string) : ellipsis || undefined,\n // maxLineWidth\n // );\n // const { bbox } = layoutData;\n this.cache.layoutData = layoutData;\n this.clearUpdateShapeTag();\n this._AABBBounds.set(bbox.xOffset, bbox.yOffset, bbox.xOffset + bbox.width, bbox.yOffset + bbox.height);\n\n if (stroke) {\n this._AABBBounds.expand(lineWidth / 2);\n }\n\n return this._AABBBounds;\n }\n\n /**\n * 计算单行文字的bounds,可以缓存长度以及截取的文字\n * @param text\n */\n updateSingallineAABBBounds(text: number | string): IAABBBounds {\n const textTheme = this.getGraphicTheme();\n const { direction = textTheme.direction, underlineOffset = textTheme.underlineOffset } = this.attribute;\n\n const b =\n direction === 'horizontal'\n ? this.updateHorizontalSinglelineAABBBounds(text)\n : this.updateVerticalSinglelineAABBBounds(text);\n if (direction === 'horizontal') {\n if (underlineOffset) {\n this._AABBBounds.add(this._AABBBounds.x1, this._AABBBounds.y2 + underlineOffset);\n }\n }\n return b;\n }\n\n /**\n * 计算单行文字的bounds,可以缓存长度以及截取的文字\n * @param text\n */\n updateMultilineAABBBounds(text: (number | string)[]): IAABBBounds {\n const textTheme = this.getGraphicTheme();\n const { direction = textTheme.direction, underlineOffset = textTheme.underlineOffset } = this.attribute;\n\n const b =\n direction === 'horizontal'\n ? this.updateHorizontalMultilineAABBBounds(text)\n : this.updateVerticalMultilineAABBBounds(text);\n\n if (direction === 'horizontal') {\n if (underlineOffset) {\n this._AABBBounds.add(this._AABBBounds.x1, this._AABBBounds.y2 + underlineOffset);\n }\n }\n return b;\n }\n\n /**\n * 计算单行文字的bounds,可以缓存长度以及截取的文字\n * @param text\n */\n updateHorizontalSinglelineAABBBounds(text: number | string): IAABBBounds {\n const textTheme = this.getGraphicTheme();\n const { wrap = textTheme.wrap } = this.attribute;\n if (wrap) {\n return this.updateWrapAABBBounds([text]);\n }\n\n const textMeasure = application.graphicUtil.textMeasure;\n let width: number;\n let str: string;\n const attribute = this.attribute;\n const {\n maxLineWidth = textTheme.maxLineWidth,\n ellipsis = textTheme.ellipsis,\n textAlign = textTheme.textAlign,\n textBaseline = textTheme.textBaseline,\n fontFamily = textTheme.fontFamily,\n fontSize = textTheme.fontSize,\n fontWeight = textTheme.fontWeight,\n stroke = textTheme.stroke,\n lineWidth = textTheme.lineWidth,\n // wordBreak = textTheme.wordBreak,\n ignoreBuf = textTheme.ignoreBuf,\n whiteSpace = textTheme.whiteSpace,\n suffixPosition = textTheme.suffixPosition\n } = attribute;\n if (whiteSpace === 'normal') {\n return this.updateWrapAABBBounds(text);\n }\n const buf = ignoreBuf ? 0 : Math.max(2, fontSize * 0.075);\n const textFontSize = attribute.fontSize || textTheme.fontSize;\n const lineHeight = calculateLineHeight(attribute.lineHeight, textFontSize) ?? textFontSize + buf;\n if (!this.shouldUpdateShape() && this.cache) {\n width = this.cache.clipedWidth ?? 0;\n const dx = textDrawOffsetX(textAlign, width);\n const dy = textLayoutOffsetY(textBaseline, lineHeight, fontSize);\n this._AABBBounds.set(dx, dy, dx + width, dy + lineHeight);\n if (stroke) {\n this._AABBBounds.expand(lineWidth / 2);\n }\n return this._AABBBounds;\n }\n\n if (Number.isFinite(maxLineWidth)) {\n if (ellipsis) {\n const strEllipsis = (ellipsis === true ? textTheme.ellipsis : ellipsis) as string;\n const data = textMeasure.clipTextWithSuffix(\n text.toString(),\n { fontSize, fontWeight, fontFamily },\n maxLineWidth,\n strEllipsis,\n false,\n suffixPosition\n );\n str = data.str;\n width = data.width;\n } else {\n const data = textMeasure.clipText(text.toString(), { fontSize, fontWeight, fontFamily }, maxLineWidth, false);\n str = data.str;\n width = data.width;\n }\n this.cache.clipedText = str;\n this.cache.clipedWidth = width;\n // todo 计算原本的宽度\n } else {\n width = textMeasure.measureTextWidth(text.toString(), { fontSize, fontWeight, fontFamily });\n this.cache.clipedText = text.toString();\n this.cache.clipedWidth = width;\n }\n this.clearUpdateShapeTag();\n\n const dx = textDrawOffsetX(textAlign, width);\n let lh = lineHeight;\n if (application.global && application.global.isSafari()) {\n // 如果是safari,那么需要额外增加高度\n lh += fontSize * 0.2;\n }\n const dy = textLayoutOffsetY(textBaseline, lh, fontSize, buf);\n this._AABBBounds.set(dx, dy, dx + width, dy + lh);\n\n if (stroke) {\n this._AABBBounds.expand(lineWidth / 2);\n }\n\n return this._AABBBounds;\n }\n\n getBaselineMapAlign(): Record<string, string> {\n return Text.baselineMapAlign;\n }\n\n getAlignMapBaseline(): Record<string, string> {\n return Text.alignMapBaseline;\n }\n\n static baselineMapAlign = {\n top: 'left',\n bottom: 'right',\n middle: 'center'\n };\n\n static alignMapBaseline = {\n left: 'top',\n right: 'bottom',\n center: 'middle'\n };\n\n /**\n * 计算垂直布局的单行文字的bounds,可以缓存长度以及截取的文字\n * @param text\n */\n updateVerticalSinglelineAABBBounds(text: number | string): IAABBBounds {\n const textTheme = this.getGraphicTheme();\n const textMeasure = application.graphicUtil.textMeasure;\n let width: number;\n let str: string;\n const attribute = this.attribute;\n const { ignoreBuf = textTheme.ignoreBuf } = attribute;\n const buf = ignoreBuf ? 0 : 2;\n const {\n maxLineWidth = textTheme.maxLineWidth,\n ellipsis = textTheme.ellipsis,\n fontSize = textTheme.fontSize,\n fontWeight = textTheme.fontWeight,\n fontFamily = textTheme.fontFamily,\n stroke = textTheme.stroke,\n lineWidth = textTheme.lineWidth,\n verticalMode = textTheme.verticalMode,\n suffixPosition = textTheme.suffixPosition\n } = attribute;\n\n const lineHeight =\n calculateLineHeight(attribute.lineHeight, attribute.fontSize || textTheme.fontSize) ??\n (attribute.fontSize || textTheme.fontSize) + buf;\n\n let { textAlign = textTheme.textAlign, textBaseline = textTheme.textBaseline } = attribute;\n if (!verticalMode) {\n const t = textAlign;\n textAlign = (Text.baselineMapAlign as any)[textBaseline] ?? 'left';\n textBaseline = (Text.alignMapBaseline as any)[t] ?? 'top';\n }\n if (!this.shouldUpdateShape() && this.cache) {\n width = this.cache.clipedWidth;\n const dx = textDrawOffsetX(textAlign, width);\n const dy = textLayoutOffsetY(textBaseline, lineHeight, fontSize);\n this._AABBBounds.set(dy, dx, dy + lineHeight, dx + width);\n if (stroke) {\n this._AABBBounds.expand(lineWidth / 2);\n }\n return this._AABBBounds;\n }\n\n let verticalList: { text: string; width?: number; direction: TextDirection }[][] = [\n verticalLayout(text.toString())\n ];\n if (Number.isFinite(maxLineWidth)) {\n if (ellipsis) {\n const strEllipsis = (ellipsis === true ? textTheme.ellipsis : ellipsis) as string;\n const data = textMeasure.clipTextWithSuffixVertical(\n verticalList[0],\n { fontSize, fontWeight, fontFamily },\n maxLineWidth,\n strEllipsis,\n false,\n suffixPosition\n );\n verticalList = [data.verticalList];\n width = data.width;\n } else {\n const data = textMeasure.clipTextVertical(\n verticalList[0],\n { fontSize, fontWeight, fontFamily },\n maxLineWidth,\n false\n );\n verticalList = [data.verticalList];\n width = data.width;\n }\n this.cache.verticalList = verticalList;\n this.cache.clipedWidth = width;\n // todo 计算原本的宽度\n } else {\n width = 0;\n verticalList[0].forEach(t => {\n const w =\n t.direction === TextDirection.HORIZONTAL\n ? fontSize\n : textMeasure.measureTextWidth(t.text, { fontSize, fontWeight, fontFamily });\n\n width += w;\n t.width = w;\n });\n this.cache.verticalList = verticalList;\n this.cache.clipedWidth = width;\n }\n this.clearUpdateShapeTag();\n\n const dx = textDrawOffsetX(textAlign, width);\n const dy = textLayoutOffsetY(textBaseline, lineHeight, fontSize);\n this._AABBBounds.set(dy, dx, dy + lineHeight, dx + width);\n\n if (stroke) {\n this._AABBBounds.expand(lineWidth / 2);\n }\n\n return this._AABBBounds;\n }\n\n /**\n * 计算多行文字的bounds,缓存每行文字的布局位置\n * @param text\n */\n updateHorizontalMultilineAABBBounds(text: (number | string)[]): IAABBBounds {\n const textTheme = this.getGraphicTheme();\n const { wrap = textTheme.wrap } = this.attribute;\n if (wrap) {\n return this.updateWrapAABBBounds(text);\n }\n\n const attribute = this.attribute;\n const {\n fontFamily = textTheme.fontFamily,\n textAlign = textTheme.textAlign,\n textBaseline = textTheme.textBaseline,\n fontSize = textTheme.fontSize,\n fontWeight = textTheme.fontWeight,\n ellipsis = textTheme.ellipsis,\n maxLineWidth,\n stroke = textTheme.stroke,\n // ignoreBuf = textTheme.ignoreBuf,\n lineWidth = textTheme.lineWidth,\n whiteSpace = textTheme.whiteSpace,\n suffixPosition = textTheme.suffixPosition\n } = attribute;\n // const buf = ignoreBuf ? 0 : Math.max(2, fontSize * 0.075);\n const lineHeight =\n calculateLineHeight(attribute.lineHeight, attribute.fontSize || textTheme.fontSize) ??\n (attribute.fontSize || textTheme.fontSize);\n if (whiteSpace === 'normal') {\n return this.updateWrapAABBBounds(text);\n }\n if (!this.shouldUpdateShape() && this.cache?.layoutData) {\n const bbox = this.cache.layoutData.bbox;\n this._AABBBounds.set(bbox.xOffset, bbox.yOffset, bbox.xOffset + bbox.width, bbox.yOffset + bbox.height);\n if (stroke) {\n this._AABBBounds.expand(lineWidth / 2);\n }\n return this._AABBBounds;\n }\n const textMeasure = application.graphicUtil.textMeasure;\n const layoutObj = new CanvasTextLayout(fontFamily, { fontSize, fontWeight, fontFamily }, textMeasure);\n const layoutData = layoutObj.GetLayoutByLines(\n text,\n textAlign,\n textBaseline as any,\n lineHeight,\n ellipsis === true ? (textTheme.ellipsis as string) : ellipsis || undefined,\n false,\n maxLineWidth,\n suffixPosition\n );\n const { bbox } = layoutData;\n this.cache.layoutData = layoutData;\n this.clearUpdateShapeTag();\n\n this._AABBBounds.set(bbox.xOffset, bbox.yOffset, bbox.xOffset + bbox.width, bbox.yOffset + bbox.height);\n\n if (stroke) {\n this._AABBBounds.expand(lineWidth / 2);\n }\n\n return this._AABBBounds;\n }\n\n /**\n * 计算垂直布局的多行文字的bounds,可以缓存长度以及截取的文字\n * @param text\n */\n updateVerticalMultilineAABBBounds(text: (number | string)[]): IAABBBounds {\n const textTheme = this.getGraphicTheme();\n const textMeasure = application.graphicUtil.textMeasure;\n let width: number;\n const attribute = this.attribute;\n const { ignoreBuf = textTheme.ignoreBuf } = attribute;\n const buf = ignoreBuf ? 0 : 2;\n const {\n maxLineWidth = textTheme.maxLineWidth,\n ellipsis = textTheme.ellipsis,\n fontFamily = textTheme.fontFamily,\n fontSize = textTheme.fontSize,\n fontWeight = textTheme.fontWeight,\n stroke = textTheme.stroke,\n lineWidth = textTheme.lineWidth,\n // wordBreak = textTheme.wordBreak,\n verticalMode = textTheme.verticalMode,\n suffixPosition = textTheme.suffixPosition\n } = attribute;\n const lineHeight =\n calculateLineHeight(attribute.lineHeight, attribute.fontSize || textTheme.fontSize) ??\n (attribute.fontSize || textTheme.fontSize) + buf;\n let { textAlign = textTheme.textAlign, textBaseline = textTheme.textBaseline } = attribute;\n if (!verticalMode) {\n const t = textAlign;\n textAlign = (Text.baselineMapAlign as any)[textBaseline] ?? 'left';\n textBaseline = (Text.alignMapBaseline as any)[t] ?? 'top';\n }\n width = 0;\n if (!this.shouldUpdateShape() && this.cache) {\n this.cache.verticalList.forEach(item => {\n const w = item.reduce((a, b) => a + b.width, 0);\n width = max(w, width);\n });\n const dx = textDrawOffsetX(textAlign, width);\n const height = this.cache.verticalList.length * lineHeight;\n const dy = textLayoutOffsetY(textBaseline, height, fontSize);\n this._AABBBounds.set(dy, dx, dy + height, dx + width);\n if (stroke) {\n this._AABBBounds.expand(lineWidth / 2);\n }\n return this._AABBBounds;\n }\n\n const verticalLists: { text: string; width?: number; direction: TextDirection }[][] = text.map(str => {\n return verticalLayout(str.toString());\n });\n verticalLists.forEach((verticalData, i) => {\n if (Number.isFinite(maxLineWidth)) {\n if (ellipsis) {\n const strEllipsis = (ellipsis === true ? textTheme.ellipsis : ellipsis) as string;\n const data = textMeasure.clipTextWithSuffixVertical(\n verticalData,\n { fontSize, fontWeight, fontFamily },\n maxLineWidth,\n strEllipsis,\n false,\n suffixPosition\n );\n verticalLists[i] = data.verticalList;\n width = data.width;\n } else {\n const data = textMeasure.clipTextVertical(\n verticalData,\n { fontSize, fontWeight, fontFamily },\n maxLineWidth,\n false\n );\n verticalLists[i] = data.verticalList;\n width = data.width;\n }\n // this.cache.clipedWidth = width;\n // todo 计算原本的宽度\n } else {\n width = 0;\n verticalData.forEach(t => {\n const w =\n t.direction === TextDirection.HORIZONTAL\n ? fontSize\n : textMeasure.measureTextWidth(t.text, { fontSize, fontWeight, fontFamily });\n\n width += w;\n t.width = w;\n });\n }\n });\n this.cache.verticalList = verticalLists;\n this.clearUpdateShapeTag();\n\n this.cache.verticalList.forEach(item => {\n const w = item.reduce((a, b) => a + b.width, 0);\n width = max(w, width);\n });\n\n const dx = textDrawOffsetX(textAlign, width);\n const height = this.cache.verticalList.length * lineHeight;\n const dy = textLayoutOffsetY(textBaseline, height, fontSize);\n this._AABBBounds.set(dy, dx, dy + height, dx + width);\n\n if (stroke) {\n this._AABBBounds.expand(lineWidth / 2);\n }\n\n return this._AABBBounds;\n }\n\n protected needUpdateTags(keys: string[], k = TEXT_UPDATE_TAG_KEY): boolean {\n return super.needUpdateTags(keys, k);\n }\n protected needUpdateTag(key: string, k = TEXT_UPDATE_TAG_KEY): boolean {\n return super.needUpdateTag(key, k);\n }\n\n clone(): Text {\n return new Text({ ...this.attribute });\n }\n\n getNoWorkAnimateAttr(): Record<string, number> {\n return Text.NOWORK_ANIMATE_ATTR;\n }\n}\n\nexport function createText(attributes: ITextGraphicAttribute): IText {\n return new Text(attributes);\n}\n\n// addAttributeToPrototype(DefaultLineStyle, Text, PURE_STYLE_KEY);\n"]}
1
+ {"version":3,"sources":["../src/graphic/text.ts"],"names":[],"mappings":";;;AACA,6CAAwG;AACxG,yCAAoE;AACpE,qEAA4E;AAC5E,gDAA6C;AAE7C,uCAAiF;AACjF,mCAAmC;AACnC,2CAAsD;AACtD,2CAA+C;AAC/C,mCAAqE;AAErE,MAAM,mBAAmB,GAAG;IAC1B,MAAM;IACN,cAAc;IACd,UAAU;IAEV,WAAW;IACX,cAAc;IACd,aAAa;IACb,WAAW;IACX,UAAU;IACV,YAAY;IACZ,YAAY;IACZ,UAAU;IACV,YAAY;IACZ,WAAW;IACX,WAAW;IACX,aAAa;IACb,WAAW;IACX,GAAG,gCAAsB;CAC1B,CAAC;AAEF,MAAa,IAAK,SAAQ,iBAA8B;IAsBtD,IAAI,IAAI;QACN,MAAM,SAAS,GAAG,IAAI,CAAC,eAAe,EAAE,CAAC;QACzC,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE;YACf,IAAI,CAAC,KAAK,GAAG,IAAA,uBAAc,EAAC,IAAI,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;SACxD;QACD,OAAO,IAAI,CAAC,KAAe,CAAC;IAC9B,CAAC;IAED,IAAI,UAAU;;QACZ,MAAM,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC;QACjC,MAAM,SAAS,GAAG,IAAI,CAAC,eAAe,EAAE,CAAC;QACzC,MAAM,QAAQ,GAAG,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;QAC7C,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE;YAC9B,OAAO,CAAC,MAAA,SAAS,CAAC,IAAI,mCAAI,SAAS,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,CAAC;SACtD;QACD,IAAI,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AC,IAAc,EAAE,CAAC,GAAG,mBAAmB;QAC9D,OAAO,KAAK,CAAC,cAAc,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;IACvC,CAAC;IACS,aAAa,CAAC,GAAW,EAAE,CAAC,GAAG,mBAAmB;QAC1D,OAAO,KAAK,CAAC,aAAa,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;IACrC,CAAC;IAED,KAAK;QACH,OAAO,IAAI,IAAI,mBAAM,IAAI,CAAC,SAAS,EAAG,CAAC;IACzC,CAAC;IAED,oBAAoB;QAClB,OAAO,IAAI,CAAC,mBAAmB,CAAC;IAClC,CAAC;IAMD,mBAAmB;QACjB,OAAO,IAAI,CAAC,gBAAgB,CAAC;IAC/B,CAAC;IAMD,mBAAmB;QACjB,OAAO,IAAI,CAAC,gBAAgB,CAAC;IAC/B,CAAC;;AAxoBH,oBAqpBC;AAlpBQ,wBAAmB,mBACxB,QAAQ,EAAE,CAAC,EACX,SAAS,EAAE,CAAC,EACZ,SAAS,EAAE,CAAC,EACZ,SAAS,EAAE,CAAC,EACZ,YAAY,EAAE,CAAC,EACf,UAAU,EAAE,CAAC,EACb,UAAU,EAAE,CAAC,IACV,6BAAmB,EACtB;AA8nBK,qBAAgB,GAAG;IACxB,GAAG,EAAE,MAAM;IACX,MAAM,EAAE,OAAO;IACf,MAAM,EAAE,QAAQ;CACjB,CAAC;AAEK,qBAAgB,GAAG;IACxB,IAAI,EAAE,KAAK;IACX,KAAK,EAAE,QAAQ;IACf,MAAM,EAAE,QAAQ;CACjB,CAAC;AAGJ,SAAgB,UAAU,CAAC,UAAiC;IAC1D,OAAO,IAAI,IAAI,CAAC,UAAU,CAAC,CAAC;AAC9B,CAAC;AAFD,gCAEC","file":"text.js","sourcesContent":["import type { IAABBBounds, IOBBBounds } from '@visactor/vutils';\nimport { max, isArray, getContextFont, transformBoundsWithMatrix, rotatePoint } from '@visactor/vutils';\nimport { textDrawOffsetX, textLayoutOffsetY } from '../common/text';\nimport { CanvasTextLayout } from '../core/contributions/textMeasure/layout';\nimport { application } from '../application';\nimport type { IText, ITextCache, ITextGraphicAttribute, LayoutItemType, LayoutType } from '../interface';\nimport { Graphic, GRAPHIC_UPDATE_TAG_KEY, NOWORK_ANIMATE_ATTR } from './graphic';\nimport { getTheme } from './theme';\nimport { calculateLineHeight } from '../common/utils';\nimport { TEXT_NUMBER_TYPE } from './constants';\nimport { boundStroke, TextDirection, verticalLayout } from './tools';\n\nconst TEXT_UPDATE_TAG_KEY = [\n 'text',\n 'maxLineWidth',\n 'maxWidth',\n // 多行文本要用到\n 'textAlign',\n 'textBaseline',\n 'heightLimit',\n 'lineClamp',\n 'fontSize',\n 'fontFamily',\n 'fontWeight',\n 'ellipsis',\n 'lineHeight',\n 'direction',\n 'wordBreak',\n 'heightLimit',\n 'lineClamp',\n ...GRAPHIC_UPDATE_TAG_KEY\n];\n\nexport class Text extends Graphic<ITextGraphicAttribute> implements IText {\n type: 'text' = 'text';\n\n static NOWORK_ANIMATE_ATTR = {\n ellipsis: 1,\n wordBreak: 1,\n direction: 1,\n textAlign: 1,\n textBaseline: 1,\n fontFamily: 1,\n fontWeight: 1,\n ...NOWORK_ANIMATE_ATTR\n };\n\n cache: ITextCache;\n _font: string;\n\n protected declare obbText?: Text;\n\n /**\n * 获取font字符串\n */\n get font(): string {\n const textTheme = this.getGraphicTheme();\n if (!this._font) {\n this._font = getContextFont(this.attribute, textTheme);\n }\n return this._font as string;\n }\n\n get clipedText(): string | undefined {\n const attribute = this.attribute;\n const textTheme = this.getGraphicTheme();\n const maxWidth = this.getMaxWidth(textTheme);\n if (!Number.isFinite(maxWidth)) {\n return (attribute.text ?? textTheme.text).toString();\n }\n this.tryUpdateAABBBounds();\n return this.cache.clipedText;\n }\n\n get clipedWidth(): number | undefined {\n this.tryUpdateAABBBounds();\n return this.cache.clipedWidth;\n }\n\n /**\n * 支持单行文本,横排纵排均支持\n * TODO 支持多行文本\n */\n get cliped(): boolean | undefined {\n const textTheme = this.getGraphicTheme();\n const attribute = this.attribute;\n const maxWidth = this.getMaxWidth(textTheme);\n if (!Number.isFinite(maxWidth)) {\n return false;\n }\n const { text } = this.attribute;\n this.tryUpdateAABBBounds();\n if (this.cache?.layoutData?.lines) {\n let mergedText = '';\n this.cache.layoutData.lines.forEach(item => {\n mergedText += item.str;\n });\n const originText = Array.isArray(text) ? text.join('') : text;\n\n return originText !== mergedText;\n }\n if (attribute.direction === 'vertical' && this.cache.verticalList && this.cache.verticalList[0]) {\n return this.cache.verticalList[0].map(item => item.text).join('') !== attribute.text.toString();\n }\n if (this.clipedText == null) {\n return false;\n }\n return this.clipedText !== attribute.text.toString();\n }\n\n get multilineLayout(): LayoutType | undefined {\n this.tryUpdateAABBBounds();\n return this.cache.layoutData;\n }\n /**\n * 是否是多行文本\n */\n get isMultiLine(): boolean {\n return Array.isArray(this.attribute.text) || this.attribute.whiteSpace === 'normal';\n }\n\n constructor(params: ITextGraphicAttribute = { text: '', fontSize: 16 }) {\n super(params);\n this.numberType = TEXT_NUMBER_TYPE;\n this.cache = {};\n }\n\n /**\n * 图元属性合法,且文字不为空或者null/undefined\n * @returns\n */\n isValid(): boolean {\n return super.isValid() && this._isValid();\n }\n\n protected _isValid(): boolean {\n const { text } = this.attribute;\n if (isArray(text)) {\n return !(text as any[]).every((t: any) => t == null || t === '');\n }\n return text != null && text !== '';\n }\n\n getGraphicTheme(): Required<ITextGraphicAttribute> {\n return getTheme(this).text;\n }\n\n protected doUpdateOBBBounds(): IOBBBounds {\n const graphicTheme = this.getGraphicTheme();\n this._OBBBounds.clear();\n const attribute = this.attribute;\n const { angle = graphicTheme.angle } = attribute;\n if (!angle) {\n const b = this.AABBBounds;\n this._OBBBounds.setValue(b.x1, b.y1, b.x2, b.y2);\n return this._OBBBounds;\n }\n if (!this.obbText) {\n this.obbText = new Text({});\n }\n this.obbText.setAttributes({ ...attribute, angle: 0 });\n const bounds1 = this.obbText.AABBBounds;\n const { x, y } = attribute;\n const boundsCenter = { x: (bounds1.x1 + bounds1.x2) / 2, y: (bounds1.y1 + bounds1.y2) / 2 };\n const center = rotatePoint(boundsCenter, angle, { x, y });\n this._OBBBounds.copy(bounds1);\n this._OBBBounds.translate(center.x - boundsCenter.x, center.y - boundsCenter.y);\n this._OBBBounds.angle = angle;\n return this._OBBBounds;\n }\n\n protected updateAABBBounds(\n attribute: ITextGraphicAttribute,\n textTheme: Required<ITextGraphicAttribute>,\n aabbBounds: IAABBBounds\n ) {\n const { text = textTheme.text } = this.attribute;\n if (Array.isArray(text)) {\n this.updateMultilineAABBBounds(text as (number | string)[]);\n } else {\n this.updateSingallineAABBBounds(text as number | string);\n }\n\n const { tb1 } = application.graphicService.updateTempAABBBounds(aabbBounds);\n\n const {\n scaleX = textTheme.scaleX,\n scaleY = textTheme.scaleY,\n shadowBlur = textTheme.shadowBlur,\n strokeBoundsBuffer = textTheme.strokeBoundsBuffer\n } = attribute;\n if (shadowBlur) {\n const shadowBlurHalfWidth = shadowBlur / Math.abs(scaleX + scaleY);\n boundStroke(tb1, shadowBlurHalfWidth, true, strokeBoundsBuffer);\n aabbBounds.union(tb1);\n }\n // 合并shadowRoot的bounds\n application.graphicService.combindShadowAABBBounds(aabbBounds, this);\n\n if (attribute.forceBoundsHeight != null || attribute.forceBoundsWidth != null) {\n application.graphicService.updateHTMLTextAABBBounds(attribute, textTheme, aabbBounds);\n }\n\n transformBoundsWithMatrix(aabbBounds, aabbBounds, this.transMatrix);\n return aabbBounds;\n }\n\n /**\n * 计算单行文字的bounds,可以缓存长度以及截取的文字\n * @param text\n */\n updateSingallineAABBBounds(text: number | string): IAABBBounds {\n this.updateMultilineAABBBounds([text]);\n const layoutData = this.cache.layoutData;\n if (layoutData && layoutData.lines && layoutData.lines.length) {\n const line = layoutData.lines[0];\n this.cache.clipedText = line.str;\n this.cache.clipedWidth = line.width;\n }\n return this._AABBBounds;\n }\n\n /**\n * 计算单行文字的bounds,可以缓存长度以及截取的文字\n * @param text\n */\n protected updateMultilineAABBBounds(text: (number | string)[]): IAABBBounds {\n const textTheme = this.getGraphicTheme();\n const { direction = textTheme.direction, underlineOffset = textTheme.underlineOffset } = this.attribute;\n\n const b =\n direction === 'horizontal'\n ? this.updateHorizontalMultilineAABBBounds(text)\n : this.updateVerticalMultilineAABBBounds(text);\n\n if (direction === 'horizontal') {\n if (underlineOffset) {\n this._AABBBounds.add(this._AABBBounds.x1, this._AABBBounds.y2 + underlineOffset);\n }\n }\n return b;\n }\n\n guessLineHeightBuf(fontSize: number) {\n return fontSize ? fontSize * 0.1 : 0;\n }\n\n /**\n * 计算多行文字的bounds,缓存每行文字的布局位置\n * @param text\n */\n updateHorizontalMultilineAABBBounds(text: (number | string)[]): IAABBBounds {\n const textTheme = this.getGraphicTheme();\n\n const attribute = this.attribute;\n const {\n fontFamily = textTheme.fontFamily,\n textAlign = textTheme.textAlign,\n textBaseline = textTheme.textBaseline,\n fontSize = textTheme.fontSize,\n fontWeight = textTheme.fontWeight,\n ellipsis = textTheme.ellipsis,\n maxLineWidth,\n stroke = textTheme.stroke,\n wrap = textTheme.wrap,\n measureMode = textTheme.measureMode,\n lineWidth = textTheme.lineWidth,\n whiteSpace = textTheme.whiteSpace,\n suffixPosition = textTheme.suffixPosition,\n ignoreBuf = textTheme.ignoreBuf,\n keepCenterInLine = textTheme.keepCenterInLine\n } = attribute;\n\n const buf = ignoreBuf ? 0 : this.guessLineHeightBuf(fontSize);\n const lineHeight = this.getLineHeight(attribute, textTheme, buf);\n\n if (whiteSpace === 'normal' || wrap) {\n return this.updateWrapAABBBounds(text);\n }\n if (!this.shouldUpdateShape() && this.cache?.layoutData) {\n const bbox = this.cache.layoutData.bbox;\n this._AABBBounds.set(bbox.xOffset, bbox.yOffset, bbox.xOffset + bbox.width, bbox.yOffset + bbox.height);\n if (stroke) {\n this._AABBBounds.expand(lineWidth / 2);\n }\n return this._AABBBounds;\n }\n const textMeasure = application.graphicUtil.textMeasure;\n const layoutObj = new CanvasTextLayout(fontFamily, { fontSize, fontWeight, fontFamily, lineHeight }, textMeasure);\n const layoutData = layoutObj.GetLayoutByLines(\n text,\n textAlign,\n textBaseline as any,\n lineHeight,\n ellipsis === true ? (textTheme.ellipsis as string) : ellipsis || undefined,\n false,\n {\n lineWidth: maxLineWidth,\n suffixPosition,\n measureMode,\n keepCenterInLine\n }\n );\n const { bbox } = layoutData;\n this.cache.layoutData = layoutData;\n this.clearUpdateShapeTag();\n\n this._AABBBounds.set(bbox.xOffset, bbox.yOffset, bbox.xOffset + bbox.width, bbox.yOffset + bbox.height);\n\n if (stroke) {\n this._AABBBounds.expand(lineWidth / 2);\n }\n\n return this._AABBBounds;\n }\n\n /**\n * 计算多行文字的bounds,缓存每行文字的布局位置\n * 自动折行params.text是数组,因此只重新updateMultilineAABBBounds\n * @param text\n */\n updateWrapAABBBounds(text: (number | string) | (number | string)[]) {\n const textTheme = this.getGraphicTheme();\n const {\n fontFamily = textTheme.fontFamily,\n textAlign = textTheme.textAlign,\n textBaseline = textTheme.textBaseline,\n fontSize = textTheme.fontSize,\n ellipsis = textTheme.ellipsis,\n maxLineWidth,\n stroke = textTheme.stroke,\n lineWidth = textTheme.lineWidth,\n wordBreak = textTheme.wordBreak,\n fontWeight = textTheme.fontWeight,\n // widthLimit,\n ignoreBuf = textTheme.ignoreBuf,\n measureMode = textTheme.measureMode,\n suffixPosition = textTheme.suffixPosition,\n heightLimit = 0,\n lineClamp,\n keepCenterInLine = textTheme.keepCenterInLine\n } = this.attribute;\n\n const buf = ignoreBuf ? 0 : this.guessLineHeightBuf(fontSize);\n const lineHeight = this.getLineHeight(this.attribute, textTheme, buf);\n\n if (!this.shouldUpdateShape() && this.cache?.layoutData) {\n const bbox = this.cache.layoutData.bbox;\n this._AABBBounds.set(bbox.xOffset, bbox.yOffset, bbox.xOffset + bbox.width, bbox.yOffset + bbox.height);\n if (stroke) {\n this._AABBBounds.expand(lineWidth / 2);\n }\n return this._AABBBounds;\n }\n\n const textMeasure = application.graphicUtil.textMeasure;\n const textOptions = { fontSize, fontWeight, fontFamily, lineHeight };\n const layoutObj = new CanvasTextLayout(fontFamily, textOptions, textMeasure as any);\n\n // layoutObj内逻辑\n const lines = isArray(text) ? (text.map(l => l.toString()) as string[]) : [text.toString()];\n const linesLayout: LayoutItemType[] = [];\n const bboxWH: [number, number] = [0, 0];\n\n let lineCountLimit = Infinity;\n if (heightLimit > 0) {\n lineCountLimit = Math.max(Math.floor(heightLimit / lineHeight), 1);\n }\n if (lineClamp) {\n // 处理行数限制\n lineCountLimit = Math.min(lineCountLimit, lineClamp);\n }\n\n if (typeof maxLineWidth === 'number' && maxLineWidth !== Infinity) {\n // widthLimit > 0\n if (maxLineWidth > 0) {\n for (let i = 0; i < lines.length; i++) {\n const str = lines[i] as string;\n let needCut = true;\n\n // 判断是否超过高度限制\n if (i === lineCountLimit - 1) {\n // 当前行为最后一行,如果后面还有行,需要显示省略号\n const clip = textMeasure.clipTextWithSuffix(\n str,\n textOptions,\n maxLineWidth,\n ellipsis,\n false,\n suffixPosition,\n i !== lines.length - 1\n );\n const matrics = textMeasure.measureTextPixelADscentAndWidth(clip.str, textOptions, measureMode);\n linesLayout.push({\n str: clip.str,\n width: clip.width,\n ascent: matrics.ascent,\n descent: matrics.descent,\n keepCenterInLine\n });\n break; // 不处理后续行\n }\n\n // 测量截断位置\n const clip = textMeasure.clipText(\n str,\n textOptions,\n maxLineWidth,\n wordBreak !== 'break-all',\n wordBreak === 'keep-all'\n );\n if ((str !== '' && clip.str === '') || clip.wordBreaked) {\n if (ellipsis) {\n const clipEllipsis = textMeasure.clipTextWithSuffix(\n str,\n textOptions,\n maxLineWidth,\n ellipsis,\n false,\n suffixPosition\n );\n clip.str = clipEllipsis.str ?? '';\n clip.width = clipEllipsis.width ?? 0;\n } else {\n // 宽度限制不足一个字符,不显示\n clip.str = '';\n clip.width = 0;\n }\n needCut = false;\n }\n const matrics = textMeasure.measureTextPixelADscentAndWidth(clip.str, textOptions, measureMode);\n linesLayout.push({\n str: clip.str,\n width: clip.width,\n ascent: matrics.ascent,\n descent: matrics.descent,\n keepCenterInLine\n });\n let cutLength = clip.str.length;\n if (clip.wordBreaked && !(str !== '' && clip.str === '')) {\n needCut = true;\n cutLength = clip.wordBreaked;\n }\n if (clip.str.length === str.length) {\n // 不需要截断\n } else if (needCut) {\n let newStr = str.substring(cutLength);\n // 截断后,避免开头有空格很尬,去掉\n if (wordBreak === 'keep-all') {\n newStr = newStr.replace(/^\\s+/g, '');\n }\n lines.splice(i + 1, 0, newStr);\n }\n }\n }\n // bboxWH[0] = maxLineWidth;\n let maxWidth = 0;\n linesLayout.forEach(layout => {\n maxWidth = Math.max(maxWidth, layout.width);\n });\n bboxWH[0] = maxWidth;\n } else {\n // 使用所有行中最长的作为lineWidth\n let lineWidth = 0;\n let width: number;\n let text: string;\n for (let i = 0, len = lines.length; i < len; i++) {\n // 判断是否超过高度限制\n if (i === lineCountLimit - 1) {\n // 当前行为最后一行\n const clip = textMeasure.clipTextWithSuffix(\n lines[i],\n textOptions,\n maxLineWidth,\n ellipsis,\n false,\n suffixPosition\n );\n const matrics = textMeasure.measureTextPixelADscentAndWidth(clip.str, textOptions, measureMode);\n linesLayout.push({\n str: clip.str,\n width: clip.width,\n ascent: matrics.ascent,\n descent: matrics.descent,\n keepCenterInLine\n });\n lineWidth = Math.max(lineWidth, clip.width);\n break; // 不处理后续行\n }\n\n text = lines[i] as string;\n width = textMeasure.measureTextWidth(text, textOptions);\n lineWidth = Math.max(lineWidth, width);\n const matrics = textMeasure.measureTextPixelADscentAndWidth(text, textOptions, measureMode);\n linesLayout.push({ str: text, width, ascent: matrics.ascent, descent: matrics.descent, keepCenterInLine });\n }\n bboxWH[0] = lineWidth;\n }\n bboxWH[1] = linesLayout.length * lineHeight;\n\n const bbox = {\n xOffset: 0,\n yOffset: 0,\n width: bboxWH[0],\n height: bboxWH[1]\n };\n\n layoutObj.LayoutBBox(bbox, textAlign, textBaseline as any, linesLayout);\n\n const layoutData = layoutObj.layoutWithBBox(bbox, linesLayout, textAlign, textBaseline as any, lineHeight);\n\n this.cache.layoutData = layoutData;\n this.clearUpdateShapeTag();\n this._AABBBounds.set(bbox.xOffset, bbox.yOffset, bbox.xOffset + bbox.width, bbox.yOffset + bbox.height);\n\n if (stroke) {\n this._AABBBounds.expand(lineWidth / 2);\n }\n\n return this._AABBBounds;\n }\n\n /**\n * 计算垂直布局的多行文字的bounds,可以缓存长度以及截取的文字\n * @param text\n */\n updateVerticalMultilineAABBBounds(text: (number | string)[]): IAABBBounds {\n const textTheme = this.getGraphicTheme();\n const textMeasure = application.graphicUtil.textMeasure;\n let width: number;\n const attribute = this.attribute;\n const {\n maxLineWidth = textTheme.maxLineWidth,\n ellipsis = textTheme.ellipsis,\n fontFamily = textTheme.fontFamily,\n fontSize = textTheme.fontSize,\n fontWeight = textTheme.fontWeight,\n stroke = textTheme.stroke,\n lineWidth = textTheme.lineWidth,\n // wordBreak = textTheme.wordBreak,\n verticalMode = textTheme.verticalMode,\n suffixPosition = textTheme.suffixPosition\n } = attribute;\n\n const lineHeight = this.getLineHeight(attribute, textTheme, 0);\n\n let { textAlign = textTheme.textAlign, textBaseline = textTheme.textBaseline } = attribute;\n if (!verticalMode) {\n const t = textAlign;\n textAlign = (Text.baselineMapAlign as any)[textBaseline] ?? 'left';\n textBaseline = (Text.alignMapBaseline as any)[t] ?? 'top';\n }\n width = 0;\n if (!this.shouldUpdateShape() && this.cache) {\n this.cache.verticalList.forEach(item => {\n const w = item.reduce((a, b) => a + b.width, 0);\n width = max(w, width);\n });\n const dx = textDrawOffsetX(textAlign, width);\n const height = this.cache.verticalList.length * lineHeight;\n const dy = textLayoutOffsetY(textBaseline, height, fontSize);\n this._AABBBounds.set(dy, dx, dy + height, dx + width);\n if (stroke) {\n this._AABBBounds.expand(lineWidth / 2);\n }\n return this._AABBBounds;\n }\n\n const verticalLists: { text: string; width?: number; direction: TextDirection }[][] = text.map(str => {\n return verticalLayout(str.toString());\n });\n verticalLists.forEach((verticalData, i) => {\n if (Number.isFinite(maxLineWidth)) {\n if (ellipsis) {\n const strEllipsis = (ellipsis === true ? textTheme.ellipsis : ellipsis) as string;\n const data = textMeasure.clipTextWithSuffixVertical(\n verticalData,\n { fontSize, fontWeight, fontFamily },\n maxLineWidth,\n strEllipsis,\n false,\n suffixPosition\n );\n verticalLists[i] = data.verticalList;\n width = data.width;\n } else {\n const data = textMeasure.clipTextVertical(\n verticalData,\n { fontSize, fontWeight, fontFamily },\n maxLineWidth,\n false\n );\n verticalLists[i] = data.verticalList;\n width = data.width;\n }\n // this.cache.clipedWidth = width;\n // todo 计算原本的宽度\n } else {\n width = 0;\n verticalData.forEach(t => {\n const w =\n t.direction === TextDirection.HORIZONTAL\n ? fontSize\n : textMeasure.measureTextWidth(t.text, { fontSize, fontWeight, fontFamily });\n\n width += w;\n t.width = w;\n });\n }\n });\n this.cache.verticalList = verticalLists;\n this.clearUpdateShapeTag();\n\n this.cache.verticalList.forEach(item => {\n const w = item.reduce((a, b) => a + b.width, 0);\n width = max(w, width);\n });\n\n const dx = textDrawOffsetX(textAlign, width);\n const height = this.cache.verticalList.length * lineHeight;\n const dy = textLayoutOffsetY(textBaseline, height, fontSize);\n this._AABBBounds.set(dy, dx, dy + height, dx + width);\n\n if (stroke) {\n this._AABBBounds.expand(lineWidth / 2);\n }\n\n return this._AABBBounds;\n }\n\n // /**\n // * 是否是简单文字\n // * 单行,横排\n // * @returns\n // */\n // protected isSinglelineAndHorizontal(): boolean {\n // return !this.isMultiLine && this.attribute.direction !== 'vertical';\n // }\n\n protected getMaxWidth(theme: ITextGraphicAttribute): number {\n // 传入了maxLineWidth就优先使用,否则使用maxWidth\n const attribute = this.attribute;\n return attribute.maxLineWidth ?? attribute.maxWidth ?? theme.maxWidth;\n }\n\n protected getLineHeight(attribute: ITextGraphicAttribute, textTheme: ITextGraphicAttribute, buf: number) {\n return (\n calculateLineHeight(attribute.lineHeight, attribute.fontSize || textTheme.fontSize) ??\n (attribute.fontSize || textTheme.fontSize) + buf\n );\n }\n\n protected needUpdateTags(keys: string[], k = TEXT_UPDATE_TAG_KEY): boolean {\n return super.needUpdateTags(keys, k);\n }\n protected needUpdateTag(key: string, k = TEXT_UPDATE_TAG_KEY): boolean {\n return super.needUpdateTag(key, k);\n }\n\n clone(): Text {\n return new Text({ ...this.attribute });\n }\n\n getNoWorkAnimateAttr(): Record<string, number> {\n return Text.NOWORK_ANIMATE_ATTR;\n }\n\n /**\n * 用于垂直布局时align和baseline相互转换\n * @returns\n */\n getBaselineMapAlign(): Record<string, string> {\n return Text.baselineMapAlign;\n }\n\n /**\n * 用于垂直布局时align和baseline相互转换\n * @returns\n */\n getAlignMapBaseline(): Record<string, string> {\n return Text.alignMapBaseline;\n }\n\n static baselineMapAlign = {\n top: 'left',\n bottom: 'right',\n middle: 'center'\n };\n\n static alignMapBaseline = {\n left: 'top',\n right: 'bottom',\n center: 'middle'\n };\n}\n\nexport function createText(attributes: ITextGraphicAttribute): IText {\n return new Text(attributes);\n}\n\n// addAttributeToPrototype(DefaultLineStyle, Text, PURE_STYLE_KEY);\n"]}
@@ -40,7 +40,10 @@ class WrapText extends text_1.Text {
40
40
  const clip = layoutObj.textMeasure.clipTextWithSuffix(str, layoutObj.textOptions, maxLineWidth, ellipsis, !1, suffixPosition);
41
41
  linesLayout.push({
42
42
  str: clip.str,
43
- width: clip.width
43
+ width: clip.width,
44
+ ascent: 0,
45
+ descent: 0,
46
+ keepCenterInLine: !1
44
47
  });
45
48
  break;
46
49
  }
@@ -54,7 +57,10 @@ class WrapText extends text_1.Text {
54
57
  }
55
58
  if (linesLayout.push({
56
59
  str: clip.str,
57
- width: clip.width
60
+ width: clip.width,
61
+ ascent: 0,
62
+ descent: 0,
63
+ keepCenterInLine: !1
58
64
  }), clip.str.length === str.length) ; else if (needCut) {
59
65
  const newStr = str.substring(clip.str.length);
60
66
  lines.splice(i + 1, 0, newStr);
@@ -71,14 +77,20 @@ class WrapText extends text_1.Text {
71
77
  const clip = layoutObj.textMeasure.clipTextWithSuffix(lines[i], layoutObj.textOptions, maxLineWidth, ellipsis, !1, suffixPosition);
72
78
  linesLayout.push({
73
79
  str: clip.str,
74
- width: clip.width
80
+ width: clip.width,
81
+ ascent: 0,
82
+ descent: 0,
83
+ keepCenterInLine: !1
75
84
  }), lineWidth = Math.max(lineWidth, clip.width);
76
85
  break;
77
86
  }
78
87
  text = lines[i], width = layoutObj.textMeasure.measureTextWidth(text, layoutObj.textOptions, "break-word" === wordBreak),
79
88
  lineWidth = Math.max(lineWidth, width), linesLayout.push({
80
89
  str: text,
81
- width: width
90
+ width: width,
91
+ ascent: 0,
92
+ descent: 0,
93
+ keepCenterInLine: !1
82
94
  });
83
95
  }
84
96
  bboxWH[0] = lineWidth;
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/graphic/wrap-text.ts"],"names":[],"mappings":";;;AAAA,6CAA2C;AAC3C,qEAA4E;AAE5E,gDAA6C;AAC7C,iCAA8B;AAE9B,2CAAsD;AAEtD,MAAM,wBAAwB,GAAG,CAAC,aAAa,EAAE,WAAW,CAAC,CAAC;AAO9D,MAAa,QAAS,SAAQ,WAAI;IAGhC,YAAY,MAA6B;QACvC,KAAK,iCAAM,MAAM,KAAE,IAAI,EAAE,IAAI,IAAG,CAAC;IACnC,CAAC;IAES,QAAQ;QAChB,MAAM,EAAE,IAAI,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC;QAChC,IAAI,IAAA,gBAAO,EAAC,IAAI,CAAC,EAAE;YACjB,OAAO,CAAE,IAAc,CAAC,KAAK,CAAC,CAAC,CAAM,EAAE,EAAE,CAAC,CAAC,IAAI,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC;SAClE;QACD,OAAO,IAAI,IAAI,IAAI,IAAI,IAAI,KAAK,EAAE,CAAC;IACrC,CAAC;IAOD,yBAAyB,CAAC,IAAyB;;QACjD,MAAM,SAAS,GAAG,IAAI,CAAC,eAAe,EAAE,CAAC;QACzC,MAAM,EACJ,UAAU,GAAG,SAAS,CAAC,UAAU,EACjC,SAAS,GA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,CAAC;aACb;SACF;QACD,OAAO,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;IACpC,CAAC;IAES,aAAa,CAAC,GAAW;QACjC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,wBAAwB,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YACxD,MAAM,OAAO,GAAG,wBAAwB,CAAC,CAAC,CAAC,CAAC;YAC5C,IAAI,GAAG,KAAK,OAAO,EAAE;gBACnB,OAAO,IAAI,CAAC;aACb;SACF;QACD,OAAO,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;IAClC,CAAC;IAED,oBAAoB;QAClB,OAAO,QAAQ,CAAC,mBAAmB,CAAC;IACtC,CAAC;CACF;AAxOD,4BAwOC;AAED,SAAgB,cAAc,CAAC,UAAiC;IAC9D,OAAO,IAAI,QAAQ,CAAC,UAAU,CAAC,CAAC;AAClC,CAAC;AAFD,wCAEC","file":"wrap-text.js","sourcesContent":["import { isArray } from '@visactor/vutils';\nimport { CanvasTextLayout } from '../core/contributions/textMeasure/layout';\nimport type { IText, ITextGraphicAttribute, IWrapTextGraphicAttribute, LayoutItemType } from '../interface';\nimport { application } from '../application';\nimport { Text } from './text';\nimport { getTheme } from './theme';\nimport { calculateLineHeight } from '../common/utils';\n\nconst WRAP_TEXT_UPDATE_TAG_KEY = ['heightLimit', 'lineClamp'];\n\n/* WrapText功能\n * 1. 按照宽度限制自动折行或显示省略号(maxLineWidth)\n * 2. 高度限制控制显示内容及省略号(heightLimit)\n * 3. 按照行数限制显示内容及省略号(lineClamp)\n */\nexport class WrapText extends Text {\n declare attribute: IWrapTextGraphicAttribute;\n\n constructor(params: ITextGraphicAttribute) {\n super({ ...params, wrap: true });\n }\n\n protected _isValid(): boolean {\n const { text } = this.attribute;\n if (isArray(text)) {\n return !(text as any[]).every((t: any) => t == null || t === '');\n }\n return text != null && text !== '';\n }\n\n /**\n * 计算多行文字的bounds,缓存每行文字的布局位置\n * 自动折行params.text是数组,因此只重新updateMultilineAABBBounds\n * @param text\n */\n updateMultilineAABBBounds(text: (number | string)[]) {\n const textTheme = this.getGraphicTheme();\n const {\n fontFamily = textTheme.fontFamily,\n textAlign = textTheme.textAlign,\n textBaseline = textTheme.textBaseline,\n fontSize = textTheme.fontSize,\n ellipsis = textTheme.ellipsis,\n maxLineWidth,\n stroke = textTheme.stroke,\n lineWidth = textTheme.lineWidth,\n wordBreak = textTheme.wordBreak,\n fontWeight = textTheme.fontWeight,\n // widthLimit,\n ignoreBuf = textTheme.ignoreBuf,\n heightLimit = 0,\n suffixPosition = textTheme.suffixPosition,\n lineClamp\n } = this.attribute;\n const lineHeight =\n calculateLineHeight(this.attribute.lineHeight, this.attribute.fontSize || textTheme.fontSize) ??\n (this.attribute.fontSize || textTheme.fontSize);\n const buf = ignoreBuf ? 0 : 2;\n if (!this.shouldUpdateShape() && this.cache?.layoutData) {\n const bbox = this.cache.layoutData.bbox;\n this._AABBBounds.set(bbox.xOffset, bbox.yOffset, bbox.xOffset + bbox.width, bbox.yOffset + bbox.height);\n if (stroke) {\n this._AABBBounds.expand(lineWidth / 2);\n }\n return this._AABBBounds;\n }\n\n const textMeasure = application.graphicUtil.textMeasure;\n const layoutObj = new CanvasTextLayout(fontFamily, { fontSize, fontWeight, fontFamily }, textMeasure as any) as any;\n\n // layoutObj内逻辑\n const lines = text.map(l => l.toString()) as string[];\n const linesLayout: LayoutItemType[] = [];\n const bboxWH: [number, number] = [0, 0];\n\n let lineCountLimit = Infinity;\n if (heightLimit > 0) {\n lineCountLimit = Math.max(Math.floor(heightLimit / lineHeight), 1);\n }\n if (lineClamp) {\n // 处理行数限制\n lineCountLimit = Math.min(lineCountLimit, lineClamp);\n }\n\n if (typeof maxLineWidth === 'number' && maxLineWidth !== Infinity) {\n // widthLimit > 0\n if (maxLineWidth > 0) {\n for (let i = 0; i < lines.length; i++) {\n const str = lines[i] as string;\n let needCut = true;\n // // 测量当前行宽度\n // width = Math.min(\n // layoutObj.textMeasure.measureTextWidth(str, layoutObj.textOptions),\n // maxLineWidth\n // );\n\n // 判断是否超过高度限制\n if (i === lineCountLimit - 1) {\n // 当前行为最后一行\n const clip = layoutObj.textMeasure.clipTextWithSuffix(\n str,\n layoutObj.textOptions,\n maxLineWidth,\n ellipsis,\n false,\n suffixPosition\n );\n linesLayout.push({\n str: clip.str,\n width: clip.width\n });\n break; // 不处理后续行\n }\n\n // 测量截断位置\n const clip = layoutObj.textMeasure.clipText(\n str,\n layoutObj.textOptions,\n maxLineWidth,\n wordBreak === 'break-word'\n );\n if (str !== '' && clip.str === '') {\n if (ellipsis) {\n const clipEllipsis = layoutObj.textMeasure.clipTextWithSuffix(\n str,\n layoutObj.textOptions,\n maxLineWidth,\n ellipsis,\n false,\n suffixPosition\n );\n clip.str = clipEllipsis.str ?? '';\n clip.width = clipEllipsis.width ?? 0;\n } else {\n // 宽度限制不足一个字符,不显示\n clip.str = '';\n clip.width = 0;\n }\n needCut = false;\n }\n\n linesLayout.push({\n str: clip.str,\n width: clip.width\n });\n if (clip.str.length === str.length) {\n // 不需要截断\n } else if (needCut) {\n const newStr = str.substring(clip.str.length);\n lines.splice(i + 1, 0, newStr);\n }\n }\n }\n // bboxWH[0] = maxLineWidth;\n let maxWidth = 0;\n linesLayout.forEach(layout => {\n maxWidth = Math.max(maxWidth, layout.width);\n });\n bboxWH[0] = maxWidth;\n } else {\n // 使用所有行中最长的作为lineWidth\n let lineWidth = 0;\n let width: number;\n let text: string;\n for (let i = 0, len = lines.length; i < len; i++) {\n // 判断是否超过高度限制\n if (i === lineCountLimit - 1) {\n // 当前行为最后一行\n const clip = layoutObj.textMeasure.clipTextWithSuffix(\n lines[i],\n layoutObj.textOptions,\n maxLineWidth,\n ellipsis,\n false,\n suffixPosition\n );\n linesLayout.push({\n str: clip.str,\n width: clip.width\n });\n lineWidth = Math.max(lineWidth, clip.width);\n break; // 不处理后续行\n }\n\n text = lines[i] as string;\n width = layoutObj.textMeasure.measureTextWidth(text, layoutObj.textOptions, wordBreak === 'break-word');\n lineWidth = Math.max(lineWidth, width);\n linesLayout.push({ str: text, width });\n }\n bboxWH[0] = lineWidth;\n }\n bboxWH[1] = linesLayout.length * (lineHeight + buf);\n\n const bbox = {\n xOffset: 0,\n yOffset: 0,\n width: bboxWH[0],\n height: bboxWH[1]\n };\n\n layoutObj.LayoutBBox(bbox, textAlign, textBaseline as any);\n\n const layoutData = layoutObj.layoutWithBBox(bbox, linesLayout, textAlign, textBaseline as any, lineHeight);\n\n // const layoutData = layoutObj.GetLayoutByLines(\n // text,\n // textAlign,\n // textBaseline as any,\n // lineHeight,\n // ellipsis === true ? (DefaultTextAttribute.ellipsis as string) : ellipsis || undefined,\n // maxLineWidth\n // );\n // const { bbox } = layoutData;\n this.cache.layoutData = layoutData;\n this.clearUpdateShapeTag();\n this._AABBBounds.set(bbox.xOffset, bbox.yOffset, bbox.xOffset + bbox.width, bbox.yOffset + bbox.height);\n\n if (stroke) {\n this._AABBBounds.expand(lineWidth / 2);\n }\n\n return this._AABBBounds;\n }\n\n protected needUpdateTags(keys: string[]): boolean {\n for (let i = 0; i < WRAP_TEXT_UPDATE_TAG_KEY.length; i++) {\n const attrKey = WRAP_TEXT_UPDATE_TAG_KEY[i];\n if (keys.indexOf(attrKey) !== -1) {\n return true;\n }\n }\n return super.needUpdateTags(keys);\n }\n\n protected needUpdateTag(key: string): boolean {\n for (let i = 0; i < WRAP_TEXT_UPDATE_TAG_KEY.length; i++) {\n const attrKey = WRAP_TEXT_UPDATE_TAG_KEY[i];\n if (key === attrKey) {\n return true;\n }\n }\n return super.needUpdateTag(key);\n }\n\n getNoWorkAnimateAttr(): Record<string, number> {\n return WrapText.NOWORK_ANIMATE_ATTR;\n }\n}\n\nexport function createWrapText(attributes: ITextGraphicAttribute): IText {\n return new WrapText(attributes);\n}\n"]}
1
+ {"version":3,"sources":["../src/graphic/wrap-text.ts"],"names":[],"mappings":";;;AAAA,6CAA2C;AAC3C,qEAA4E;AAE5E,gDAA6C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AAC,CAAC,CAAC,CAAC;YAC5C,IAAI,GAAG,KAAK,OAAO,EAAE;gBACnB,OAAO,IAAI,CAAC;aACb;SACF;QACD,OAAO,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;IAClC,CAAC;IAED,oBAAoB;QAClB,OAAO,QAAQ,CAAC,mBAAmB,CAAC;IACtC,CAAC;CACF;AAjPD,4BAiPC;AAED,SAAgB,cAAc,CAAC,UAAiC;IAC9D,OAAO,IAAI,QAAQ,CAAC,UAAU,CAAC,CAAC;AAClC,CAAC;AAFD,wCAEC","file":"wrap-text.js","sourcesContent":["import { isArray } from '@visactor/vutils';\nimport { CanvasTextLayout } from '../core/contributions/textMeasure/layout';\nimport type { IText, ITextGraphicAttribute, IWrapTextGraphicAttribute, LayoutItemType } from '../interface';\nimport { application } from '../application';\nimport { Text } from './text';\nimport { getTheme } from './theme';\nimport { calculateLineHeight } from '../common/utils';\n\nconst WRAP_TEXT_UPDATE_TAG_KEY = ['heightLimit', 'lineClamp'];\n\n/* WrapText功能\n * 1. 按照宽度限制自动折行或显示省略号(maxLineWidth)\n * 2. 高度限制控制显示内容及省略号(heightLimit)\n * 3. 按照行数限制显示内容及省略号(lineClamp)\n */\nexport class WrapText extends Text {\n declare attribute: IWrapTextGraphicAttribute;\n\n constructor(params: ITextGraphicAttribute) {\n super({ ...params, wrap: true });\n }\n\n protected _isValid(): boolean {\n const { text } = this.attribute;\n if (isArray(text)) {\n return !(text as any[]).every((t: any) => t == null || t === '');\n }\n return text != null && text !== '';\n }\n\n /**\n * 计算多行文字的bounds,缓存每行文字的布局位置\n * 自动折行params.text是数组,因此只重新updateMultilineAABBBounds\n * @param text\n */\n updateMultilineAABBBounds(text: (number | string)[]) {\n const textTheme = this.getGraphicTheme();\n const {\n fontFamily = textTheme.fontFamily,\n textAlign = textTheme.textAlign,\n textBaseline = textTheme.textBaseline,\n fontSize = textTheme.fontSize,\n ellipsis = textTheme.ellipsis,\n maxLineWidth,\n stroke = textTheme.stroke,\n lineWidth = textTheme.lineWidth,\n wordBreak = textTheme.wordBreak,\n fontWeight = textTheme.fontWeight,\n // widthLimit,\n ignoreBuf = textTheme.ignoreBuf,\n heightLimit = 0,\n suffixPosition = textTheme.suffixPosition,\n lineClamp\n } = this.attribute;\n const lineHeight =\n calculateLineHeight(this.attribute.lineHeight, this.attribute.fontSize || textTheme.fontSize) ??\n (this.attribute.fontSize || textTheme.fontSize);\n const buf = ignoreBuf ? 0 : 2;\n if (!this.shouldUpdateShape() && this.cache?.layoutData) {\n const bbox = this.cache.layoutData.bbox;\n this._AABBBounds.set(bbox.xOffset, bbox.yOffset, bbox.xOffset + bbox.width, bbox.yOffset + bbox.height);\n if (stroke) {\n this._AABBBounds.expand(lineWidth / 2);\n }\n return this._AABBBounds;\n }\n\n const textMeasure = application.graphicUtil.textMeasure;\n const layoutObj = new CanvasTextLayout(fontFamily, { fontSize, fontWeight, fontFamily }, textMeasure as any) as any;\n\n // layoutObj内逻辑\n const lines = text.map(l => l.toString()) as string[];\n const linesLayout: LayoutItemType[] = [];\n const bboxWH: [number, number] = [0, 0];\n\n let lineCountLimit = Infinity;\n if (heightLimit > 0) {\n lineCountLimit = Math.max(Math.floor(heightLimit / lineHeight), 1);\n }\n if (lineClamp) {\n // 处理行数限制\n lineCountLimit = Math.min(lineCountLimit, lineClamp);\n }\n\n if (typeof maxLineWidth === 'number' && maxLineWidth !== Infinity) {\n // widthLimit > 0\n if (maxLineWidth > 0) {\n for (let i = 0; i < lines.length; i++) {\n const str = lines[i] as string;\n let needCut = true;\n // // 测量当前行宽度\n // width = Math.min(\n // layoutObj.textMeasure.measureTextWidth(str, layoutObj.textOptions),\n // maxLineWidth\n // );\n\n // 判断是否超过高度限制\n if (i === lineCountLimit - 1) {\n // 当前行为最后一行\n const clip = layoutObj.textMeasure.clipTextWithSuffix(\n str,\n layoutObj.textOptions,\n maxLineWidth,\n ellipsis,\n false,\n suffixPosition\n );\n linesLayout.push({\n str: clip.str,\n width: clip.width,\n ascent: 0,\n descent: 0,\n keepCenterInLine: false\n });\n break; // 不处理后续行\n }\n\n // 测量截断位置\n const clip = layoutObj.textMeasure.clipText(\n str,\n layoutObj.textOptions,\n maxLineWidth,\n wordBreak === 'break-word'\n );\n if (str !== '' && clip.str === '') {\n if (ellipsis) {\n const clipEllipsis = layoutObj.textMeasure.clipTextWithSuffix(\n str,\n layoutObj.textOptions,\n maxLineWidth,\n ellipsis,\n false,\n suffixPosition\n );\n clip.str = clipEllipsis.str ?? '';\n clip.width = clipEllipsis.width ?? 0;\n } else {\n // 宽度限制不足一个字符,不显示\n clip.str = '';\n clip.width = 0;\n }\n needCut = false;\n }\n\n linesLayout.push({\n str: clip.str,\n width: clip.width,\n ascent: 0,\n descent: 0,\n keepCenterInLine: false\n });\n if (clip.str.length === str.length) {\n // 不需要截断\n } else if (needCut) {\n const newStr = str.substring(clip.str.length);\n lines.splice(i + 1, 0, newStr);\n }\n }\n }\n // bboxWH[0] = maxLineWidth;\n let maxWidth = 0;\n linesLayout.forEach(layout => {\n maxWidth = Math.max(maxWidth, layout.width);\n });\n bboxWH[0] = maxWidth;\n } else {\n // 使用所有行中最长的作为lineWidth\n let lineWidth = 0;\n let width: number;\n let text: string;\n for (let i = 0, len = lines.length; i < len; i++) {\n // 判断是否超过高度限制\n if (i === lineCountLimit - 1) {\n // 当前行为最后一行\n const clip = layoutObj.textMeasure.clipTextWithSuffix(\n lines[i],\n layoutObj.textOptions,\n maxLineWidth,\n ellipsis,\n false,\n suffixPosition\n );\n linesLayout.push({\n str: clip.str,\n width: clip.width,\n ascent: 0,\n descent: 0,\n keepCenterInLine: false\n });\n lineWidth = Math.max(lineWidth, clip.width);\n break; // 不处理后续行\n }\n\n text = lines[i] as string;\n width = layoutObj.textMeasure.measureTextWidth(text, layoutObj.textOptions, wordBreak === 'break-word');\n lineWidth = Math.max(lineWidth, width);\n linesLayout.push({ str: text, width, ascent: 0, descent: 0, keepCenterInLine: false });\n }\n bboxWH[0] = lineWidth;\n }\n bboxWH[1] = linesLayout.length * (lineHeight + buf);\n\n const bbox = {\n xOffset: 0,\n yOffset: 0,\n width: bboxWH[0],\n height: bboxWH[1]\n };\n\n layoutObj.LayoutBBox(bbox, textAlign, textBaseline as any);\n\n const layoutData = layoutObj.layoutWithBBox(bbox, linesLayout, textAlign, textBaseline as any, lineHeight);\n\n // const layoutData = layoutObj.GetLayoutByLines(\n // text,\n // textAlign,\n // textBaseline as any,\n // lineHeight,\n // ellipsis === true ? (DefaultTextAttribute.ellipsis as string) : ellipsis || undefined,\n // maxLineWidth\n // );\n // const { bbox } = layoutData;\n this.cache.layoutData = layoutData;\n this.clearUpdateShapeTag();\n this._AABBBounds.set(bbox.xOffset, bbox.yOffset, bbox.xOffset + bbox.width, bbox.yOffset + bbox.height);\n\n if (stroke) {\n this._AABBBounds.expand(lineWidth / 2);\n }\n\n return this._AABBBounds;\n }\n\n protected needUpdateTags(keys: string[]): boolean {\n for (let i = 0; i < WRAP_TEXT_UPDATE_TAG_KEY.length; i++) {\n const attrKey = WRAP_TEXT_UPDATE_TAG_KEY[i];\n if (keys.indexOf(attrKey) !== -1) {\n return true;\n }\n }\n return super.needUpdateTags(keys);\n }\n\n protected needUpdateTag(key: string): boolean {\n for (let i = 0; i < WRAP_TEXT_UPDATE_TAG_KEY.length; i++) {\n const attrKey = WRAP_TEXT_UPDATE_TAG_KEY[i];\n if (key === attrKey) {\n return true;\n }\n }\n return super.needUpdateTag(key);\n }\n\n getNoWorkAnimateAttr(): Record<string, number> {\n return WrapText.NOWORK_ANIMATE_ATTR;\n }\n}\n\nexport function createWrapText(attributes: ITextGraphicAttribute): IText {\n return new WrapText(attributes);\n}\n"]}
package/cjs/index.d.ts CHANGED
@@ -89,4 +89,3 @@ export * from './plugins/builtin-plugin/html-attribute-plugin';
89
89
  export * from './plugins/builtin-plugin/react-attribute-plugin';
90
90
  export * from './plugins/builtin-plugin/3dview-transform-plugin';
91
91
  export * from './plugins/builtin-plugin/flex-layout-plugin';
92
- export * from './animate/easing-func';
package/cjs/index.js CHANGED
@@ -76,5 +76,5 @@ __exportStar(require("./register/register-shadowRoot"), exports), __exportStar(r
76
76
  __exportStar(require("./plugins/builtin-plugin/html-attribute-plugin"), exports),
77
77
  __exportStar(require("./plugins/builtin-plugin/react-attribute-plugin"), exports),
78
78
  __exportStar(require("./plugins/builtin-plugin/3dview-transform-plugin"), exports),
79
- __exportStar(require("./plugins/builtin-plugin/flex-layout-plugin"), exports), __exportStar(require("./animate/easing-func"), exports);
79
+ __exportStar(require("./plugins/builtin-plugin/flex-layout-plugin"), exports);
80
80
  //# sourceMappingURL=index.js.map
package/cjs/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AACA,qBAAmB;AAEnB,8CAA4B;AAC5B,gDAA8B;AAC9B,4CAA0B;AAC1B,4CAA0B;AAC1B,2CAAyB;AACzB,0CAAwB;AACxB,8CAA4B;AAC5B,2CAAyB;AACzB,4EAA0D;AAC1D,2CAAyB;AACzB,yCAAuB;AACvB,+CAA6B;AAC7B,gDAA8B;AAC9B,2CAAyB;AACzB,4CAA0B;AAC1B,2DAAyC;AACzC,iDAA+B;AAC/B,4CAA0B;AAG1B,gDAA8B;AAC9B,wDAAsC;AACtC,0DAAwC;AACxC,uDAAqC;AACrC,yDAAuC;AACvC,mDAAiC;AACjC,wDAAsC;AACtC,iEAA+C;AAC/C,qDAAmC;AACnC,iDAA+B;AAC/B,qDAAmC;AACnC,sDAAoC;AACpC,kDAAgC;AAChC,oDAAkC;AAElC,oDAAkC;AAClC,wDAAsC;AACtC,uDAAqC;AACrC,+DAA6C;AAC7C,gDAA8B;AAC9B,0DAAwC;AACxC,sDAAoC;AACpC,iDAA+B;AAC/B,qDAAmC;AACnC,sDAAoC;AACpC,gFAA8D;AAC9D,8DAA4C;AAC5C,8DAA4C;AAC5C,+DAA6C;AAE7C,2DAAyC;AACzC,sCAAwD;AAA/C,kGAAA,UAAU,OAAA;AAAE,mGAAA,WAAW,OAAA;AAChC,+CAA6B;AAC7B,0DAAwC;AACxC,8CAA4B;AAC5B,gDAA8B;AAC9B,8CAA4B;AAE5B,2EAAyD;AACzD,4EAA0D;AAC1D,4EAA0D;AAC1D,4EAA0D;AAC1D,8EAA4D;AAC5D,8EAA4D;AAC5D,4EAA0D;AAC1D,4EAA0D;AAC1D,+EAA6D;AAC7D,6EAA2D;AAC3D,gFAA8D;AAC9D,6EAA2D;AAC3D,8EAA4D;AAC5D,6EAA2D;AAC3D,iFAA+D;AAE/D,0DAAwC;AACxC,4DAA0C;AAC1C,2DAAyC;AACzC,6DAA2C;AAC3C,4DAA0C;AAC1C,4DAA0C;AAC1C,4DAA0C;AAC1C,2DAAyC;AACzC,2DAAyC;AACzC,8DAA4C;AAC5C,gEAA8C;AAC9C,2DAAyC;AACzC,6DAA2C;AAC3C,+DAA6C;AAC7C,6DAA2C;AAC3C,2DAAyC;AACzC,iEAA+C;AAC/C,+DAA6C;AAG7C,iFAA+D;AAC/D,kFAAgE;AAChE,mFAAiE;AACjE,8EAA4D;AAE5D,wDAAsC","file":"index.js","sourcesContent":["// import 'core-js/proposals/reflect-metadata';\nimport './modules';\n\nexport * from './container';\nexport * from './core/global';\nexport * from './graphic';\nexport * from './modules';\nexport * from './create';\nexport * from './event';\nexport * from './interface';\nexport * from './render';\nexport * from './render/contributions/render/base-render';\nexport * from './canvas';\nexport * from './core';\nexport * from './core/light';\nexport * from './core/camera';\nexport * from './picker';\nexport * from './animate';\nexport * from './resource-loader/loader';\nexport * from './color-string';\nexport * from './factory';\n\n/* export common */\nexport * from './common/text';\nexport * from './common/bezier-utils';\nexport * from './common/bounds-context';\nexport * from './common/seg-context';\nexport * from './common/custom-path2d';\nexport * from './common/segment';\nexport * from './common/canvas-utils';\nexport * from './common/contribution-provider';\nexport * from './common/generator';\nexport * from './common/utils';\nexport * from './common/shape/arc';\nexport * from './common/shape/rect';\nexport * from './common/matrix';\nexport * from './common/simplify';\n\nexport * from './common/path-svg';\nexport * from './common/render-curve';\nexport * from './common/render-area';\nexport * from './common/render-command-list';\nexport * from './common/sort';\nexport * from './common/morphing-utils';\nexport * from './common/split-path';\nexport * from './common/enums';\nexport * from './common/generator';\nexport * from './plugins/constants';\nexport * from './plugins/builtin-plugin/richtext-edit-plugin';\nexport * from './allocator/matrix-allocate';\nexport * from './allocator/canvas-allocate';\nexport * from './allocator/graphic-allocate';\n\nexport * from './animate/default-ticker';\nexport { wrapCanvas, wrapContext } from './canvas/util';\nexport * from './common/xml';\nexport * from './common/inversify-lite';\nexport * from './constants';\nexport * from './application';\nexport * from './env-check';\n\nexport * from './render/contributions/render/arc-module';\nexport * from './render/contributions/render/rect-module';\nexport * from './render/contributions/render/line-module';\nexport * from './render/contributions/render/area-module';\nexport * from './render/contributions/render/symbol-module';\nexport * from './render/contributions/render/circle-module';\nexport * from './render/contributions/render/text-module';\nexport * from './render/contributions/render/path-module';\nexport * from './render/contributions/render/polygon-module';\nexport * from './render/contributions/render/glyph-module';\nexport * from './render/contributions/render/richtext-module';\nexport * from './render/contributions/render/image-module';\nexport * from './render/contributions/render/rect3d-module';\nexport * from './render/contributions/render/arc3d-module';\nexport * from './render/contributions/render/pyramid3d-module';\n\nexport * from './register/register-arc';\nexport * from './register/register-arc3d';\nexport * from './register/register-area';\nexport * from './register/register-circle';\nexport * from './register/register-glyph';\nexport * from './register/register-group';\nexport * from './register/register-image';\nexport * from './register/register-line';\nexport * from './register/register-path';\nexport * from './register/register-polygon';\nexport * from './register/register-pyramid3d';\nexport * from './register/register-rect';\nexport * from './register/register-rect3d';\nexport * from './register/register-richtext';\nexport * from './register/register-symbol';\nexport * from './register/register-text';\nexport * from './register/register-shadowRoot';\nexport * from './register/register-wraptext';\n\n// plugin\nexport * from './plugins/builtin-plugin/html-attribute-plugin';\nexport * from './plugins/builtin-plugin/react-attribute-plugin';\nexport * from './plugins/builtin-plugin/3dview-transform-plugin';\nexport * from './plugins/builtin-plugin/flex-layout-plugin';\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,6DAA2C;AAC3C,4DAA0C;AAC1C,4DAA0C;AAC1C,4DAA0C;AAC1C,2DAAyC;AACzC,2DAAyC;AACzC,8DAA4C;AAC5C,gEAA8C;AAC9C,2DAAyC;AACzC,6DAA2C;AAC3C,+DAA6C;AAC7C,6DAA2C;AAC3C,2DAAyC;AACzC,iEAA+C;AAC/C,+DAA6C;AAG7C,iFAA+D;AAC/D,kFAAgE;AAChE,mFAAiE;AACjE,8EAA4D","file":"index.js","sourcesContent":["// import 'core-js/proposals/reflect-metadata';\nimport './modules';\n\nexport * from './container';\nexport * from './core/global';\nexport * from './graphic';\nexport * from './modules';\nexport * from './create';\nexport * from './event';\nexport * from './interface';\nexport * from './render';\nexport * from './render/contributions/render/base-render';\nexport * from './canvas';\nexport * from './core';\nexport * from './core/light';\nexport * from './core/camera';\nexport * from './picker';\nexport * from './animate';\nexport * from './resource-loader/loader';\nexport * from './color-string';\nexport * from './factory';\n\n/* export common */\nexport * from './common/text';\nexport * from './common/bezier-utils';\nexport * from './common/bounds-context';\nexport * from './common/seg-context';\nexport * from './common/custom-path2d';\nexport * from './common/segment';\nexport * from './common/canvas-utils';\nexport * from './common/contribution-provider';\nexport * from './common/generator';\nexport * from './common/utils';\nexport * from './common/shape/arc';\nexport * from './common/shape/rect';\nexport * from './common/matrix';\nexport * from './common/simplify';\n\nexport * from './common/path-svg';\nexport * from './common/render-curve';\nexport * from './common/render-area';\nexport * from './common/render-command-list';\nexport * from './common/sort';\nexport * from './common/morphing-utils';\nexport * from './common/split-path';\nexport * from './common/enums';\nexport * from './common/generator';\nexport * from './plugins/constants';\nexport * from './plugins/builtin-plugin/richtext-edit-plugin';\nexport * from './allocator/matrix-allocate';\nexport * from './allocator/canvas-allocate';\nexport * from './allocator/graphic-allocate';\n\nexport * from './animate/default-ticker';\nexport { wrapCanvas, wrapContext } from './canvas/util';\nexport * from './common/xml';\nexport * from './common/inversify-lite';\nexport * from './constants';\nexport * from './application';\nexport * from './env-check';\n\nexport * from './render/contributions/render/arc-module';\nexport * from './render/contributions/render/rect-module';\nexport * from './render/contributions/render/line-module';\nexport * from './render/contributions/render/area-module';\nexport * from './render/contributions/render/symbol-module';\nexport * from './render/contributions/render/circle-module';\nexport * from './render/contributions/render/text-module';\nexport * from './render/contributions/render/path-module';\nexport * from './render/contributions/render/polygon-module';\nexport * from './render/contributions/render/glyph-module';\nexport * from './render/contributions/render/richtext-module';\nexport * from './render/contributions/render/image-module';\nexport * from './render/contributions/render/rect3d-module';\nexport * from './render/contributions/render/arc3d-module';\nexport * from './render/contributions/render/pyramid3d-module';\n\nexport * from './register/register-arc';\nexport * from './register/register-arc3d';\nexport * from './register/register-area';\nexport * from './register/register-circle';\nexport * from './register/register-glyph';\nexport * from './register/register-group';\nexport * from './register/register-image';\nexport * from './register/register-line';\nexport * from './register/register-path';\nexport * from './register/register-polygon';\nexport * from './register/register-pyramid3d';\nexport * from './register/register-rect';\nexport * from './register/register-rect3d';\nexport * from './register/register-richtext';\nexport * from './register/register-symbol';\nexport * from './register/register-text';\nexport * from './register/register-shadowRoot';\nexport * from './register/register-wraptext';\n\n// plugin\nexport * from './plugins/builtin-plugin/html-attribute-plugin';\nexport * from './plugins/builtin-plugin/react-attribute-plugin';\nexport * from './plugins/builtin-plugin/3dview-transform-plugin';\nexport * from './plugins/builtin-plugin/flex-layout-plugin';\n"]}
@@ -43,7 +43,7 @@ export declare class Easing {
43
43
  export interface Timeline {
44
44
  AnimateList: IAnimate[];
45
45
  }
46
- export type EasingTypeStr = 'linear' | 'quadIn' | 'quadOut' | 'quadInOut' | 'quadInOut' | 'cubicIn' | 'cubicOut' | 'cubicInOut' | 'quartIn' | 'quartOut' | 'quartInOut' | 'quintIn' | 'quintOut' | 'quintInOut' | 'backIn' | 'backOut' | 'backInOut' | 'circIn' | 'circOut' | 'circInOut' | 'bounceOut' | 'bounceIn' | 'bounceInOut' | 'elasticIn' | 'elasticOut' | 'elasticInOut' | 'sineIn' | 'sineOut' | 'sineInOut' | 'expoIn' | 'expoOut' | 'expoInOut' | 'easeInOutQuad' | 'easeOutElastic' | 'easeInOutElastic' | '';
46
+ export type EasingTypeStr = 'linear' | 'quadIn' | 'quadOut' | 'quadInOut' | 'quadInOut' | 'cubicIn' | 'cubicOut' | 'cubicInOut' | 'quartIn' | 'quartOut' | 'quartInOut' | 'quintIn' | 'quintOut' | 'quintInOut' | 'backIn' | 'backOut' | 'backInOut' | 'circIn' | 'circOut' | 'circInOut' | 'bounceOut' | 'bounceIn' | 'bounceInOut' | 'elasticIn' | 'elasticOut' | 'elasticInOut' | 'sineIn' | 'sineOut' | 'sineInOut' | 'expoIn' | 'expoOut' | 'expoInOut' | '';
47
47
  export type EasingTypeFunc = (t: number) => number;
48
48
  export type EasingType = EasingTypeStr | EasingTypeFunc;
49
49
  export type IAnimateStepType = keyof typeof AnimateStepType;
@@ -103,7 +103,6 @@ export interface IAnimate {
103
103
  getStartProps: () => Record<string, any>;
104
104
  getEndProps: () => Record<string, any>;
105
105
  setTimeline: (timeline: ITimeline) => void;
106
- readonly timeline: ITimeline;
107
106
  bind: (target: IAnimateTarget) => this;
108
107
  to: (props: Record<string, any>, duration: number, easing: EasingType, params?: IStepConfig) => this;
109
108
  from: (props: Record<string, any>, duration: number, easing: EasingType, params?: IStepConfig) => this;
@@ -191,7 +190,5 @@ export interface ITicker extends EventEmitter {
191
190
  stop: () => void;
192
191
  addTimeline: (timeline: ITimeline) => void;
193
192
  remTimeline: (timeline: ITimeline) => void;
194
- getTimelines: () => ITimeline[];
195
- release: () => void;
196
- autoStop: boolean;
193
+ trySyncTickStatus: () => void;
197
194
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/interface/animate.ts"],"names":[],"mappings":"","file":"animate.js","sourcesContent":["import type { EventEmitter } from '@visactor/vutils';\nimport type { AnimateMode, AnimateStatus, AnimateStepType } from '../common/enums';\nimport type { Releaseable } from './common';\nimport type { IGraphic } from './graphic';\n\n// export type EasingType = (...args: any) => any;\n\nexport declare class Easing {\n static linear(t: number): number;\n static none(): typeof Easing.linear;\n /**\n * 获取缓动函数,amount指示这个缓动函数的插值方式\n * @param amount\n * @returns\n */\n static get(amount: number): (t: number) => number;\n static getPowIn(pow: number): (t: number) => number;\n static getPowOut(pow: number): (t: number) => number;\n static getPowInOut(pow: number): (t: number) => number;\n static quadIn: (t: number) => number;\n static quadOut: (t: number) => number;\n static quadInOut: (t: number) => number;\n static cubicIn: (t: number) => number;\n static cubicOut: (t: number) => number;\n static cubicInOut: (t: number) => number;\n static quartIn: (t: number) => number;\n static quartOut: (t: number) => number;\n static quartInOut: (t: number) => number;\n static quintIn: (t: number) => number;\n static quintOut: (t: number) => number;\n static quintInOut: (t: number) => number;\n static getBackIn(amount: number): (t: number) => number;\n static getBackOut(amount: number): (t: number) => number;\n static getBackInOut(amount: number): (t: number) => number;\n static backIn: (t: number) => number;\n static backOut: (t: number) => number;\n static backInOut: (t: number) => number;\n static circIn(t: number): number;\n static circOut(t: number): number;\n static circInOut(t: number): number;\n static bounceOut(t: number): number;\n static bounceIn(t: number): number;\n static bounceInOut(t: number): number;\n static getElasticIn(amplitude: number, period: number): (t: number) => number;\n static getElasticOut(amplitude: number, period: number): (t: number) => number;\n static getElasticInOut(amplitude: number, period: number): (t: number) => number;\n static elasticIn: (t: number) => number;\n static elasticOut: (t: number) => number;\n static elasticInOut: (t: number) => number;\n}\n\n// timeline管理一堆的animate,多个timeline互不影响\n// timeline主要作用是基于layer层面的整体管理\n// 每个layer默认带有一个timeline\nexport interface Timeline {\n AnimateList: IAnimate[];\n}\n\ntype IStopType = 'end' | 'start' | 'current';\n\n// TODO: 提供options配置可序列化\ninterface AnimateSpecItem {\n type: 'to' | 'delay' | 'stop' | 'any';\n params: any[];\n}\n\nexport type EasingTypeStr =\n | 'linear'\n | 'quadIn'\n | 'quadOut'\n | 'quadInOut'\n | 'quadInOut'\n | 'cubicIn'\n | 'cubicOut'\n | 'cubicInOut'\n | 'quartIn'\n | 'quartOut'\n | 'quartInOut'\n | 'quintIn'\n | 'quintOut'\n | 'quintInOut'\n | 'backIn'\n | 'backOut'\n | 'backInOut'\n | 'circIn'\n | 'circOut'\n | 'circInOut'\n | 'bounceOut'\n | 'bounceIn'\n | 'bounceInOut'\n | 'elasticIn'\n | 'elasticOut'\n | 'elasticInOut'\n | 'sineIn'\n | 'sineOut'\n | 'sineInOut'\n | 'expoIn'\n | 'expoOut'\n | 'expoInOut'\n // @since 0.21.0\n | 'easeInOutQuad'\n | 'easeOutElastic'\n | 'easeInOutElastic'\n | '';\nexport type EasingTypeFunc = (t: number) => number;\n\nexport type EasingType = EasingTypeStr | EasingTypeFunc;\n\nexport type IAnimateStepType = keyof typeof AnimateStepType;\n\nexport interface IStep {\n type: IAnimateStepType;\n prev?: IStep;\n // 持续时间\n duration: number;\n // 在animate中的位置\n position: number;\n next?: IStep;\n props?: any;\n parsedProps?: any;\n propKeys?: string[];\n easing?: EasingTypeFunc;\n customAnimate?: ICustomAnimate;\n\n append: (step: IStep) => void;\n getLastProps: () => any;\n}\n\nexport interface IStepConfig {\n tempProps?: boolean; // props为临时props,可以直接使用不用拷贝\n noPreventAttrs?: boolean;\n}\n\nexport interface IAnimateTarget {\n onAnimateBind?: (animte: IAnimate | ISubAnimate) => void;\n // 添加动画step的时候调用\n onAddStep?: (step: IStep) => void;\n // step时调用\n onStep: (subAnimate: ISubAnimate, animate: IAnimate, step: IStep, ratio: number, end: boolean) => void;\n // 插值函数\n stepInterpolate: (\n subAnimate: ISubAnimate,\n animate: IAnimate,\n nextAttributes: Record<string, any>,\n step: IStep,\n ratio: number,\n end: boolean,\n nextProps: Record<string, any>,\n lastProps?: Record<string, any>,\n nextParsedProps?: any,\n propKeys?: string[]\n ) => void;\n // 获取属性\n getComputedAttribute: (name: string) => any;\n // 获取默认属性\n getDefaultAttribute: (name: string) => any;\n onStop: (props?: Record<string, any>) => void;\n animates: Map<string | number, IAnimate>;\n [key: string]: any;\n}\n\nexport interface ICustomAnimate {\n duration: number;\n easing: EasingType;\n step?: IStep;\n mode?: AnimateMode;\n\n bind: (target: IAnimateTarget, subAni: ISubAnimate) => void;\n // 在第一次调用的时候触发\n onBind: () => void;\n // 第一次执行的时候调用\n onFirstRun: () => void;\n // 开始执行的时候调用(如果有循环,那每个周期都会调用)\n onStart: () => void;\n // 结束执行的时候调用(如果有循环,那每个周期都会调用)\n onEnd: () => void;\n onUpdate: (end: boolean, ratio: number, out: Record<string, any>) => void;\n update: (end: boolean, ratio: number, out: Record<string, any>) => void;\n getEndProps: () => Record<string, any> | void;\n getFromProps: () => Record<string, any> | void;\n getMergedEndProps: () => Record<string, any> | void;\n}\n\n// 每一个animate绑定一个graphic,用于描述这个graphic的动画内容\n// 在timeline层面,animate相当于是一段timeslice\nexport interface IAnimate {\n readonly id: string | number;\n status: AnimateStatus;\n\n interpolateFunc: (key: string, ratio: number, from: any, to: any, nextAttributes: any) => boolean;\n\n _onStart?: (() => void)[];\n _onFrame?: ((step: IStep, ratio: number) => void)[];\n _onEnd?: (() => void)[];\n _onRemove?: (() => void)[];\n\n getStartProps: () => Record<string, any>;\n getEndProps: () => Record<string, any>;\n\n setTimeline: (timeline: ITimeline) => void;\n // getTimeline: () => ITimeline;\n readonly timeline: ITimeline;\n\n bind: (target: IAnimateTarget) => this;\n to: (props: Record<string, any>, duration: number, easing: EasingType, params?: IStepConfig) => this;\n from: (props: Record<string, any>, duration: number, easing: EasingType, params?: IStepConfig) => this;\n pause: () => void;\n resume: () => void;\n onStart: (cb: () => void) => void;\n onEnd: (cb: () => void) => void;\n onFrame: (cb: (step: IStep, ratio: number) => void) => void;\n // 屏蔽属性\n preventAttr: (key: string) => void;\n // 屏蔽属性\n preventAttrs: (key: string[]) => void;\n // 属性是否合法\n validAttr: (key: string) => boolean;\n\n runCb: (cb: (a: IAnimate, step: IStep) => void) => IAnimate;\n\n // 自定义插值,返回false表示没有匹配上\n customInterpolate: (\n key: string,\n ratio: number,\n from: any,\n to: any,\n target: IAnimateTarget,\n ret: Record<string, any>\n ) => boolean;\n //\n play: (customAnimate: ICustomAnimate) => this;\n\n // 获取该属性的上一个值\n // getLastPropByName: (name: string, step: IStep) => any;\n // delay: (duration: number) => IAnimate;\n stop: (type?: 'start' | 'end' | Record<string, any>) => void;\n /** 打上END标志,下一帧被删除 */\n release: () => void;\n // 获取持续的时长\n getDuration: () => number;\n // 获取动画开始时间(注意并不是子动画的startAt)\n getStartTime: () => number;\n // done: (cb: (_: any) => any) => IAnimate;\n // pause: () => IAnimate;\n // spec: (spec: AnimateSpecItem[]) => IAnimate;\n // start: () => void; // 有start方法,避免动画提前开始(VGrammar需要时间处理数据)\n wait: (delay: number) => this;\n\n // // 编排\n afterAll: (list: IAnimate[]) => this;\n after: (animate: IAnimate) => this;\n parallel: (animate: IAnimate) => this;\n\n // // timislice (getter)\n // startTime: number;\n // endTime: number;\n // startTimes: number[];\n // endTimes: number[];\n\n // // 高级参数,frame到frameEnd之间可以进行reverse,loop,bounce效果\n // frame: () => IAnimate;\n // frameEnd: () => IAnimate;\n reversed: (r: boolean) => IAnimate;\n loop: (n: number) => IAnimate;\n bounce: (b: boolean) => IAnimate;\n\n nextAnimate?: IAnimate;\n prevAnimate?: IAnimate;\n\n advance: (delta: number) => void;\n\n startAt: (t: number) => IAnimate;\n\n // // 语法糖\n // create: (duration: number) => IAnimate;\n // fadeIn: (duration: number) => IAnimate;\n}\n\nexport interface ISubAnimate {\n getLastStep: () => IStep;\n animate: IAnimate;\n // 获取该属性的上一个值\n getLastPropByName: (name: string, step: IStep) => any;\n}\n\n// rect.animate().abc().to({}, 1000).delay(1000).frame().to().delay().to().frameEnd().loop().bounce()\n\nexport interface BaseAnimateConfig {\n id?: number | string;\n interpolate?: (key: string, ratio: number, from: any, to: any, nextAttributes: any) => boolean;\n onStart?: () => void;\n onFrame?: (step: IStep, ratio: number) => void;\n onEnd?: () => void;\n onRemove?: () => void;\n}\n\n// VGrammar和 vrender命名不一致,好尴尬\nexport interface MorphingAnimateConfig extends Omit<BaseAnimateConfig, 'interpolate'> {\n duration?: number;\n easing?: EasingType; // 统一到easing\n delay?: number;\n}\n\nexport interface MultiMorphingAnimateConfig extends MorphingAnimateConfig {\n splitPath?: 'clone' | ((graphic: IGraphic, count: number, needAppend?: boolean) => IGraphic[]);\n individualDelay?: (index: number, count: number, fromGraphic: IGraphic, toGraphic: IGraphic) => number;\n}\n\nexport interface ITimeline {\n id: number;\n animateCount: number;\n addAnimate: (animate: IAnimate) => void;\n removeAnimate: (animate: IAnimate, release?: boolean) => void;\n tick: (delta: number) => void;\n clear: () => void;\n pause: () => void;\n resume: () => void;\n}\n\nexport interface ITickHandler extends Releaseable {\n avaliable: () => boolean;\n /**\n * 开始执行tick\n * @param interval 延时 ms\n * @param cb 执行的回调\n */\n tick: (interval: number, cb: (handler: ITickHandler) => void) => void; // 开始\n tickTo?: (t: number, cb: (handler: ITickHandler, params?: { once: boolean }) => void) => void;\n getTime: () => number; // 获取时间\n}\n\nexport interface ITickerHandlerStatic {\n Avaliable: () => boolean;\n new (): ITickHandler;\n}\n\nexport interface ITicker extends EventEmitter {\n setFPS?: (fps: number) => void;\n setInterval?: (interval: number) => void;\n getFPS?: () => number;\n getInterval?: () => number;\n tick: (interval: number) => void;\n tickAt?: (time: number) => void;\n pause: () => boolean;\n resume: () => boolean;\n /**\n * 开启tick,force为true强制开启,否则如果timeline为空则不开启\n */\n start: (force?: boolean) => boolean;\n stop: () => void;\n addTimeline: (timeline: ITimeline) => void;\n remTimeline: (timeline: ITimeline) => void;\n getTimelines: () => ITimeline[];\n\n release: () => void;\n\n // 是否自动停止,默认为true\n autoStop: boolean;\n}\n"]}
1
+ {"version":3,"sources":["../src/interface/animate.ts"],"names":[],"mappings":"","file":"animate.js","sourcesContent":["import type { EventEmitter } from '@visactor/vutils';\nimport type { AnimateMode, AnimateStatus, AnimateStepType } from '../common/enums';\nimport type { Releaseable } from './common';\nimport type { IGraphic } from './graphic';\n\n// export type EasingType = (...args: any) => any;\n\nexport declare class Easing {\n static linear(t: number): number;\n static none(): typeof Easing.linear;\n /**\n * 获取缓动函数,amount指示这个缓动函数的插值方式\n * @param amount\n * @returns\n */\n static get(amount: number): (t: number) => number;\n static getPowIn(pow: number): (t: number) => number;\n static getPowOut(pow: number): (t: number) => number;\n static getPowInOut(pow: number): (t: number) => number;\n static quadIn: (t: number) => number;\n static quadOut: (t: number) => number;\n static quadInOut: (t: number) => number;\n static cubicIn: (t: number) => number;\n static cubicOut: (t: number) => number;\n static cubicInOut: (t: number) => number;\n static quartIn: (t: number) => number;\n static quartOut: (t: number) => number;\n static quartInOut: (t: number) => number;\n static quintIn: (t: number) => number;\n static quintOut: (t: number) => number;\n static quintInOut: (t: number) => number;\n static getBackIn(amount: number): (t: number) => number;\n static getBackOut(amount: number): (t: number) => number;\n static getBackInOut(amount: number): (t: number) => number;\n static backIn: (t: number) => number;\n static backOut: (t: number) => number;\n static backInOut: (t: number) => number;\n static circIn(t: number): number;\n static circOut(t: number): number;\n static circInOut(t: number): number;\n static bounceOut(t: number): number;\n static bounceIn(t: number): number;\n static bounceInOut(t: number): number;\n static getElasticIn(amplitude: number, period: number): (t: number) => number;\n static getElasticOut(amplitude: number, period: number): (t: number) => number;\n static getElasticInOut(amplitude: number, period: number): (t: number) => number;\n static elasticIn: (t: number) => number;\n static elasticOut: (t: number) => number;\n static elasticInOut: (t: number) => number;\n}\n\n// timeline管理一堆的animate,多个timeline互不影响\n// timeline主要作用是基于layer层面的整体管理\n// 每个layer默认带有一个timeline\nexport interface Timeline {\n AnimateList: IAnimate[];\n}\n\ntype IStopType = 'end' | 'start' | 'current';\n\n// TODO: 提供options配置可序列化\ninterface AnimateSpecItem {\n type: 'to' | 'delay' | 'stop' | 'any';\n params: any[];\n}\n\nexport type EasingTypeStr =\n | 'linear'\n | 'quadIn'\n | 'quadOut'\n | 'quadInOut'\n | 'quadInOut'\n | 'cubicIn'\n | 'cubicOut'\n | 'cubicInOut'\n | 'quartIn'\n | 'quartOut'\n | 'quartInOut'\n | 'quintIn'\n | 'quintOut'\n | 'quintInOut'\n | 'backIn'\n | 'backOut'\n | 'backInOut'\n | 'circIn'\n | 'circOut'\n | 'circInOut'\n | 'bounceOut'\n | 'bounceIn'\n | 'bounceInOut'\n | 'elasticIn'\n | 'elasticOut'\n | 'elasticInOut'\n | 'sineIn'\n | 'sineOut'\n | 'sineInOut'\n | 'expoIn'\n | 'expoOut'\n | 'expoInOut'\n | '';\nexport type EasingTypeFunc = (t: number) => number;\n\nexport type EasingType = EasingTypeStr | EasingTypeFunc;\n\nexport type IAnimateStepType = keyof typeof AnimateStepType;\n\nexport interface IStep {\n type: IAnimateStepType;\n prev?: IStep;\n // 持续时间\n duration: number;\n // 在animate中的位置\n position: number;\n next?: IStep;\n props?: any;\n parsedProps?: any;\n propKeys?: string[];\n easing?: EasingTypeFunc;\n customAnimate?: ICustomAnimate;\n\n append: (step: IStep) => void;\n getLastProps: () => any;\n}\n\nexport interface IStepConfig {\n tempProps?: boolean; // props为临时props,可以直接使用不用拷贝\n noPreventAttrs?: boolean;\n}\n\nexport interface IAnimateTarget {\n onAnimateBind?: (animte: IAnimate | ISubAnimate) => void;\n // 添加动画step的时候调用\n onAddStep?: (step: IStep) => void;\n // step时调用\n onStep: (subAnimate: ISubAnimate, animate: IAnimate, step: IStep, ratio: number, end: boolean) => void;\n // 插值函数\n stepInterpolate: (\n subAnimate: ISubAnimate,\n animate: IAnimate,\n nextAttributes: Record<string, any>,\n step: IStep,\n ratio: number,\n end: boolean,\n nextProps: Record<string, any>,\n lastProps?: Record<string, any>,\n nextParsedProps?: any,\n propKeys?: string[]\n ) => void;\n // 获取属性\n getComputedAttribute: (name: string) => any;\n // 获取默认属性\n getDefaultAttribute: (name: string) => any;\n onStop: (props?: Record<string, any>) => void;\n animates: Map<string | number, IAnimate>;\n [key: string]: any;\n}\n\nexport interface ICustomAnimate {\n duration: number;\n easing: EasingType;\n step?: IStep;\n mode?: AnimateMode;\n\n bind: (target: IAnimateTarget, subAni: ISubAnimate) => void;\n // 在第一次调用的时候触发\n onBind: () => void;\n // 第一次执行的时候调用\n onFirstRun: () => void;\n // 开始执行的时候调用(如果有循环,那每个周期都会调用)\n onStart: () => void;\n // 结束执行的时候调用(如果有循环,那每个周期都会调用)\n onEnd: () => void;\n onUpdate: (end: boolean, ratio: number, out: Record<string, any>) => void;\n update: (end: boolean, ratio: number, out: Record<string, any>) => void;\n getEndProps: () => Record<string, any> | void;\n getFromProps: () => Record<string, any> | void;\n getMergedEndProps: () => Record<string, any> | void;\n}\n\n// 每一个animate绑定一个graphic,用于描述这个graphic的动画内容\n// 在timeline层面,animate相当于是一段timeslice\nexport interface IAnimate {\n readonly id: string | number;\n status: AnimateStatus;\n\n interpolateFunc: (key: string, ratio: number, from: any, to: any, nextAttributes: any) => boolean;\n\n _onStart?: (() => void)[];\n _onFrame?: ((step: IStep, ratio: number) => void)[];\n _onEnd?: (() => void)[];\n _onRemove?: (() => void)[];\n\n getStartProps: () => Record<string, any>;\n getEndProps: () => Record<string, any>;\n\n setTimeline: (timeline: ITimeline) => void;\n\n bind: (target: IAnimateTarget) => this;\n to: (props: Record<string, any>, duration: number, easing: EasingType, params?: IStepConfig) => this;\n from: (props: Record<string, any>, duration: number, easing: EasingType, params?: IStepConfig) => this;\n pause: () => void;\n resume: () => void;\n onStart: (cb: () => void) => void;\n onEnd: (cb: () => void) => void;\n onFrame: (cb: (step: IStep, ratio: number) => void) => void;\n // 屏蔽属性\n preventAttr: (key: string) => void;\n // 屏蔽属性\n preventAttrs: (key: string[]) => void;\n // 属性是否合法\n validAttr: (key: string) => boolean;\n\n runCb: (cb: (a: IAnimate, step: IStep) => void) => IAnimate;\n\n // 自定义插值,返回false表示没有匹配上\n customInterpolate: (\n key: string,\n ratio: number,\n from: any,\n to: any,\n target: IAnimateTarget,\n ret: Record<string, any>\n ) => boolean;\n //\n play: (customAnimate: ICustomAnimate) => this;\n\n // 获取该属性的上一个值\n // getLastPropByName: (name: string, step: IStep) => any;\n // delay: (duration: number) => IAnimate;\n stop: (type?: 'start' | 'end' | Record<string, any>) => void;\n /** 打上END标志,下一帧被删除 */\n release: () => void;\n // 获取持续的时长\n getDuration: () => number;\n // 获取动画开始时间(注意并不是子动画的startAt)\n getStartTime: () => number;\n // done: (cb: (_: any) => any) => IAnimate;\n // pause: () => IAnimate;\n // spec: (spec: AnimateSpecItem[]) => IAnimate;\n // start: () => void; // 有start方法,避免动画提前开始(VGrammar需要时间处理数据)\n wait: (delay: number) => this;\n\n // // 编排\n afterAll: (list: IAnimate[]) => this;\n after: (animate: IAnimate) => this;\n parallel: (animate: IAnimate) => this;\n\n // // timislice (getter)\n // startTime: number;\n // endTime: number;\n // startTimes: number[];\n // endTimes: number[];\n\n // // 高级参数,frame到frameEnd之间可以进行reverse,loop,bounce效果\n // frame: () => IAnimate;\n // frameEnd: () => IAnimate;\n reversed: (r: boolean) => IAnimate;\n loop: (n: number) => IAnimate;\n bounce: (b: boolean) => IAnimate;\n\n nextAnimate?: IAnimate;\n prevAnimate?: IAnimate;\n\n advance: (delta: number) => void;\n\n startAt: (t: number) => IAnimate;\n\n // // 语法糖\n // create: (duration: number) => IAnimate;\n // fadeIn: (duration: number) => IAnimate;\n}\n\nexport interface ISubAnimate {\n getLastStep: () => IStep;\n animate: IAnimate;\n // 获取该属性的上一个值\n getLastPropByName: (name: string, step: IStep) => any;\n}\n\n// rect.animate().abc().to({}, 1000).delay(1000).frame().to().delay().to().frameEnd().loop().bounce()\n\nexport interface BaseAnimateConfig {\n id?: number | string;\n interpolate?: (key: string, ratio: number, from: any, to: any, nextAttributes: any) => boolean;\n onStart?: () => void;\n onFrame?: (step: IStep, ratio: number) => void;\n onEnd?: () => void;\n onRemove?: () => void;\n}\n\n// VGrammar和 vrender命名不一致,好尴尬\nexport interface MorphingAnimateConfig extends Omit<BaseAnimateConfig, 'interpolate'> {\n duration?: number;\n easing?: EasingType; // 统一到easing\n delay?: number;\n}\n\nexport interface MultiMorphingAnimateConfig extends MorphingAnimateConfig {\n splitPath?: 'clone' | ((graphic: IGraphic, count: number, needAppend?: boolean) => IGraphic[]);\n individualDelay?: (index: number, count: number, fromGraphic: IGraphic, toGraphic: IGraphic) => number;\n}\n\nexport interface ITimeline {\n id: number;\n animateCount: number;\n addAnimate: (animate: IAnimate) => void;\n removeAnimate: (animate: IAnimate, release?: boolean) => void;\n tick: (delta: number) => void;\n clear: () => void;\n pause: () => void;\n resume: () => void;\n}\n\nexport interface ITickHandler extends Releaseable {\n avaliable: () => boolean;\n /**\n * 开始执行tick\n * @param interval 延时 ms\n * @param cb 执行的回调\n */\n tick: (interval: number, cb: (handler: ITickHandler) => void) => void; // 开始\n tickTo?: (t: number, cb: (handler: ITickHandler, params?: { once: boolean }) => void) => void;\n getTime: () => number; // 获取时间\n}\n\nexport interface ITickerHandlerStatic {\n Avaliable: () => boolean;\n new (): ITickHandler;\n}\n\nexport interface ITicker extends EventEmitter {\n setFPS?: (fps: number) => void;\n setInterval?: (interval: number) => void;\n getFPS?: () => number;\n getInterval?: () => number;\n tick: (interval: number) => void;\n tickAt?: (time: number) => void;\n pause: () => boolean;\n resume: () => boolean;\n /**\n * 开启tick,force为true强制开启,否则如果timeline为空则不开启\n */\n start: (force?: boolean) => boolean;\n stop: () => void;\n addTimeline: (timeline: ITimeline) => void;\n remTimeline: (timeline: ITimeline) => void;\n trySyncTickStatus: () => void;\n}\n"]}
@@ -30,6 +30,7 @@ export interface IStrokeStyleParams {
30
30
  lineJoin?: CanvasLineJoin;
31
31
  miterLimit?: number;
32
32
  opacity?: number;
33
+ keepStrokeScale?: boolean;
33
34
  }
34
35
  export interface ITextStyleParams {
35
36
  font?: string;
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/interface/context.ts"],"names":[],"mappings":"","file":"context.js","sourcesContent":["import type { Matrix, IMatrix, IBoundsLike, IPointLike } from '@visactor/vutils';\nimport type { ICamera } from './camera';\nimport type { ICanvas } from './canvas';\nimport type { Releaseable } from './common';\nimport type { mat4, vec3 } from './matrix';\nimport type { IFillType, IStrokeType, ITransform } from './graphic';\n\nexport interface IConicalGradientData {\n addColorStop: (pos: number, color: string) => void;\n readonly stops: [number, string][];\n GetPattern: (minW: number, minH: number, deltaAngle?: number) => CanvasPattern | null;\n}\n\n// 用于commonStyle函数的参数\nexport interface ICommonStyleParams {\n fill?: IFillType;\n fillOpacity?: number;\n shadowBlur?: number;\n shadowColor?: string;\n shadowOffsetX?: number;\n shadowOffsetY?: number;\n globalCompositeOperation?: CanvasRenderingContext2D['globalCompositeOperation'] | '';\n opacity?: number;\n blur?: number;\n}\n\nexport interface IStrokeStyleParams {\n stroke?: IStrokeType | IStrokeType[];\n strokeOpacity?: number;\n lineDash?: number[];\n lineDashOffset?: number;\n lineWidth?: number;\n lineCap?: CanvasLineCap;\n lineJoin?: CanvasLineJoin;\n miterLimit?: number;\n opacity?: number;\n}\nexport interface ITextStyleParams {\n font?: string;\n fontSize: number;\n fontFamily?: string;\n fontWeight?: string | number;\n textAlign?: CanvasTextAlign;\n textBaseline?: CanvasTextBaseline;\n scaleIn3d?: boolean;\n}\n\nexport interface ISetCommonStyleParams {\n attribute: Partial<ICommonStyleParams & ITransform>;\n AABBBounds: IBoundsLike;\n}\n\nexport interface ISetStrokeStyleParams {\n attribute: Partial<IStrokeStyleParams & ITransform>;\n AABBBounds: IBoundsLike;\n}\nexport interface IContext2d extends Releaseable {\n stack: IMatrix[];\n inuse?: boolean;\n camera?: ICamera;\n modelMatrix?: mat4;\n drawPromise?: Promise<any>;\n baseGlobalAlpha?: number;\n // 属性代理\n fillStyle: string | CanvasGradient | CanvasPattern;\n disableFill?: boolean;\n disableStroke?: boolean;\n disableBeginPath?: boolean;\n /**\n * @deprecated font方法不建议使用,请使用setTextStyle\n */\n font: string;\n globalAlpha: number;\n lineCap: string;\n lineDashOffset: number;\n lineJoin: string;\n lineWidth: number;\n miterLimit: number;\n shadowBlur: number;\n shadowColor: string;\n shadowOffsetX: number;\n shadowOffsetY: number;\n strokeStyle: string | CanvasGradient | CanvasPattern;\n dpr: number;\n /**\n * @deprecated textAlign方法不建议使用,请使用setTextStyle\n */\n textAlign: string;\n /**\n * @deprecated textBaseline方法不建议使用,请使用setTextStyle\n */\n textBaseline: string;\n nativeContext: CanvasRenderingContext2D | any;\n canvas: ICanvas;\n [key: string]: any; //类型没有索引签名\n\n getCanvas: () => ICanvas;\n\n getContext: () => any;\n\n /**\n * 设置当前ctx 的transform信息\n */\n setTransformForCurrent: (force?: boolean) => void;\n /**\n * 获取当前矩阵信息\n */\n currentMatrix: IMatrix;\n\n /**\n * 清空画布\n */\n clear: () => void;\n\n restore: () => void;\n highPerformanceRestore: () => void;\n\n /**\n *\n * @param angle 弧度数\n */\n rotate: (angle: number, setTransform?: boolean) => void;\n\n save: () => void;\n highPerformanceSave: () => void;\n\n project?: (x: number, y: number, z?: number) => IPointLike;\n view?: (x: number, y: number, z?: number) => vec3;\n\n scale: (x: number, y: number, setTransform?: boolean) => void;\n\n scalePoint: (sx: number, sy: number, px: number, py: number, setTransform?: boolean) => void;\n transform: (\n m11: number,\n m12: number,\n m21: number,\n m22: number,\n dx: number,\n dy: number,\n setTransform?: boolean\n ) => void;\n transformFromMatrix: (matrix: Matrix, setTransform?: boolean) => void;\n setTransform: (\n m11: number,\n m12: number,\n m21: number,\n m22: number,\n dx: number,\n dy: number,\n setTransform?: boolean,\n dpr?: number\n ) => void;\n setTransformFromMatrix: (matrix: Matrix, setTransform?: boolean, dpr?: number) => void;\n\n resetTransform: (setTransform?: boolean, dpr?: number) => void;\n\n translate: (x: number, y: number, setTransform?: boolean) => void;\n /**\n * 旋转角度,自动转换为弧度\n * @param deg 角度数\n */\n rotateDegrees: (deg: number, setTransform?: boolean) => void;\n\n /**\n * 绕点旋转\n * @param rad 弧度\n * @param x 旋转中心点x\n * @param y 旋转中心点y\n */\n rotateAbout: (rad: number, x: number, y: number, setTransform?: boolean) => void;\n\n /**\n * 绕点旋转\n * @param deg 旋转角度\n * @param x 旋转中心点x\n * @param y 旋转中心点y\n */\n rotateDegreesAbout: (deg: number, x: number, y: number, setTransform?: boolean) => void;\n\n beginPath: () => void;\n\n clip: ((fillRule?: CanvasFillRule) => void) & ((path: Path2D, fillRule?: CanvasFillRule) => void);\n\n arc: (\n x: number,\n y: number,\n radius: number,\n startAngle: number,\n endAngle: number,\n anticlockwise?: boolean,\n z?: number\n ) => void;\n\n arcTo: (x1: number, y1: number, x2: number, y2: number, radius: number) => void;\n\n bezierCurveTo: (cp1x: number, cp1y: number, cp2x: number, cp2y: number, x: number, y: number) => void;\n\n closePath: () => void;\n\n ellipse: (\n x: number,\n y: number,\n radiusX: number,\n radiusY: number,\n rotation: number,\n startAngle: number,\n endAngle: number,\n anticlockwise?: boolean\n ) => void;\n\n lineTo: (x: number, y: number, z?: number) => void;\n\n moveTo: (x: number, y: number, z?: number) => void;\n\n quadraticCurveTo: (cpx: number, cpy: number, x: number, y: number, z?: number) => void;\n\n rect: (x: number, y: number, w: number, h: number, z?: number) => void;\n\n createImageData: (imageDataOrSw: number | ImageData, sh?: number) => ImageData;\n\n createLinearGradient: (x0: number, y0: number, x1: number, y1: number) => CanvasGradient;\n\n createPattern: (\n image: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement | ICanvas | any,\n repetition: string\n ) => CanvasPattern | null;\n\n createRadialGradient: (x0: number, y0: number, r0: number, x1: number, y1: number, r1: number) => CanvasGradient;\n\n createConicGradient: (x: number, y: number, startAngle: number, endAngle: number) => IConicalGradientData | null;\n\n // createConicGradient: (x: number, y: number, startAngle: number, endAngle: number) => IConicalGradient | null;\n\n // fill(fillRule?: CanvasFillRule): void;\n fill: (path?: Path2D, fillRule?: CanvasFillRule) => void;\n\n fillRect: (x: number, y: number, w: number, h: number) => void;\n\n clearRect: (x: number, y: number, w: number, h: number) => void;\n\n fillText: (text: string, x: number, y: number, z?: number) => void;\n\n getImageData: (sx: number, sy: number, sw: number, sh: number) => ImageData;\n\n getLineDash: () => number[];\n\n isPointInPath: (x: number, y: number) => boolean;\n isPointInStroke: (x: number, y: number) => boolean;\n\n measureText: (text: string, method?: 'native' | 'simple' | 'quick') => { width: number };\n\n putImageData: (imagedata: ImageData, dx: number, dy: number) => void;\n\n setLineDash: (segments: number[]) => void;\n\n stroke: (path?: Path2D) => void;\n\n strokeRect: (x: number, y: number, w: number, h: number) => void;\n\n strokeText: (text: string, x: number, y: number, z?: number) => void;\n\n drawImage: ((\n image: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement | ImageBitmap | ICanvas | any,\n dstX: number,\n dstY: number\n ) => void) &\n ((\n image: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement | ImageBitmap | ICanvas | any,\n dstX: number,\n dstY: number,\n dstW: number,\n dstH: number\n ) => void) &\n ((\n image: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement | ImageBitmap | ICanvas | any,\n srcX: number,\n srcY: number,\n srcW: number,\n srcH: number,\n dstX: number,\n dstY: number,\n dstW: number,\n dstH: number\n ) => void);\n\n setCommonStyle: (\n params: ISetCommonStyleParams,\n attribute: ICommonStyleParams,\n // 用于渐变色\n offsetX: number,\n offsetY: number,\n defultParams?: ICommonStyleParams | Partial<ICommonStyleParams>[]\n ) => void;\n\n setShadowBlendStyle?: (\n params: ISetCommonStyleParams,\n attribute: ICommonStyleParams,\n defultParams?: ICommonStyleParams | Partial<ICommonStyleParams>[]\n ) => void;\n\n setStrokeStyle: (\n params: ISetStrokeStyleParams,\n attribute: IStrokeStyleParams,\n // 用于渐变色\n offsetX: number,\n offsetY: number,\n defultParams?: Required<IStrokeStyleParams> | Partial<IStrokeStyleParams>[]\n ) => void;\n\n setTextStyle: (params: Partial<ITextStyleParams>, defaultParams?: ITextStyleParams, z?: number) => void;\n setTextStyleWithoutAlignBaseline: (\n params: Partial<ITextStyleParams>,\n defaultParams?: ITextStyleParams,\n z?: number\n ) => void;\n\n draw: (...params: any) => void;\n\n clearMatrix: (setTransform?: boolean, dpr?: number) => void;\n setClearMatrix: (a: number, b: number, c: number, d: number, e: number, f: number) => void;\n onlyTranslate: (dpr?: number) => boolean;\n}\n\nexport interface IContextLike {\n // 属性代理\n fillStyle: string | CanvasGradient | CanvasPattern;\n /**\n * @deprecated font方法不建议使用,请使用setTextStyle\n */\n font: string;\n globalAlpha: number;\n lineCap: string;\n lineDashOffset: number;\n lineJoin: string;\n lineWidth: number;\n miterLimit: number;\n shadowBlur: number;\n shadowColor: string;\n shadowOffsetX: number;\n shadowOffsetY: number;\n strokeStyle: string | CanvasGradient | CanvasPattern;\n dpr: number;\n /**\n * @deprecated textAlign方法不建议使用,请使用setTextStyle\n */\n textAlign: string;\n /**\n * @deprecated textBaseline方法不建议使用,请使用setTextStyle\n */\n textBaseline: string;\n nativeContext: CanvasRenderingContext2D | any;\n [key: string]: any; //类型没有索引签名\n\n /**\n * 清空画布\n */\n clear: () => void;\n\n restore: () => void;\n\n save: () => void;\n\n // transform(m11: number, m12: number, m21: number, m22: number, dx: number, dy: number): void;\n\n translate: (x: number, y: number) => void;\n\n beginPath: () => void;\n\n clip: ((fillRule?: CanvasFillRule) => void) & ((path: Path2D, fillRule?: CanvasFillRule) => void);\n\n arc: (x: number, y: number, radius: number, startAngle: number, endAngle: number, anticlockwise?: boolean) => void;\n\n arcTo: ((x1: number, y1: number, x2: number, y2: number, radius: number) => void) &\n ((x1: number, y1: number, x2: number, y2: number, radiusX: number, radiusY: number, rotation: number) => void);\n\n bezierCurveTo: (cp1x: number, cp1y: number, cp2x: number, cp2y: number, x: number, y: number) => void;\n\n closePath: () => void;\n\n ellipse: (\n x: number,\n y: number,\n radiusX: number,\n radiusY: number,\n rotation: number,\n startAngle: number,\n endAngle: number,\n anticlockwise?: boolean\n ) => void;\n\n lineTo: (x: number, y: number) => void;\n\n moveTo: (x: number, y: number) => void;\n\n quadraticCurveTo: (cpx: number, cpy: number, x: number, y: number) => void;\n\n rect: (x: number, y: number, w: number, h: number) => void;\n\n fill: (path?: Path2D, fillRule?: CanvasFillRule) => void;\n\n fillRect: (x: number, y: number, w: number, h: number) => void;\n\n clearRect: (x: number, y: number, w: number, h: number) => void;\n\n fillText: (text: string, x: number, y: number, maxWidth?: number) => void;\n\n getImageData: (sx: number, sy: number, sw: number, sh: number) => ImageData;\n\n getLineDash: () => number[];\n\n isPointInPath: (x: number, y: number) => boolean;\n isPointInStroke: (x: number, y: number) => boolean;\n\n measureText: (text: string, method?: 'native' | 'simple' | 'quick') => { width: number };\n\n putImageData: (\n imagedata: ImageData,\n dx: number,\n dy: number,\n dirtyX?: number,\n dirtyY?: number,\n dirtyWidth?: number,\n dirtyHeight?: number\n ) => void;\n\n setLineDash: (segments: number[]) => void;\n\n stroke: (path?: Path2D) => void;\n\n strokeRect: (x: number, y: number, w: number, h: number) => void;\n\n strokeText: (text: string, x: number, y: number, maxWidth?: number) => void;\n\n drawImage: ((\n image: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement | ImageBitmap | any,\n dstX: number,\n dstY: number\n ) => void) &\n ((\n image: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement | ImageBitmap | any,\n dstX: number,\n dstY: number,\n dstW: number,\n dstH: number\n ) => void) &\n ((\n image: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement | ImageBitmap | any,\n srcX: number,\n srcY: number,\n srcW: number,\n srcH: number,\n dstX: number,\n dstY: number,\n dstW: number,\n dstH: number\n ) => void);\n\n clearMatrix: () => void;\n onlyTranslate: () => boolean;\n}\n"]}
1
+ {"version":3,"sources":["../src/interface/context.ts"],"names":[],"mappings":"","file":"context.js","sourcesContent":["import type { Matrix, IMatrix, IBoundsLike, IPointLike } from '@visactor/vutils';\nimport type { ICamera } from './camera';\nimport type { ICanvas } from './canvas';\nimport type { Releaseable } from './common';\nimport type { mat4, vec3 } from './matrix';\nimport type { IFillType, IStrokeType, ITransform } from './graphic';\n\nexport interface IConicalGradientData {\n addColorStop: (pos: number, color: string) => void;\n readonly stops: [number, string][];\n GetPattern: (minW: number, minH: number, deltaAngle?: number) => CanvasPattern | null;\n}\n\n// 用于commonStyle函数的参数\nexport interface ICommonStyleParams {\n fill?: IFillType;\n fillOpacity?: number;\n shadowBlur?: number;\n shadowColor?: string;\n shadowOffsetX?: number;\n shadowOffsetY?: number;\n globalCompositeOperation?: CanvasRenderingContext2D['globalCompositeOperation'] | '';\n opacity?: number;\n blur?: number;\n}\n\nexport interface IStrokeStyleParams {\n stroke?: IStrokeType | IStrokeType[];\n strokeOpacity?: number;\n lineDash?: number[];\n lineDashOffset?: number;\n lineWidth?: number;\n lineCap?: CanvasLineCap;\n lineJoin?: CanvasLineJoin;\n miterLimit?: number;\n opacity?: number;\n keepStrokeScale?: boolean;\n}\nexport interface ITextStyleParams {\n font?: string;\n fontSize: number;\n fontFamily?: string;\n fontWeight?: string | number;\n textAlign?: CanvasTextAlign;\n textBaseline?: CanvasTextBaseline;\n scaleIn3d?: boolean;\n}\n\nexport interface ISetCommonStyleParams {\n attribute: Partial<ICommonStyleParams & ITransform>;\n AABBBounds: IBoundsLike;\n}\n\nexport interface ISetStrokeStyleParams {\n attribute: Partial<IStrokeStyleParams & ITransform>;\n AABBBounds: IBoundsLike;\n}\nexport interface IContext2d extends Releaseable {\n stack: IMatrix[];\n inuse?: boolean;\n camera?: ICamera;\n modelMatrix?: mat4;\n drawPromise?: Promise<any>;\n baseGlobalAlpha?: number;\n // 属性代理\n fillStyle: string | CanvasGradient | CanvasPattern;\n disableFill?: boolean;\n disableStroke?: boolean;\n disableBeginPath?: boolean;\n /**\n * @deprecated font方法不建议使用,请使用setTextStyle\n */\n font: string;\n globalAlpha: number;\n lineCap: string;\n lineDashOffset: number;\n lineJoin: string;\n lineWidth: number;\n miterLimit: number;\n shadowBlur: number;\n shadowColor: string;\n shadowOffsetX: number;\n shadowOffsetY: number;\n strokeStyle: string | CanvasGradient | CanvasPattern;\n dpr: number;\n /**\n * @deprecated textAlign方法不建议使用,请使用setTextStyle\n */\n textAlign: string;\n /**\n * @deprecated textBaseline方法不建议使用,请使用setTextStyle\n */\n textBaseline: string;\n nativeContext: CanvasRenderingContext2D | any;\n canvas: ICanvas;\n [key: string]: any; //类型没有索引签名\n\n getCanvas: () => ICanvas;\n\n getContext: () => any;\n\n /**\n * 设置当前ctx 的transform信息\n */\n setTransformForCurrent: (force?: boolean) => void;\n /**\n * 获取当前矩阵信息\n */\n currentMatrix: IMatrix;\n\n /**\n * 清空画布\n */\n clear: () => void;\n\n restore: () => void;\n highPerformanceRestore: () => void;\n\n /**\n *\n * @param angle 弧度数\n */\n rotate: (angle: number, setTransform?: boolean) => void;\n\n save: () => void;\n highPerformanceSave: () => void;\n\n project?: (x: number, y: number, z?: number) => IPointLike;\n view?: (x: number, y: number, z?: number) => vec3;\n\n scale: (x: number, y: number, setTransform?: boolean) => void;\n\n scalePoint: (sx: number, sy: number, px: number, py: number, setTransform?: boolean) => void;\n transform: (\n m11: number,\n m12: number,\n m21: number,\n m22: number,\n dx: number,\n dy: number,\n setTransform?: boolean\n ) => void;\n transformFromMatrix: (matrix: Matrix, setTransform?: boolean) => void;\n setTransform: (\n m11: number,\n m12: number,\n m21: number,\n m22: number,\n dx: number,\n dy: number,\n setTransform?: boolean,\n dpr?: number\n ) => void;\n setTransformFromMatrix: (matrix: Matrix, setTransform?: boolean, dpr?: number) => void;\n\n resetTransform: (setTransform?: boolean, dpr?: number) => void;\n\n translate: (x: number, y: number, setTransform?: boolean) => void;\n /**\n * 旋转角度,自动转换为弧度\n * @param deg 角度数\n */\n rotateDegrees: (deg: number, setTransform?: boolean) => void;\n\n /**\n * 绕点旋转\n * @param rad 弧度\n * @param x 旋转中心点x\n * @param y 旋转中心点y\n */\n rotateAbout: (rad: number, x: number, y: number, setTransform?: boolean) => void;\n\n /**\n * 绕点旋转\n * @param deg 旋转角度\n * @param x 旋转中心点x\n * @param y 旋转中心点y\n */\n rotateDegreesAbout: (deg: number, x: number, y: number, setTransform?: boolean) => void;\n\n beginPath: () => void;\n\n clip: ((fillRule?: CanvasFillRule) => void) & ((path: Path2D, fillRule?: CanvasFillRule) => void);\n\n arc: (\n x: number,\n y: number,\n radius: number,\n startAngle: number,\n endAngle: number,\n anticlockwise?: boolean,\n z?: number\n ) => void;\n\n arcTo: (x1: number, y1: number, x2: number, y2: number, radius: number) => void;\n\n bezierCurveTo: (cp1x: number, cp1y: number, cp2x: number, cp2y: number, x: number, y: number) => void;\n\n closePath: () => void;\n\n ellipse: (\n x: number,\n y: number,\n radiusX: number,\n radiusY: number,\n rotation: number,\n startAngle: number,\n endAngle: number,\n anticlockwise?: boolean\n ) => void;\n\n lineTo: (x: number, y: number, z?: number) => void;\n\n moveTo: (x: number, y: number, z?: number) => void;\n\n quadraticCurveTo: (cpx: number, cpy: number, x: number, y: number, z?: number) => void;\n\n rect: (x: number, y: number, w: number, h: number, z?: number) => void;\n\n createImageData: (imageDataOrSw: number | ImageData, sh?: number) => ImageData;\n\n createLinearGradient: (x0: number, y0: number, x1: number, y1: number) => CanvasGradient;\n\n createPattern: (\n image: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement | ICanvas | any,\n repetition: string\n ) => CanvasPattern | null;\n\n createRadialGradient: (x0: number, y0: number, r0: number, x1: number, y1: number, r1: number) => CanvasGradient;\n\n createConicGradient: (x: number, y: number, startAngle: number, endAngle: number) => IConicalGradientData | null;\n\n // createConicGradient: (x: number, y: number, startAngle: number, endAngle: number) => IConicalGradient | null;\n\n // fill(fillRule?: CanvasFillRule): void;\n fill: (path?: Path2D, fillRule?: CanvasFillRule) => void;\n\n fillRect: (x: number, y: number, w: number, h: number) => void;\n\n clearRect: (x: number, y: number, w: number, h: number) => void;\n\n fillText: (text: string, x: number, y: number, z?: number) => void;\n\n getImageData: (sx: number, sy: number, sw: number, sh: number) => ImageData;\n\n getLineDash: () => number[];\n\n isPointInPath: (x: number, y: number) => boolean;\n isPointInStroke: (x: number, y: number) => boolean;\n\n measureText: (text: string, method?: 'native' | 'simple' | 'quick') => { width: number };\n\n putImageData: (imagedata: ImageData, dx: number, dy: number) => void;\n\n setLineDash: (segments: number[]) => void;\n\n stroke: (path?: Path2D) => void;\n\n strokeRect: (x: number, y: number, w: number, h: number) => void;\n\n strokeText: (text: string, x: number, y: number, z?: number) => void;\n\n drawImage: ((\n image: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement | ImageBitmap | ICanvas | any,\n dstX: number,\n dstY: number\n ) => void) &\n ((\n image: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement | ImageBitmap | ICanvas | any,\n dstX: number,\n dstY: number,\n dstW: number,\n dstH: number\n ) => void) &\n ((\n image: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement | ImageBitmap | ICanvas | any,\n srcX: number,\n srcY: number,\n srcW: number,\n srcH: number,\n dstX: number,\n dstY: number,\n dstW: number,\n dstH: number\n ) => void);\n\n setCommonStyle: (\n params: ISetCommonStyleParams,\n attribute: ICommonStyleParams,\n // 用于渐变色\n offsetX: number,\n offsetY: number,\n defultParams?: ICommonStyleParams | Partial<ICommonStyleParams>[]\n ) => void;\n\n setShadowBlendStyle?: (\n params: ISetCommonStyleParams,\n attribute: ICommonStyleParams,\n defultParams?: ICommonStyleParams | Partial<ICommonStyleParams>[]\n ) => void;\n\n setStrokeStyle: (\n params: ISetStrokeStyleParams,\n attribute: IStrokeStyleParams,\n // 用于渐变色\n offsetX: number,\n offsetY: number,\n defultParams?: Required<IStrokeStyleParams> | Partial<IStrokeStyleParams>[]\n ) => void;\n\n setTextStyle: (params: Partial<ITextStyleParams>, defaultParams?: ITextStyleParams, z?: number) => void;\n setTextStyleWithoutAlignBaseline: (\n params: Partial<ITextStyleParams>,\n defaultParams?: ITextStyleParams,\n z?: number\n ) => void;\n\n draw: (...params: any) => void;\n\n clearMatrix: (setTransform?: boolean, dpr?: number) => void;\n setClearMatrix: (a: number, b: number, c: number, d: number, e: number, f: number) => void;\n onlyTranslate: (dpr?: number) => boolean;\n}\n\nexport interface IContextLike {\n // 属性代理\n fillStyle: string | CanvasGradient | CanvasPattern;\n /**\n * @deprecated font方法不建议使用,请使用setTextStyle\n */\n font: string;\n globalAlpha: number;\n lineCap: string;\n lineDashOffset: number;\n lineJoin: string;\n lineWidth: number;\n miterLimit: number;\n shadowBlur: number;\n shadowColor: string;\n shadowOffsetX: number;\n shadowOffsetY: number;\n strokeStyle: string | CanvasGradient | CanvasPattern;\n dpr: number;\n /**\n * @deprecated textAlign方法不建议使用,请使用setTextStyle\n */\n textAlign: string;\n /**\n * @deprecated textBaseline方法不建议使用,请使用setTextStyle\n */\n textBaseline: string;\n nativeContext: CanvasRenderingContext2D | any;\n [key: string]: any; //类型没有索引签名\n\n /**\n * 清空画布\n */\n clear: () => void;\n\n restore: () => void;\n\n save: () => void;\n\n // transform(m11: number, m12: number, m21: number, m22: number, dx: number, dy: number): void;\n\n translate: (x: number, y: number) => void;\n\n beginPath: () => void;\n\n clip: ((fillRule?: CanvasFillRule) => void) & ((path: Path2D, fillRule?: CanvasFillRule) => void);\n\n arc: (x: number, y: number, radius: number, startAngle: number, endAngle: number, anticlockwise?: boolean) => void;\n\n arcTo: ((x1: number, y1: number, x2: number, y2: number, radius: number) => void) &\n ((x1: number, y1: number, x2: number, y2: number, radiusX: number, radiusY: number, rotation: number) => void);\n\n bezierCurveTo: (cp1x: number, cp1y: number, cp2x: number, cp2y: number, x: number, y: number) => void;\n\n closePath: () => void;\n\n ellipse: (\n x: number,\n y: number,\n radiusX: number,\n radiusY: number,\n rotation: number,\n startAngle: number,\n endAngle: number,\n anticlockwise?: boolean\n ) => void;\n\n lineTo: (x: number, y: number) => void;\n\n moveTo: (x: number, y: number) => void;\n\n quadraticCurveTo: (cpx: number, cpy: number, x: number, y: number) => void;\n\n rect: (x: number, y: number, w: number, h: number) => void;\n\n fill: (path?: Path2D, fillRule?: CanvasFillRule) => void;\n\n fillRect: (x: number, y: number, w: number, h: number) => void;\n\n clearRect: (x: number, y: number, w: number, h: number) => void;\n\n fillText: (text: string, x: number, y: number, maxWidth?: number) => void;\n\n getImageData: (sx: number, sy: number, sw: number, sh: number) => ImageData;\n\n getLineDash: () => number[];\n\n isPointInPath: (x: number, y: number) => boolean;\n isPointInStroke: (x: number, y: number) => boolean;\n\n measureText: (text: string, method?: 'native' | 'simple' | 'quick') => { width: number };\n\n putImageData: (\n imagedata: ImageData,\n dx: number,\n dy: number,\n dirtyX?: number,\n dirtyY?: number,\n dirtyWidth?: number,\n dirtyHeight?: number\n ) => void;\n\n setLineDash: (segments: number[]) => void;\n\n stroke: (path?: Path2D) => void;\n\n strokeRect: (x: number, y: number, w: number, h: number) => void;\n\n strokeText: (text: string, x: number, y: number, maxWidth?: number) => void;\n\n drawImage: ((\n image: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement | ImageBitmap | any,\n dstX: number,\n dstY: number\n ) => void) &\n ((\n image: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement | ImageBitmap | any,\n dstX: number,\n dstY: number,\n dstW: number,\n dstH: number\n ) => void) &\n ((\n image: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement | ImageBitmap | any,\n srcX: number,\n srcY: number,\n srcW: number,\n srcH: number,\n dstX: number,\n dstY: number,\n dstW: number,\n dstH: number\n ) => void);\n\n clearMatrix: () => void;\n onlyTranslate: () => boolean;\n}\n"]}
@@ -2,7 +2,6 @@ import type { IGraphicAttribute, IGraphic } from '../graphic';
2
2
  import type { ICustomPath2D } from '../path';
3
3
  export type IPathAttribute = {
4
4
  path: ICustomPath2D | string;
5
- clipRange: number;
6
5
  customPath: (context: ICustomPath2D, pathMark: IPath) => void;
7
6
  };
8
7
  export type IPathGraphicAttribute = Partial<IGraphicAttribute> & Partial<IPathAttribute>;
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/interface/graphic/path.ts"],"names":[],"mappings":"","file":"path.js","sourcesContent":["import type { IGraphicAttribute, IGraphic } from '../graphic';\nimport type { ICustomPath2D } from '../path';\n// TODO: Path svg <Path path='' />\n\nexport type IPathAttribute = {\n path: ICustomPath2D | string;\n clipRange: number;\n customPath: (context: ICustomPath2D, pathMark: IPath) => void;\n};\n\nexport type IPathGraphicAttribute = Partial<IGraphicAttribute> & Partial<IPathAttribute>;\n\nexport type ShapeType = 'area' | 'circle' | 'ellipse' | 'line' | 'rect';\n\nexport interface IPath extends IGraphic<IPathGraphicAttribute> {\n originType?: ShapeType;\n cache?: ICustomPath2D;\n pathShape: ICustomPath2D;\n\n getParsedPathShape: () => ICustomPath2D;\n}\n"]}
1
+ {"version":3,"sources":["../src/interface/graphic/path.ts"],"names":[],"mappings":"","file":"path.js","sourcesContent":["import type { IGraphicAttribute, IGraphic } from '../graphic';\nimport type { ICustomPath2D } from '../path';\n// TODO: Path svg <Path path='' />\n\nexport type IPathAttribute = {\n path: ICustomPath2D | string;\n customPath: (context: ICustomPath2D, pathMark: IPath) => void;\n};\n\nexport type IPathGraphicAttribute = Partial<IGraphicAttribute> & Partial<IPathAttribute>;\n\nexport type ShapeType = 'area' | 'circle' | 'ellipse' | 'line' | 'rect';\n\nexport interface IPath extends IGraphic<IPathGraphicAttribute> {\n originType?: ShapeType;\n cache?: ICustomPath2D;\n pathShape: ICustomPath2D;\n\n getParsedPathShape: () => ICustomPath2D;\n}\n"]}