@visactor/vrender-core 0.19.4-alpha.5 → 0.19.4

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 (772) hide show
  1. package/cjs/allocator/bounds-allocate.js +1 -1
  2. package/cjs/allocator/bounds-allocate.js.map +1 -1
  3. package/cjs/allocator/canvas-allocate.js +11 -9
  4. package/cjs/allocator/canvas-allocate.js.map +1 -1
  5. package/cjs/allocator/graphic-allocate.js +5 -9
  6. package/cjs/allocator/graphic-allocate.js.map +1 -1
  7. package/cjs/allocator/matrix-allocate.js +2 -6
  8. package/cjs/allocator/matrix-allocate.js.map +1 -1
  9. package/cjs/animate/Ticker/default-ticker.js +25 -14
  10. package/cjs/animate/Ticker/default-ticker.js.map +1 -1
  11. package/cjs/animate/animate.js +8 -7
  12. package/cjs/animate/animate.js.map +1 -1
  13. package/cjs/animate/custom-animate.js +54 -51
  14. package/cjs/animate/custom-animate.js.map +1 -1
  15. package/cjs/animate/easing.js +19 -8
  16. package/cjs/animate/easing.js.map +1 -1
  17. package/cjs/animate/morphing.js +20 -23
  18. package/cjs/animate/morphing.js.map +1 -1
  19. package/cjs/application.js +7 -1
  20. package/cjs/application.js.map +1 -1
  21. package/cjs/canvas/conical-gradient.js +12 -5
  22. package/cjs/canvas/conical-gradient.js.map +1 -1
  23. package/cjs/canvas/contributions/base-canvas.js +19 -7
  24. package/cjs/canvas/contributions/base-canvas.js.map +1 -1
  25. package/cjs/color-string/interpolate.js +5 -3
  26. package/cjs/color-string/interpolate.js.map +1 -1
  27. package/cjs/color-string/store.js +3 -1
  28. package/cjs/color-string/store.js.map +1 -1
  29. package/cjs/common/bounds-context.js +1 -0
  30. package/cjs/common/bounds-context.js.map +1 -1
  31. package/cjs/common/canvas-utils.js +3 -6
  32. package/cjs/common/canvas-utils.js.map +1 -1
  33. package/cjs/common/contribution-provider.js +3 -0
  34. package/cjs/common/contribution-provider.js.map +1 -1
  35. package/cjs/common/custom-path2d.js +7 -1
  36. package/cjs/common/custom-path2d.js.map +1 -1
  37. package/cjs/common/generator.js +2 -1
  38. package/cjs/common/generator.js.map +1 -1
  39. package/cjs/common/inversify/binding.js +12 -0
  40. package/cjs/common/inversify/binding.js.map +1 -1
  41. package/cjs/common/inversify/container.js +4 -0
  42. package/cjs/common/inversify/container.js.map +1 -1
  43. package/cjs/common/inversify/cotainer-module.js +2 -0
  44. package/cjs/common/inversify/cotainer-module.js.map +1 -1
  45. package/cjs/common/inversify/meta-data.js +2 -0
  46. package/cjs/common/inversify/meta-data.js.map +1 -1
  47. package/cjs/common/inversify/syntax/binding_in_syntax.js +1 -0
  48. package/cjs/common/inversify/syntax/binding_in_syntax.js.map +1 -1
  49. package/cjs/common/inversify/syntax/binding_to_syntax.js +1 -0
  50. package/cjs/common/inversify/syntax/binding_to_syntax.js.map +1 -1
  51. package/cjs/common/inversify-lite/annotation/lazy_service_identifier.js +1 -0
  52. package/cjs/common/inversify-lite/annotation/lazy_service_identifier.js.map +1 -1
  53. package/cjs/common/inversify-lite/bindings/binding.js +14 -0
  54. package/cjs/common/inversify-lite/bindings/binding.js.map +1 -1
  55. package/cjs/common/inversify-lite/container/container.js +22 -46
  56. package/cjs/common/inversify-lite/container/container.js.map +1 -1
  57. package/cjs/common/inversify-lite/container/container_module.js +4 -0
  58. package/cjs/common/inversify-lite/container/container_module.js.map +1 -1
  59. package/cjs/common/inversify-lite/container/lookup.js +1 -0
  60. package/cjs/common/inversify-lite/container/lookup.js.map +1 -1
  61. package/cjs/common/inversify-lite/planning/context.js +4 -0
  62. package/cjs/common/inversify-lite/planning/context.js.map +1 -1
  63. package/cjs/common/inversify-lite/planning/metadata.js +2 -0
  64. package/cjs/common/inversify-lite/planning/metadata.js.map +1 -1
  65. package/cjs/common/inversify-lite/planning/plan.js +2 -0
  66. package/cjs/common/inversify-lite/planning/plan.js.map +1 -1
  67. package/cjs/common/inversify-lite/planning/queryable_string.js +1 -0
  68. package/cjs/common/inversify-lite/planning/queryable_string.js.map +1 -1
  69. package/cjs/common/inversify-lite/planning/request.js +8 -0
  70. package/cjs/common/inversify-lite/planning/request.js.map +1 -1
  71. package/cjs/common/inversify-lite/planning/target.js +7 -0
  72. package/cjs/common/inversify-lite/planning/target.js.map +1 -1
  73. package/cjs/common/inversify-lite/resolution/instantiation.js +16 -42
  74. package/cjs/common/inversify-lite/resolution/instantiation.js.map +1 -1
  75. package/cjs/common/inversify-lite/scope/scope.js +3 -29
  76. package/cjs/common/inversify-lite/scope/scope.js.map +1 -1
  77. package/cjs/common/inversify-lite/syntax/binding_in_syntax.js +1 -0
  78. package/cjs/common/inversify-lite/syntax/binding_in_syntax.js.map +1 -1
  79. package/cjs/common/inversify-lite/syntax/binding_in_when_on_syntax.js +3 -0
  80. package/cjs/common/inversify-lite/syntax/binding_in_when_on_syntax.js.map +1 -1
  81. package/cjs/common/inversify-lite/syntax/binding_on_syntax.js +1 -0
  82. package/cjs/common/inversify-lite/syntax/binding_on_syntax.js.map +1 -1
  83. package/cjs/common/inversify-lite/syntax/binding_to_syntax.js +1 -0
  84. package/cjs/common/inversify-lite/syntax/binding_to_syntax.js.map +1 -1
  85. package/cjs/common/inversify-lite/syntax/binding_when_on_syntax.js +2 -0
  86. package/cjs/common/inversify-lite/syntax/binding_when_on_syntax.js.map +1 -1
  87. package/cjs/common/inversify-lite/syntax/binding_when_syntax.js +1 -0
  88. package/cjs/common/inversify-lite/syntax/binding_when_syntax.js.map +1 -1
  89. package/cjs/common/polygon.js +1 -2
  90. package/cjs/common/polygon.js.map +1 -1
  91. package/cjs/common/render-area.js +2 -3
  92. package/cjs/common/render-area.js.map +1 -1
  93. package/cjs/common/render-curve.js +4 -8
  94. package/cjs/common/render-curve.js.map +1 -1
  95. package/cjs/common/seg-context.js +12 -3
  96. package/cjs/common/seg-context.js.map +1 -1
  97. package/cjs/common/segment/basis.js +13 -0
  98. package/cjs/common/segment/basis.js.map +1 -1
  99. package/cjs/common/segment/common.js +2 -2
  100. package/cjs/common/segment/common.js.map +1 -1
  101. package/cjs/common/segment/curve/arc.js +2 -2
  102. package/cjs/common/segment/curve/arc.js.map +1 -1
  103. package/cjs/common/segment/curve/base.js +4 -0
  104. package/cjs/common/segment/curve/base.js.map +1 -1
  105. package/cjs/common/segment/curve/cubic-bezier.js +2 -2
  106. package/cjs/common/segment/curve/cubic-bezier.js.map +1 -1
  107. package/cjs/common/segment/curve/curve-context.js +4 -0
  108. package/cjs/common/segment/curve/curve-context.js.map +1 -1
  109. package/cjs/common/segment/curve/ellipse.js +3 -3
  110. package/cjs/common/segment/curve/ellipse.js.map +1 -1
  111. package/cjs/common/segment/curve/line.js +2 -1
  112. package/cjs/common/segment/curve/line.js.map +1 -1
  113. package/cjs/common/segment/curve/move.js +2 -1
  114. package/cjs/common/segment/curve/move.js.map +1 -1
  115. package/cjs/common/segment/curve/path.js +2 -0
  116. package/cjs/common/segment/curve/path.js.map +1 -1
  117. package/cjs/common/segment/curve/quadratic-bezier.js +2 -2
  118. package/cjs/common/segment/curve/quadratic-bezier.js.map +1 -1
  119. package/cjs/common/segment/linear-closed.js.map +1 -1
  120. package/cjs/common/segment/linear.js +10 -0
  121. package/cjs/common/segment/linear.js.map +1 -1
  122. package/cjs/common/segment/monotone.js +13 -0
  123. package/cjs/common/segment/monotone.js.map +1 -1
  124. package/cjs/common/segment/step.js +13 -2
  125. package/cjs/common/segment/step.js.map +1 -1
  126. package/cjs/common/sort.js +3 -34
  127. package/cjs/common/sort.js.map +1 -1
  128. package/cjs/common/split-path.js +4 -11
  129. package/cjs/common/split-path.js.map +1 -1
  130. package/cjs/common/utils.d.ts +1 -1
  131. package/cjs/common/utils.js +10 -6
  132. package/cjs/common/utils.js.map +1 -1
  133. package/cjs/common/xml/parser.js +3 -2
  134. package/cjs/common/xml/parser.js.map +1 -1
  135. package/cjs/core/camera.js +11 -4
  136. package/cjs/core/camera.js.map +1 -1
  137. package/cjs/core/contributions/env/base-contribution.js +6 -0
  138. package/cjs/core/contributions/env/base-contribution.js.map +1 -1
  139. package/cjs/core/contributions/layerHandler/canvas2d-contribution.js +20 -11
  140. package/cjs/core/contributions/layerHandler/canvas2d-contribution.js.map +1 -1
  141. package/cjs/core/contributions/layerHandler/empty-contribution.js +8 -8
  142. package/cjs/core/contributions/layerHandler/empty-contribution.js.map +1 -1
  143. package/cjs/core/contributions/layerHandler/offscreen2d-contribution.js +5 -6
  144. package/cjs/core/contributions/layerHandler/offscreen2d-contribution.js.map +1 -1
  145. package/cjs/core/contributions/textMeasure/AtextMeasure.js +11 -8
  146. package/cjs/core/contributions/textMeasure/AtextMeasure.js.map +1 -1
  147. package/cjs/core/contributions/textMeasure/layout.js +3 -0
  148. package/cjs/core/contributions/textMeasure/layout.js.map +1 -1
  149. package/cjs/core/contributions/window/base-contribution.js +2 -0
  150. package/cjs/core/contributions/window/base-contribution.js.map +1 -1
  151. package/cjs/core/global.js +8 -0
  152. package/cjs/core/global.js.map +1 -1
  153. package/cjs/core/graphic-utils.js +16 -5
  154. package/cjs/core/graphic-utils.js.map +1 -1
  155. package/cjs/core/layer-service.js +7 -7
  156. package/cjs/core/layer-service.js.map +1 -1
  157. package/cjs/core/layer.js +7 -9
  158. package/cjs/core/layer.js.map +1 -1
  159. package/cjs/core/stage.js +79 -35
  160. package/cjs/core/stage.js.map +1 -1
  161. package/cjs/core/window.js +16 -13
  162. package/cjs/core/window.js.map +1 -1
  163. package/cjs/event/event-manager.js +152 -143
  164. package/cjs/event/event-manager.js.map +1 -1
  165. package/cjs/event/event-system.js +60 -43
  166. package/cjs/event/event-system.js.map +1 -1
  167. package/cjs/event/event-target.js +1 -3
  168. package/cjs/event/event-target.js.map +1 -1
  169. package/cjs/event/federated-event/base-event.js +43 -15
  170. package/cjs/event/federated-event/base-event.js.map +1 -1
  171. package/cjs/event/federated-event/mouse-event.js +27 -18
  172. package/cjs/event/federated-event/mouse-event.js.map +1 -1
  173. package/cjs/event/federated-event/pointer-event.js +13 -8
  174. package/cjs/event/federated-event/pointer-event.js.map +1 -1
  175. package/cjs/event/federated-event/wheel-event.js +14 -10
  176. package/cjs/event/federated-event/wheel-event.js.map +1 -1
  177. package/cjs/graphic/arc.js +10 -5
  178. package/cjs/graphic/arc.js.map +1 -1
  179. package/cjs/graphic/arc3d.js +7 -4
  180. package/cjs/graphic/arc3d.js.map +1 -1
  181. package/cjs/graphic/area.js +14 -9
  182. package/cjs/graphic/area.js.map +1 -1
  183. package/cjs/graphic/builtin-symbol/arrow.js +2 -3
  184. package/cjs/graphic/builtin-symbol/arrow.js.map +1 -1
  185. package/cjs/graphic/builtin-symbol/arrow2-down.js +2 -3
  186. package/cjs/graphic/builtin-symbol/arrow2-down.js.map +1 -1
  187. package/cjs/graphic/builtin-symbol/arrow2-left.js +2 -3
  188. package/cjs/graphic/builtin-symbol/arrow2-left.js.map +1 -1
  189. package/cjs/graphic/builtin-symbol/arrow2-right.js +2 -3
  190. package/cjs/graphic/builtin-symbol/arrow2-right.js.map +1 -1
  191. package/cjs/graphic/builtin-symbol/arrow2-up.js +2 -3
  192. package/cjs/graphic/builtin-symbol/arrow2-up.js.map +1 -1
  193. package/cjs/graphic/builtin-symbol/circle.js +2 -3
  194. package/cjs/graphic/builtin-symbol/circle.js.map +1 -1
  195. package/cjs/graphic/builtin-symbol/close.js +2 -3
  196. package/cjs/graphic/builtin-symbol/close.js.map +1 -1
  197. package/cjs/graphic/builtin-symbol/cross.js +2 -3
  198. package/cjs/graphic/builtin-symbol/cross.js.map +1 -1
  199. package/cjs/graphic/builtin-symbol/diamond.js +2 -3
  200. package/cjs/graphic/builtin-symbol/diamond.js.map +1 -1
  201. package/cjs/graphic/builtin-symbol/line-h.js +2 -3
  202. package/cjs/graphic/builtin-symbol/line-h.js.map +1 -1
  203. package/cjs/graphic/builtin-symbol/line-v.js +2 -3
  204. package/cjs/graphic/builtin-symbol/line-v.js.map +1 -1
  205. package/cjs/graphic/builtin-symbol/rect.js +2 -3
  206. package/cjs/graphic/builtin-symbol/rect.js.map +1 -1
  207. package/cjs/graphic/builtin-symbol/square.js +2 -3
  208. package/cjs/graphic/builtin-symbol/square.js.map +1 -1
  209. package/cjs/graphic/builtin-symbol/star.js +2 -3
  210. package/cjs/graphic/builtin-symbol/star.js.map +1 -1
  211. package/cjs/graphic/builtin-symbol/stroke.js +2 -3
  212. package/cjs/graphic/builtin-symbol/stroke.js.map +1 -1
  213. package/cjs/graphic/builtin-symbol/thin-triangle.js +2 -3
  214. package/cjs/graphic/builtin-symbol/thin-triangle.js.map +1 -1
  215. package/cjs/graphic/builtin-symbol/triangle-down.js +2 -3
  216. package/cjs/graphic/builtin-symbol/triangle-down.js.map +1 -1
  217. package/cjs/graphic/builtin-symbol/triangle-left.js +2 -3
  218. package/cjs/graphic/builtin-symbol/triangle-left.js.map +1 -1
  219. package/cjs/graphic/builtin-symbol/triangle-right.js +2 -3
  220. package/cjs/graphic/builtin-symbol/triangle-right.js.map +1 -1
  221. package/cjs/graphic/builtin-symbol/triangle-up.js +2 -3
  222. package/cjs/graphic/builtin-symbol/triangle-up.js.map +1 -1
  223. package/cjs/graphic/builtin-symbol/triangle.js +1 -3
  224. package/cjs/graphic/builtin-symbol/triangle.js.map +1 -1
  225. package/cjs/graphic/builtin-symbol/utils.js +6 -1
  226. package/cjs/graphic/builtin-symbol/utils.js.map +1 -1
  227. package/cjs/graphic/builtin-symbol/wedge.js +2 -3
  228. package/cjs/graphic/builtin-symbol/wedge.js.map +1 -1
  229. package/cjs/graphic/builtin-symbol/wye.js +2 -3
  230. package/cjs/graphic/builtin-symbol/wye.js.map +1 -1
  231. package/cjs/graphic/circle.js +8 -6
  232. package/cjs/graphic/circle.js.map +1 -1
  233. package/cjs/graphic/config.js +59 -32
  234. package/cjs/graphic/config.js.map +1 -1
  235. package/cjs/graphic/glyph.js +10 -9
  236. package/cjs/graphic/glyph.js.map +1 -1
  237. package/cjs/graphic/graphic-service/graphic-service.js +12 -8
  238. package/cjs/graphic/graphic-service/graphic-service.js.map +1 -1
  239. package/cjs/graphic/graphic.d.ts +1 -0
  240. package/cjs/graphic/graphic.js +32 -42
  241. package/cjs/graphic/graphic.js.map +1 -1
  242. package/cjs/graphic/group.js +9 -5
  243. package/cjs/graphic/group.js.map +1 -1
  244. package/cjs/graphic/image.js +18 -16
  245. package/cjs/graphic/image.js.map +1 -1
  246. package/cjs/graphic/line.js +11 -6
  247. package/cjs/graphic/line.js.map +1 -1
  248. package/cjs/graphic/node-tree.js +25 -44
  249. package/cjs/graphic/node-tree.js.map +1 -1
  250. package/cjs/graphic/path.js +12 -6
  251. package/cjs/graphic/path.js.map +1 -1
  252. package/cjs/graphic/polygon.js +7 -4
  253. package/cjs/graphic/polygon.js.map +1 -1
  254. package/cjs/graphic/pyramid3d.js +4 -3
  255. package/cjs/graphic/pyramid3d.js.map +1 -1
  256. package/cjs/graphic/rect.js +7 -3
  257. package/cjs/graphic/rect.js.map +1 -1
  258. package/cjs/graphic/rect3d.js +5 -4
  259. package/cjs/graphic/rect3d.js.map +1 -1
  260. package/cjs/graphic/richtext/frame.js +19 -0
  261. package/cjs/graphic/richtext/frame.js.map +1 -1
  262. package/cjs/graphic/richtext/icon.js +14 -6
  263. package/cjs/graphic/richtext/icon.js.map +1 -1
  264. package/cjs/graphic/richtext/line.js +14 -2
  265. package/cjs/graphic/richtext/line.js.map +1 -1
  266. package/cjs/graphic/richtext/paragraph.js +22 -0
  267. package/cjs/graphic/richtext/paragraph.js.map +1 -1
  268. package/cjs/graphic/richtext/utils.js +1 -2
  269. package/cjs/graphic/richtext/utils.js.map +1 -1
  270. package/cjs/graphic/richtext/wrapper.js +12 -0
  271. package/cjs/graphic/richtext/wrapper.js.map +1 -1
  272. package/cjs/graphic/richtext.js +38 -45
  273. package/cjs/graphic/richtext.js.map +1 -1
  274. package/cjs/graphic/shadow-root.js +2 -1
  275. package/cjs/graphic/shadow-root.js.map +1 -1
  276. package/cjs/graphic/symbol.js +12 -5
  277. package/cjs/graphic/symbol.js.map +1 -1
  278. package/cjs/graphic/text.js +45 -45
  279. package/cjs/graphic/text.js.map +1 -1
  280. package/cjs/graphic/theme.js +4 -0
  281. package/cjs/graphic/theme.js.map +1 -1
  282. package/cjs/graphic/tools.js +16 -44
  283. package/cjs/graphic/tools.js.map +1 -1
  284. package/cjs/graphic/wrap-text.js +7 -7
  285. package/cjs/graphic/wrap-text.js.map +1 -1
  286. package/cjs/interface/global.d.ts +2 -1
  287. package/cjs/interface/global.js.map +1 -1
  288. package/cjs/interface/graphic.d.ts +1 -0
  289. package/cjs/interface/graphic.js.map +1 -1
  290. package/cjs/picker/global-picker-service.js +1 -0
  291. package/cjs/picker/global-picker-service.js.map +1 -1
  292. package/cjs/picker/pick-interceptor.js +5 -15
  293. package/cjs/picker/pick-interceptor.js.map +1 -1
  294. package/cjs/picker/picker-service.js +5 -5
  295. package/cjs/picker/picker-service.js.map +1 -1
  296. package/cjs/plugins/builtin-plugin/3dview-transform-plugin.js +26 -20
  297. package/cjs/plugins/builtin-plugin/3dview-transform-plugin.js.map +1 -1
  298. package/cjs/plugins/builtin-plugin/auto-render-plugin.js +5 -4
  299. package/cjs/plugins/builtin-plugin/auto-render-plugin.js.map +1 -1
  300. package/cjs/plugins/builtin-plugin/dirty-bounds-plugin.js +5 -4
  301. package/cjs/plugins/builtin-plugin/dirty-bounds-plugin.js.map +1 -1
  302. package/cjs/plugins/builtin-plugin/flex-layout-plugin.js +11 -8
  303. package/cjs/plugins/builtin-plugin/flex-layout-plugin.js.map +1 -1
  304. package/cjs/plugins/builtin-plugin/html-attribute-plugin.js +28 -19
  305. package/cjs/plugins/builtin-plugin/html-attribute-plugin.js.map +1 -1
  306. package/cjs/plugins/builtin-plugin/incremental-auto-render-plugin.js +12 -8
  307. package/cjs/plugins/builtin-plugin/incremental-auto-render-plugin.js.map +1 -1
  308. package/cjs/plugins/builtin-plugin/react-attribute-plugin.js +6 -7
  309. package/cjs/plugins/builtin-plugin/react-attribute-plugin.js.map +1 -1
  310. package/cjs/plugins/plugin-service.js +1 -0
  311. package/cjs/plugins/plugin-service.js.map +1 -1
  312. package/cjs/render/contributions/render/arc-render.js +6 -4
  313. package/cjs/render/contributions/render/arc-render.js.map +1 -1
  314. package/cjs/render/contributions/render/arc3d-render.js +5 -7
  315. package/cjs/render/contributions/render/arc3d-render.js.map +1 -1
  316. package/cjs/render/contributions/render/area-render.js +21 -23
  317. package/cjs/render/contributions/render/area-render.js.map +1 -1
  318. package/cjs/render/contributions/render/base-render.js +5 -0
  319. package/cjs/render/contributions/render/base-render.js.map +1 -1
  320. package/cjs/render/contributions/render/circle-render.js +6 -4
  321. package/cjs/render/contributions/render/circle-render.js.map +1 -1
  322. package/cjs/render/contributions/render/contributions/arc-contribution-render.js +3 -4
  323. package/cjs/render/contributions/render/contributions/arc-contribution-render.js.map +1 -1
  324. package/cjs/render/contributions/render/contributions/area-texture-contribution-render.js +6 -9
  325. package/cjs/render/contributions/render/contributions/area-texture-contribution-render.js.map +1 -1
  326. package/cjs/render/contributions/render/contributions/base-contribution-render.js +10 -8
  327. package/cjs/render/contributions/render/contributions/base-contribution-render.js.map +1 -1
  328. package/cjs/render/contributions/render/contributions/base-texture-contribution-render.js +4 -4
  329. package/cjs/render/contributions/render/contributions/base-texture-contribution-render.js.map +1 -1
  330. package/cjs/render/contributions/render/contributions/circle-contribution-render.js +3 -4
  331. package/cjs/render/contributions/render/contributions/circle-contribution-render.js.map +1 -1
  332. package/cjs/render/contributions/render/contributions/group-contribution-render.js +1 -3
  333. package/cjs/render/contributions/render/contributions/group-contribution-render.js.map +1 -1
  334. package/cjs/render/contributions/render/contributions/image-contribution-render.js +1 -3
  335. package/cjs/render/contributions/render/contributions/image-contribution-render.js.map +1 -1
  336. package/cjs/render/contributions/render/contributions/rect-contribution-render.js +11 -14
  337. package/cjs/render/contributions/render/contributions/rect-contribution-render.js.map +1 -1
  338. package/cjs/render/contributions/render/contributions/symbol-contribution-render.js +3 -4
  339. package/cjs/render/contributions/render/contributions/symbol-contribution-render.js.map +1 -1
  340. package/cjs/render/contributions/render/contributions/text-contribution-render.js +6 -8
  341. package/cjs/render/contributions/render/contributions/text-contribution-render.js.map +1 -1
  342. package/cjs/render/contributions/render/draw-contribution.js +12 -14
  343. package/cjs/render/contributions/render/draw-contribution.js.map +1 -1
  344. package/cjs/render/contributions/render/draw-interceptor.js +11 -21
  345. package/cjs/render/contributions/render/draw-interceptor.js.map +1 -1
  346. package/cjs/render/contributions/render/glyph-render.js +2 -3
  347. package/cjs/render/contributions/render/glyph-render.js.map +1 -1
  348. package/cjs/render/contributions/render/graphic-render.js +4 -1
  349. package/cjs/render/contributions/render/graphic-render.js.map +1 -1
  350. package/cjs/render/contributions/render/group-render.js +7 -3
  351. package/cjs/render/contributions/render/group-render.js.map +1 -1
  352. package/cjs/render/contributions/render/image-render.js +4 -2
  353. package/cjs/render/contributions/render/image-render.js.map +1 -1
  354. package/cjs/render/contributions/render/incremental-area-render.js +1 -3
  355. package/cjs/render/contributions/render/incremental-area-render.js.map +1 -1
  356. package/cjs/render/contributions/render/incremental-draw-contribution.js +80 -109
  357. package/cjs/render/contributions/render/incremental-draw-contribution.js.map +1 -1
  358. package/cjs/render/contributions/render/incremental-line-render.js +1 -3
  359. package/cjs/render/contributions/render/incremental-line-render.js.map +1 -1
  360. package/cjs/render/contributions/render/line-render.js +12 -16
  361. package/cjs/render/contributions/render/line-render.js.map +1 -1
  362. package/cjs/render/contributions/render/path-render.js +8 -7
  363. package/cjs/render/contributions/render/path-render.js.map +1 -1
  364. package/cjs/render/contributions/render/polygon-render.js +6 -4
  365. package/cjs/render/contributions/render/polygon-render.js.map +1 -1
  366. package/cjs/render/contributions/render/pyramid3d-render.js +3 -5
  367. package/cjs/render/contributions/render/pyramid3d-render.js.map +1 -1
  368. package/cjs/render/contributions/render/rect-render.js +8 -7
  369. package/cjs/render/contributions/render/rect-render.js.map +1 -1
  370. package/cjs/render/contributions/render/rect3d-render.js +5 -7
  371. package/cjs/render/contributions/render/rect3d-render.js.map +1 -1
  372. package/cjs/render/contributions/render/richtext-render.js +4 -3
  373. package/cjs/render/contributions/render/richtext-render.js.map +1 -1
  374. package/cjs/render/contributions/render/symbol-render.js +11 -14
  375. package/cjs/render/contributions/render/symbol-render.js.map +1 -1
  376. package/cjs/render/contributions/render/text-render.js +8 -8
  377. package/cjs/render/contributions/render/text-render.js.map +1 -1
  378. package/cjs/render/contributions/render/utils.js +1 -1
  379. package/cjs/render/contributions/render/utils.js.map +1 -1
  380. package/cjs/render/render-service.js +11 -2
  381. package/cjs/render/render-service.js.map +1 -1
  382. package/cjs/resource-loader/loader.js +13 -16
  383. package/cjs/resource-loader/loader.js.map +1 -1
  384. package/cjs/tapable/Hook.js +3 -0
  385. package/cjs/tapable/Hook.js.map +1 -1
  386. package/dist/index.es.js +28908 -0
  387. package/es/allocator/bounds-allocate.js +1 -1
  388. package/es/allocator/bounds-allocate.js.map +1 -1
  389. package/es/allocator/canvas-allocate.js +11 -9
  390. package/es/allocator/canvas-allocate.js.map +1 -1
  391. package/es/allocator/graphic-allocate.js +5 -9
  392. package/es/allocator/graphic-allocate.js.map +1 -1
  393. package/es/allocator/matrix-allocate.js +2 -6
  394. package/es/allocator/matrix-allocate.js.map +1 -1
  395. package/es/animate/Ticker/default-ticker.js +25 -14
  396. package/es/animate/Ticker/default-ticker.js.map +1 -1
  397. package/es/animate/animate.js +7 -8
  398. package/es/animate/animate.js.map +1 -1
  399. package/es/animate/custom-animate.js +52 -50
  400. package/es/animate/custom-animate.js.map +1 -1
  401. package/es/animate/easing.js +18 -8
  402. package/es/animate/easing.js.map +1 -1
  403. package/es/animate/morphing.js +20 -23
  404. package/es/animate/morphing.js.map +1 -1
  405. package/es/application.js +7 -1
  406. package/es/application.js.map +1 -1
  407. package/es/canvas/conical-gradient.js +12 -6
  408. package/es/canvas/conical-gradient.js.map +1 -1
  409. package/es/canvas/contributions/base-canvas.js +19 -7
  410. package/es/canvas/contributions/base-canvas.js.map +1 -1
  411. package/es/color-string/interpolate.js +5 -3
  412. package/es/color-string/interpolate.js.map +1 -1
  413. package/es/color-string/store.js +2 -2
  414. package/es/color-string/store.js.map +1 -1
  415. package/es/common/bounds-context.js +1 -0
  416. package/es/common/bounds-context.js.map +1 -1
  417. package/es/common/canvas-utils.js +3 -6
  418. package/es/common/canvas-utils.js.map +1 -1
  419. package/es/common/contribution-provider.js +3 -0
  420. package/es/common/contribution-provider.js.map +1 -1
  421. package/es/common/custom-path2d.js +7 -1
  422. package/es/common/custom-path2d.js.map +1 -1
  423. package/es/common/generator.js +1 -2
  424. package/es/common/generator.js.map +1 -1
  425. package/es/common/inversify/binding.js +12 -0
  426. package/es/common/inversify/binding.js.map +1 -1
  427. package/es/common/inversify/container.js +4 -0
  428. package/es/common/inversify/container.js.map +1 -1
  429. package/es/common/inversify/cotainer-module.js +2 -0
  430. package/es/common/inversify/cotainer-module.js.map +1 -1
  431. package/es/common/inversify/meta-data.js +2 -0
  432. package/es/common/inversify/meta-data.js.map +1 -1
  433. package/es/common/inversify/syntax/binding_in_syntax.js +1 -0
  434. package/es/common/inversify/syntax/binding_in_syntax.js.map +1 -1
  435. package/es/common/inversify/syntax/binding_to_syntax.js +1 -0
  436. package/es/common/inversify/syntax/binding_to_syntax.js.map +1 -1
  437. package/es/common/inversify-lite/annotation/lazy_service_identifier.js +1 -0
  438. package/es/common/inversify-lite/annotation/lazy_service_identifier.js.map +1 -1
  439. package/es/common/inversify-lite/bindings/binding.js +14 -0
  440. package/es/common/inversify-lite/bindings/binding.js.map +1 -1
  441. package/es/common/inversify-lite/container/container.js +22 -48
  442. package/es/common/inversify-lite/container/container.js.map +1 -1
  443. package/es/common/inversify-lite/container/container_module.js +4 -0
  444. package/es/common/inversify-lite/container/container_module.js.map +1 -1
  445. package/es/common/inversify-lite/container/lookup.js +1 -0
  446. package/es/common/inversify-lite/container/lookup.js.map +1 -1
  447. package/es/common/inversify-lite/planning/context.js +4 -0
  448. package/es/common/inversify-lite/planning/context.js.map +1 -1
  449. package/es/common/inversify-lite/planning/metadata.js +2 -0
  450. package/es/common/inversify-lite/planning/metadata.js.map +1 -1
  451. package/es/common/inversify-lite/planning/plan.js +2 -0
  452. package/es/common/inversify-lite/planning/plan.js.map +1 -1
  453. package/es/common/inversify-lite/planning/queryable_string.js +1 -0
  454. package/es/common/inversify-lite/planning/queryable_string.js.map +1 -1
  455. package/es/common/inversify-lite/planning/request.js +8 -0
  456. package/es/common/inversify-lite/planning/request.js.map +1 -1
  457. package/es/common/inversify-lite/planning/target.js +7 -0
  458. package/es/common/inversify-lite/planning/target.js.map +1 -1
  459. package/es/common/inversify-lite/resolution/instantiation.js +16 -44
  460. package/es/common/inversify-lite/resolution/instantiation.js.map +1 -1
  461. package/es/common/inversify-lite/scope/scope.js +3 -29
  462. package/es/common/inversify-lite/scope/scope.js.map +1 -1
  463. package/es/common/inversify-lite/syntax/binding_in_syntax.js +1 -0
  464. package/es/common/inversify-lite/syntax/binding_in_syntax.js.map +1 -1
  465. package/es/common/inversify-lite/syntax/binding_in_when_on_syntax.js +3 -0
  466. package/es/common/inversify-lite/syntax/binding_in_when_on_syntax.js.map +1 -1
  467. package/es/common/inversify-lite/syntax/binding_on_syntax.js +1 -0
  468. package/es/common/inversify-lite/syntax/binding_on_syntax.js.map +1 -1
  469. package/es/common/inversify-lite/syntax/binding_to_syntax.js +1 -0
  470. package/es/common/inversify-lite/syntax/binding_to_syntax.js.map +1 -1
  471. package/es/common/inversify-lite/syntax/binding_when_on_syntax.js +2 -0
  472. package/es/common/inversify-lite/syntax/binding_when_on_syntax.js.map +1 -1
  473. package/es/common/inversify-lite/syntax/binding_when_syntax.js +1 -0
  474. package/es/common/inversify-lite/syntax/binding_when_syntax.js.map +1 -1
  475. package/es/common/polygon.js +1 -2
  476. package/es/common/polygon.js.map +1 -1
  477. package/es/common/render-area.js +2 -3
  478. package/es/common/render-area.js.map +1 -1
  479. package/es/common/render-curve.js +4 -8
  480. package/es/common/render-curve.js.map +1 -1
  481. package/es/common/seg-context.js +12 -3
  482. package/es/common/seg-context.js.map +1 -1
  483. package/es/common/segment/basis.js +13 -0
  484. package/es/common/segment/basis.js.map +1 -1
  485. package/es/common/segment/common.js +1 -1
  486. package/es/common/segment/common.js.map +1 -1
  487. package/es/common/segment/curve/arc.js +2 -1
  488. package/es/common/segment/curve/arc.js.map +1 -1
  489. package/es/common/segment/curve/base.js +4 -0
  490. package/es/common/segment/curve/base.js.map +1 -1
  491. package/es/common/segment/curve/cubic-bezier.js +2 -2
  492. package/es/common/segment/curve/cubic-bezier.js.map +1 -1
  493. package/es/common/segment/curve/curve-context.js +4 -0
  494. package/es/common/segment/curve/curve-context.js.map +1 -1
  495. package/es/common/segment/curve/ellipse.js +3 -3
  496. package/es/common/segment/curve/ellipse.js.map +1 -1
  497. package/es/common/segment/curve/line.js +2 -1
  498. package/es/common/segment/curve/line.js.map +1 -1
  499. package/es/common/segment/curve/move.js +2 -1
  500. package/es/common/segment/curve/move.js.map +1 -1
  501. package/es/common/segment/curve/path.js +2 -0
  502. package/es/common/segment/curve/path.js.map +1 -1
  503. package/es/common/segment/curve/quadratic-bezier.js +2 -2
  504. package/es/common/segment/curve/quadratic-bezier.js.map +1 -1
  505. package/es/common/segment/linear-closed.js.map +1 -1
  506. package/es/common/segment/linear.js +10 -0
  507. package/es/common/segment/linear.js.map +1 -1
  508. package/es/common/segment/monotone.js +13 -0
  509. package/es/common/segment/monotone.js.map +1 -1
  510. package/es/common/segment/step.js +12 -1
  511. package/es/common/segment/step.js.map +1 -1
  512. package/es/common/sort.js +3 -34
  513. package/es/common/sort.js.map +1 -1
  514. package/es/common/split-path.js +4 -11
  515. package/es/common/split-path.js.map +1 -1
  516. package/es/common/utils.d.ts +1 -1
  517. package/es/common/utils.js +9 -7
  518. package/es/common/utils.js.map +1 -1
  519. package/es/common/xml/parser.js +2 -2
  520. package/es/common/xml/parser.js.map +1 -1
  521. package/es/core/camera.js +11 -4
  522. package/es/core/camera.js.map +1 -1
  523. package/es/core/contributions/env/base-contribution.js +6 -0
  524. package/es/core/contributions/env/base-contribution.js.map +1 -1
  525. package/es/core/contributions/layerHandler/canvas2d-contribution.js +20 -11
  526. package/es/core/contributions/layerHandler/canvas2d-contribution.js.map +1 -1
  527. package/es/core/contributions/layerHandler/empty-contribution.js +8 -8
  528. package/es/core/contributions/layerHandler/empty-contribution.js.map +1 -1
  529. package/es/core/contributions/layerHandler/offscreen2d-contribution.js +5 -6
  530. package/es/core/contributions/layerHandler/offscreen2d-contribution.js.map +1 -1
  531. package/es/core/contributions/textMeasure/AtextMeasure.js +11 -8
  532. package/es/core/contributions/textMeasure/AtextMeasure.js.map +1 -1
  533. package/es/core/contributions/textMeasure/layout.js +3 -0
  534. package/es/core/contributions/textMeasure/layout.js.map +1 -1
  535. package/es/core/contributions/window/base-contribution.js +2 -0
  536. package/es/core/contributions/window/base-contribution.js.map +1 -1
  537. package/es/core/global.js +8 -0
  538. package/es/core/global.js.map +1 -1
  539. package/es/core/graphic-utils.js +16 -5
  540. package/es/core/graphic-utils.js.map +1 -1
  541. package/es/core/layer-service.js +7 -7
  542. package/es/core/layer-service.js.map +1 -1
  543. package/es/core/layer.js +7 -9
  544. package/es/core/layer.js.map +1 -1
  545. package/es/core/stage.js +79 -35
  546. package/es/core/stage.js.map +1 -1
  547. package/es/core/window.js +16 -14
  548. package/es/core/window.js.map +1 -1
  549. package/es/event/event-manager.js +152 -143
  550. package/es/event/event-manager.js.map +1 -1
  551. package/es/event/event-system.js +60 -43
  552. package/es/event/event-system.js.map +1 -1
  553. package/es/event/event-target.js +1 -3
  554. package/es/event/event-target.js.map +1 -1
  555. package/es/event/federated-event/base-event.js +43 -15
  556. package/es/event/federated-event/base-event.js.map +1 -1
  557. package/es/event/federated-event/mouse-event.js +27 -18
  558. package/es/event/federated-event/mouse-event.js.map +1 -1
  559. package/es/event/federated-event/pointer-event.js +13 -8
  560. package/es/event/federated-event/pointer-event.js.map +1 -1
  561. package/es/event/federated-event/wheel-event.js +13 -11
  562. package/es/event/federated-event/wheel-event.js.map +1 -1
  563. package/es/graphic/arc.js +9 -6
  564. package/es/graphic/arc.js.map +1 -1
  565. package/es/graphic/arc3d.js +6 -5
  566. package/es/graphic/arc3d.js.map +1 -1
  567. package/es/graphic/area.js +13 -10
  568. package/es/graphic/area.js.map +1 -1
  569. package/es/graphic/builtin-symbol/arrow.js +2 -3
  570. package/es/graphic/builtin-symbol/arrow.js.map +1 -1
  571. package/es/graphic/builtin-symbol/arrow2-down.js +2 -3
  572. package/es/graphic/builtin-symbol/arrow2-down.js.map +1 -1
  573. package/es/graphic/builtin-symbol/arrow2-left.js +2 -3
  574. package/es/graphic/builtin-symbol/arrow2-left.js.map +1 -1
  575. package/es/graphic/builtin-symbol/arrow2-right.js +2 -3
  576. package/es/graphic/builtin-symbol/arrow2-right.js.map +1 -1
  577. package/es/graphic/builtin-symbol/arrow2-up.js +2 -3
  578. package/es/graphic/builtin-symbol/arrow2-up.js.map +1 -1
  579. package/es/graphic/builtin-symbol/circle.js +2 -3
  580. package/es/graphic/builtin-symbol/circle.js.map +1 -1
  581. package/es/graphic/builtin-symbol/close.js +2 -3
  582. package/es/graphic/builtin-symbol/close.js.map +1 -1
  583. package/es/graphic/builtin-symbol/cross.js +2 -3
  584. package/es/graphic/builtin-symbol/cross.js.map +1 -1
  585. package/es/graphic/builtin-symbol/diamond.js +2 -3
  586. package/es/graphic/builtin-symbol/diamond.js.map +1 -1
  587. package/es/graphic/builtin-symbol/line-h.js +2 -3
  588. package/es/graphic/builtin-symbol/line-h.js.map +1 -1
  589. package/es/graphic/builtin-symbol/line-v.js +2 -3
  590. package/es/graphic/builtin-symbol/line-v.js.map +1 -1
  591. package/es/graphic/builtin-symbol/rect.js +2 -3
  592. package/es/graphic/builtin-symbol/rect.js.map +1 -1
  593. package/es/graphic/builtin-symbol/square.js +2 -3
  594. package/es/graphic/builtin-symbol/square.js.map +1 -1
  595. package/es/graphic/builtin-symbol/star.js +2 -3
  596. package/es/graphic/builtin-symbol/star.js.map +1 -1
  597. package/es/graphic/builtin-symbol/stroke.js +2 -3
  598. package/es/graphic/builtin-symbol/stroke.js.map +1 -1
  599. package/es/graphic/builtin-symbol/thin-triangle.js +2 -3
  600. package/es/graphic/builtin-symbol/thin-triangle.js.map +1 -1
  601. package/es/graphic/builtin-symbol/triangle-down.js +2 -3
  602. package/es/graphic/builtin-symbol/triangle-down.js.map +1 -1
  603. package/es/graphic/builtin-symbol/triangle-left.js +2 -3
  604. package/es/graphic/builtin-symbol/triangle-left.js.map +1 -1
  605. package/es/graphic/builtin-symbol/triangle-right.js +2 -3
  606. package/es/graphic/builtin-symbol/triangle-right.js.map +1 -1
  607. package/es/graphic/builtin-symbol/triangle-up.js +2 -3
  608. package/es/graphic/builtin-symbol/triangle-up.js.map +1 -1
  609. package/es/graphic/builtin-symbol/triangle.js +1 -3
  610. package/es/graphic/builtin-symbol/triangle.js.map +1 -1
  611. package/es/graphic/builtin-symbol/utils.js +6 -2
  612. package/es/graphic/builtin-symbol/utils.js.map +1 -1
  613. package/es/graphic/builtin-symbol/wedge.js +2 -3
  614. package/es/graphic/builtin-symbol/wedge.js.map +1 -1
  615. package/es/graphic/builtin-symbol/wye.js +2 -3
  616. package/es/graphic/builtin-symbol/wye.js.map +1 -1
  617. package/es/graphic/circle.js +7 -6
  618. package/es/graphic/circle.js.map +1 -1
  619. package/es/graphic/config.js +73 -44
  620. package/es/graphic/config.js.map +1 -1
  621. package/es/graphic/glyph.js +9 -9
  622. package/es/graphic/glyph.js.map +1 -1
  623. package/es/graphic/graphic-service/graphic-service.js +12 -8
  624. package/es/graphic/graphic-service/graphic-service.js.map +1 -1
  625. package/es/graphic/graphic.d.ts +1 -0
  626. package/es/graphic/graphic.js +32 -42
  627. package/es/graphic/graphic.js.map +1 -1
  628. package/es/graphic/group.js +8 -5
  629. package/es/graphic/group.js.map +1 -1
  630. package/es/graphic/image.js +17 -16
  631. package/es/graphic/image.js.map +1 -1
  632. package/es/graphic/line.js +10 -7
  633. package/es/graphic/line.js.map +1 -1
  634. package/es/graphic/node-tree.js +25 -44
  635. package/es/graphic/node-tree.js.map +1 -1
  636. package/es/graphic/path.js +11 -7
  637. package/es/graphic/path.js.map +1 -1
  638. package/es/graphic/polygon.js +6 -4
  639. package/es/graphic/polygon.js.map +1 -1
  640. package/es/graphic/pyramid3d.js +3 -3
  641. package/es/graphic/pyramid3d.js.map +1 -1
  642. package/es/graphic/rect.js +6 -4
  643. package/es/graphic/rect.js.map +1 -1
  644. package/es/graphic/rect3d.js +4 -4
  645. package/es/graphic/rect3d.js.map +1 -1
  646. package/es/graphic/richtext/frame.js +19 -0
  647. package/es/graphic/richtext/frame.js.map +1 -1
  648. package/es/graphic/richtext/icon.js +14 -6
  649. package/es/graphic/richtext/icon.js.map +1 -1
  650. package/es/graphic/richtext/line.js +14 -2
  651. package/es/graphic/richtext/line.js.map +1 -1
  652. package/es/graphic/richtext/paragraph.js +22 -0
  653. package/es/graphic/richtext/paragraph.js.map +1 -1
  654. package/es/graphic/richtext/utils.js +1 -2
  655. package/es/graphic/richtext/utils.js.map +1 -1
  656. package/es/graphic/richtext/wrapper.js +12 -0
  657. package/es/graphic/richtext/wrapper.js.map +1 -1
  658. package/es/graphic/richtext.js +37 -46
  659. package/es/graphic/richtext.js.map +1 -1
  660. package/es/graphic/shadow-root.js +2 -1
  661. package/es/graphic/shadow-root.js.map +1 -1
  662. package/es/graphic/symbol.js +11 -6
  663. package/es/graphic/symbol.js.map +1 -1
  664. package/es/graphic/text.js +39 -40
  665. package/es/graphic/text.js.map +1 -1
  666. package/es/graphic/theme.js +4 -0
  667. package/es/graphic/theme.js.map +1 -1
  668. package/es/graphic/tools.js +16 -44
  669. package/es/graphic/tools.js.map +1 -1
  670. package/es/graphic/wrap-text.js +6 -6
  671. package/es/graphic/wrap-text.js.map +1 -1
  672. package/es/interface/global.d.ts +2 -1
  673. package/es/interface/global.js.map +1 -1
  674. package/es/interface/graphic.d.ts +1 -0
  675. package/es/interface/graphic.js.map +1 -1
  676. package/es/picker/global-picker-service.js +1 -0
  677. package/es/picker/global-picker-service.js.map +1 -1
  678. package/es/picker/pick-interceptor.js +5 -15
  679. package/es/picker/pick-interceptor.js.map +1 -1
  680. package/es/picker/picker-service.js +5 -5
  681. package/es/picker/picker-service.js.map +1 -1
  682. package/es/plugins/builtin-plugin/3dview-transform-plugin.js +26 -20
  683. package/es/plugins/builtin-plugin/3dview-transform-plugin.js.map +1 -1
  684. package/es/plugins/builtin-plugin/auto-render-plugin.js +5 -4
  685. package/es/plugins/builtin-plugin/auto-render-plugin.js.map +1 -1
  686. package/es/plugins/builtin-plugin/dirty-bounds-plugin.js +5 -4
  687. package/es/plugins/builtin-plugin/dirty-bounds-plugin.js.map +1 -1
  688. package/es/plugins/builtin-plugin/flex-layout-plugin.js +11 -8
  689. package/es/plugins/builtin-plugin/flex-layout-plugin.js.map +1 -1
  690. package/es/plugins/builtin-plugin/html-attribute-plugin.js +28 -17
  691. package/es/plugins/builtin-plugin/html-attribute-plugin.js.map +1 -1
  692. package/es/plugins/builtin-plugin/incremental-auto-render-plugin.js +12 -8
  693. package/es/plugins/builtin-plugin/incremental-auto-render-plugin.js.map +1 -1
  694. package/es/plugins/builtin-plugin/react-attribute-plugin.js +6 -6
  695. package/es/plugins/builtin-plugin/react-attribute-plugin.js.map +1 -1
  696. package/es/plugins/plugin-service.js +1 -0
  697. package/es/plugins/plugin-service.js.map +1 -1
  698. package/es/render/contributions/render/arc-render.js +6 -4
  699. package/es/render/contributions/render/arc-render.js.map +1 -1
  700. package/es/render/contributions/render/arc3d-render.js +5 -7
  701. package/es/render/contributions/render/arc3d-render.js.map +1 -1
  702. package/es/render/contributions/render/area-render.js +21 -23
  703. package/es/render/contributions/render/area-render.js.map +1 -1
  704. package/es/render/contributions/render/base-render.js +5 -0
  705. package/es/render/contributions/render/base-render.js.map +1 -1
  706. package/es/render/contributions/render/circle-render.js +6 -4
  707. package/es/render/contributions/render/circle-render.js.map +1 -1
  708. package/es/render/contributions/render/contributions/arc-contribution-render.js +3 -3
  709. package/es/render/contributions/render/contributions/arc-contribution-render.js.map +1 -1
  710. package/es/render/contributions/render/contributions/area-texture-contribution-render.js +2 -5
  711. package/es/render/contributions/render/contributions/area-texture-contribution-render.js.map +1 -1
  712. package/es/render/contributions/render/contributions/base-contribution-render.js +10 -7
  713. package/es/render/contributions/render/contributions/base-contribution-render.js.map +1 -1
  714. package/es/render/contributions/render/contributions/base-texture-contribution-render.js +4 -3
  715. package/es/render/contributions/render/contributions/base-texture-contribution-render.js.map +1 -1
  716. package/es/render/contributions/render/contributions/circle-contribution-render.js +3 -3
  717. package/es/render/contributions/render/contributions/circle-contribution-render.js.map +1 -1
  718. package/es/render/contributions/render/contributions/group-contribution-render.js +1 -3
  719. package/es/render/contributions/render/contributions/group-contribution-render.js.map +1 -1
  720. package/es/render/contributions/render/contributions/image-contribution-render.js +1 -3
  721. package/es/render/contributions/render/contributions/image-contribution-render.js.map +1 -1
  722. package/es/render/contributions/render/contributions/rect-contribution-render.js +11 -11
  723. package/es/render/contributions/render/contributions/rect-contribution-render.js.map +1 -1
  724. package/es/render/contributions/render/contributions/symbol-contribution-render.js +3 -3
  725. package/es/render/contributions/render/contributions/symbol-contribution-render.js.map +1 -1
  726. package/es/render/contributions/render/contributions/text-contribution-render.js +6 -8
  727. package/es/render/contributions/render/contributions/text-contribution-render.js.map +1 -1
  728. package/es/render/contributions/render/draw-contribution.js +12 -14
  729. package/es/render/contributions/render/draw-contribution.js.map +1 -1
  730. package/es/render/contributions/render/draw-interceptor.js +11 -21
  731. package/es/render/contributions/render/draw-interceptor.js.map +1 -1
  732. package/es/render/contributions/render/glyph-render.js +2 -3
  733. package/es/render/contributions/render/glyph-render.js.map +1 -1
  734. package/es/render/contributions/render/graphic-render.js +4 -1
  735. package/es/render/contributions/render/graphic-render.js.map +1 -1
  736. package/es/render/contributions/render/group-render.js +7 -3
  737. package/es/render/contributions/render/group-render.js.map +1 -1
  738. package/es/render/contributions/render/image-render.js +5 -2
  739. package/es/render/contributions/render/image-render.js.map +1 -1
  740. package/es/render/contributions/render/incremental-area-render.js +1 -3
  741. package/es/render/contributions/render/incremental-area-render.js.map +1 -1
  742. package/es/render/contributions/render/incremental-draw-contribution.js +80 -109
  743. package/es/render/contributions/render/incremental-draw-contribution.js.map +1 -1
  744. package/es/render/contributions/render/incremental-line-render.js +1 -3
  745. package/es/render/contributions/render/incremental-line-render.js.map +1 -1
  746. package/es/render/contributions/render/line-render.js +12 -16
  747. package/es/render/contributions/render/line-render.js.map +1 -1
  748. package/es/render/contributions/render/path-render.js +8 -6
  749. package/es/render/contributions/render/path-render.js.map +1 -1
  750. package/es/render/contributions/render/polygon-render.js +6 -4
  751. package/es/render/contributions/render/polygon-render.js.map +1 -1
  752. package/es/render/contributions/render/pyramid3d-render.js +3 -5
  753. package/es/render/contributions/render/pyramid3d-render.js.map +1 -1
  754. package/es/render/contributions/render/rect-render.js +8 -6
  755. package/es/render/contributions/render/rect-render.js.map +1 -1
  756. package/es/render/contributions/render/rect3d-render.js +5 -7
  757. package/es/render/contributions/render/rect3d-render.js.map +1 -1
  758. package/es/render/contributions/render/richtext-render.js +4 -3
  759. package/es/render/contributions/render/richtext-render.js.map +1 -1
  760. package/es/render/contributions/render/symbol-render.js +11 -14
  761. package/es/render/contributions/render/symbol-render.js.map +1 -1
  762. package/es/render/contributions/render/text-render.js +9 -8
  763. package/es/render/contributions/render/text-render.js.map +1 -1
  764. package/es/render/contributions/render/utils.js +1 -1
  765. package/es/render/contributions/render/utils.js.map +1 -1
  766. package/es/render/render-service.js +11 -2
  767. package/es/render/render-service.js.map +1 -1
  768. package/es/resource-loader/loader.js +12 -17
  769. package/es/resource-loader/loader.js.map +1 -1
  770. package/es/tapable/Hook.js +3 -0
  771. package/es/tapable/Hook.js.map +1 -1
  772. package/package.json +4 -4
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/render/contributions/render/contributions/rect-contribution-render.ts"],"names":[],"mappings":";;;;;;;;;AAAA,6CAA2C;AAC3C,sEAA+D;AAW/D,kEAAkE;AAClE,yEAAqF;AACrF,wDAA+D;AAC/D,oDAA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AAgC,CA4E5C;AA5EY,4EAAgC;AA8EhC,QAAA,6BAA6B,GAAG,IAAI,6BAA6B,EAAE,CAAC;AAGpE,QAAA,oCAAoC,GAAG,uEAAoC,CAAC;AAC5E,QAAA,uCAAuC,GAAG,kEAAuC,CAAC","file":"rect-contribution-render.js","sourcesContent":["import { isArray } from '@visactor/vutils';\nimport { injectable } from '../../../../common/inversify-lite';\nimport type {\n IGraphicAttribute,\n IContext2d,\n IMarkAttribute,\n IRect,\n IRectGraphicAttribute,\n IThemeAttribute,\n IRectRenderContribution,\n IDrawContext\n} from '../../../../interface';\nimport { getScaledStroke } from '../../../../common/canvas-utils';\nimport { defaultBaseBackgroundRenderContribution } from './base-contribution-render';\nimport { createRectPath } from '../../../../common/shape/rect';\nimport { BaseRenderContributionTime } from '../../../../common/enums';\nimport { defaultBaseTextureRenderContribution } from './base-texture-contribution-render';\n\nexport class DefaultRectRenderContribution implements IRectRenderContribution {\n time: BaseRenderContributionTime = BaseRenderContributionTime.afterFillStroke;\n useStyle: boolean = true;\n order: number = 0;\n drawShape(\n rect: IRect,\n context: IContext2d,\n x: number,\n y: number,\n doFill: boolean,\n doStroke: boolean,\n fVisible: boolean,\n sVisible: boolean,\n rectAttribute: Required<IRectGraphicAttribute>,\n drawContext: IDrawContext,\n fillCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean,\n strokeCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean\n ) {\n const { outerBorder, innerBorder } = rect.attribute;\n const doOuterBorder = outerBorder && outerBorder.visible !== false;\n const doInnerBorder = innerBorder && innerBorder.visible !== false;\n if (!(doOuterBorder || doInnerBorder)) {\n return;\n }\n const {\n cornerRadius = rectAttribute.cornerRadius,\n opacity = rectAttribute.opacity,\n x: originX = rectAttribute.x,\n y: originY = rectAttribute.y,\n scaleX = rectAttribute.scaleX,\n scaleY = rectAttribute.scaleY,\n x1,\n y1\n } = rect.attribute;\n\n let { width, height } = rect.attribute;\n\n width = (width ?? x1 - x) || 0;\n height = (height ?? y1 - y) || 0;\n\n const doStrokeOuter = !!(outerBorder && outerBorder.stroke);\n const doStrokeInner = !!(innerBorder && innerBorder.stroke);\n\n if (doOuterBorder) {\n const { distance = rectAttribute.outerBorder.distance } = outerBorder;\n const d = getScaledStroke(context, distance as number, context.dpr);\n const nextX = x - d;\n const nextY = y - d;\n const dw = d * 2;\n if (cornerRadius === 0 || (isArray(cornerRadius) && (<number[]>cornerRadius).every(num => num === 0))) {\n // 不需要处理圆角\n context.beginPath();\n context.rect(nextX, nextY, width + dw, height + dw);\n } else {\n context.beginPath();\n\n // 测试后,cache对于重绘性能提升不大,但是在首屏有一定性能损耗,因此rect不再使用cache\n createRectPath(context, nextX, nextY, width + dw, height + dw, cornerRadius);\n }\n\n // shadow\n context.setShadowBlendStyle && context.setShadowBlendStyle(rect, rect.attribute, rectAttribute);\n\n if (strokeCb) {\n strokeCb(context, outerBorder, rectAttribute.outerBorder);\n } else if (doStrokeOuter) {\n // 存在stroke\n const lastOpacity = (rectAttribute.outerBorder as any).opacity;\n (rectAttribute.outerBorder as any).opacity = opacity;\n context.setStrokeStyle(\n rect,\n outerBorder,\n (originX - x) / scaleX,\n (originY - y) / scaleY,\n rectAttribute.outerBorder as any\n );\n (rectAttribute.outerBorder as any).opacity = lastOpacity;\n context.stroke();\n }\n }\n\n if (doInnerBorder) {\n const { distance = rectAttribute.innerBorder.distance } = innerBorder;\n const d = getScaledStroke(context, distance as number, context.dpr);\n const nextX = x + d;\n const nextY = y + d;\n const dw = d * 2;\n if (cornerRadius === 0 || (isArray(cornerRadius) && (<number[]>cornerRadius).every(num => num === 0))) {\n // 不需要处理圆角\n context.beginPath();\n context.rect(nextX, nextY, width - dw, height - dw);\n } else {\n context.beginPath();\n\n // 测试后,cache对于重绘性能提升不大,但是在首屏有一定性能损耗,因此rect不再使用cache\n createRectPath(context, nextX, nextY, width - dw, height - dw, cornerRadius);\n }\n\n // shadow\n context.setShadowBlendStyle && context.setShadowBlendStyle(rect, rect.attribute, rectAttribute);\n\n if (strokeCb) {\n strokeCb(context, innerBorder, rectAttribute.innerBorder);\n } else if (doStrokeInner) {\n // 存在stroke\n const lastOpacity = (rectAttribute.innerBorder as any).opacity;\n (rectAttribute.innerBorder as any).opacity = opacity;\n context.setStrokeStyle(\n rect,\n innerBorder,\n (originX - x) / scaleX,\n (originY - y) / scaleY,\n rectAttribute.innerBorder as any\n );\n (rectAttribute.innerBorder as any).opacity = lastOpacity;\n context.stroke();\n }\n }\n }\n}\n\n@injectable()\nexport class SplitRectBeforeRenderContribution implements IRectRenderContribution {\n time: BaseRenderContributionTime = BaseRenderContributionTime.beforeFillStroke;\n useStyle: boolean = true;\n order: number = 0;\n drawShape(\n group: IRect,\n context: IContext2d,\n x: number,\n y: number,\n doFill: boolean,\n doStroke: boolean,\n fVisible: boolean,\n sVisible: boolean,\n groupAttribute: Required<IRectGraphicAttribute>,\n drawContext: IDrawContext,\n fillCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean,\n strokeCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean,\n doFillOrStroke?: { doFill: boolean; doStroke: boolean }\n ) {\n const { stroke = groupAttribute.stroke } = group.attribute as any;\n\n // 数组且存在为false的项目,那就不绘制\n if (Array.isArray(stroke) && stroke.some(s => s === false)) {\n doFillOrStroke.doStroke = false;\n }\n }\n}\n\n@injectable()\nexport class SplitRectAfterRenderContribution implements IRectRenderContribution {\n time: BaseRenderContributionTime = BaseRenderContributionTime.afterFillStroke;\n useStyle: boolean = true;\n order: number = 0;\n drawShape(\n rect: IRect,\n context: IContext2d,\n x: number,\n y: number,\n doFill: boolean,\n doStroke: boolean,\n fVisible: boolean,\n sVisible: boolean,\n groupAttribute: Required<IRectGraphicAttribute>,\n drawContext: IDrawContext,\n fillCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean,\n strokeCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean\n ) {\n const {\n x1,\n y1,\n x: originX = groupAttribute.x,\n y: originY = groupAttribute.y,\n stroke = groupAttribute.stroke\n } = rect.attribute as any;\n\n let { width, height } = rect.attribute;\n width = (width ?? x1 - originX) || 0;\n height = (height ?? y1 - originY) || 0;\n\n // 不是数组\n if (!(Array.isArray(stroke) && stroke.some(s => s === false))) {\n return;\n }\n\n context.setStrokeStyle(rect, rect.attribute, x, y, groupAttribute);\n // 单独处理每条边界,目前不考虑圆角\n context.beginPath();\n context.moveTo(x, y);\n // top\n if (stroke[0]) {\n context.lineTo(x + width, y);\n } else {\n context.moveTo(x + width, y);\n }\n // right\n if (stroke[1]) {\n context.lineTo(x + width, y + height);\n } else {\n context.moveTo(x + width, y + height);\n }\n // bottom\n if (stroke[2]) {\n context.lineTo(x, y + height);\n } else {\n context.moveTo(x, y + height);\n }\n // left\n if (stroke[3]) {\n // 没有close path是,起点和终点不连续,需要调整y保证不出现缺口\n const adjustY = stroke[0] ? y - context.lineWidth / 2 : y;\n context.lineTo(x, adjustY);\n } else {\n context.moveTo(x, y);\n }\n\n context.stroke();\n }\n}\n\nexport const defaultRectRenderContribution = new DefaultRectRenderContribution();\n// export const splitRectBeforeRenderContribution = new SplitRectBeforeRenderContribution();\n// export const splitRectAfterRenderContribution = new SplitRectAfterRenderContribution();\nexport const defaultRectTextureRenderContribution = defaultBaseTextureRenderContribution;\nexport const defaultRectBackgroundRenderContribution = defaultBaseBackgroundRenderContribution;\n"]}
1
+ {"version":3,"sources":["../src/render/contributions/render/contributions/rect-contribution-render.ts"],"names":[],"mappings":";;;;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BAA6B,EAAE,CAAC;AAGpE,QAAA,oCAAoC,GAAG,uEAAoC,CAAC;AAC5E,QAAA,uCAAuC,GAAG,kEAAuC,CAAC","file":"rect-contribution-render.js","sourcesContent":["import { isArray } from '@visactor/vutils';\nimport { injectable } from '../../../../common/inversify-lite';\nimport type {\n IGraphicAttribute,\n IContext2d,\n IMarkAttribute,\n IRect,\n IRectGraphicAttribute,\n IThemeAttribute,\n IRectRenderContribution,\n IDrawContext\n} from '../../../../interface';\nimport { getScaledStroke } from '../../../../common/canvas-utils';\nimport { defaultBaseBackgroundRenderContribution } from './base-contribution-render';\nimport { createRectPath } from '../../../../common/shape/rect';\nimport { BaseRenderContributionTime } from '../../../../common/enums';\nimport { defaultBaseTextureRenderContribution } from './base-texture-contribution-render';\n\nexport class DefaultRectRenderContribution implements IRectRenderContribution {\n time: BaseRenderContributionTime = BaseRenderContributionTime.afterFillStroke;\n useStyle: boolean = true;\n order: number = 0;\n drawShape(\n rect: IRect,\n context: IContext2d,\n x: number,\n y: number,\n doFill: boolean,\n doStroke: boolean,\n fVisible: boolean,\n sVisible: boolean,\n rectAttribute: Required<IRectGraphicAttribute>,\n drawContext: IDrawContext,\n fillCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean,\n strokeCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean\n ) {\n const { outerBorder, innerBorder } = rect.attribute;\n const doOuterBorder = outerBorder && outerBorder.visible !== false;\n const doInnerBorder = innerBorder && innerBorder.visible !== false;\n if (!(doOuterBorder || doInnerBorder)) {\n return;\n }\n const {\n cornerRadius = rectAttribute.cornerRadius,\n opacity = rectAttribute.opacity,\n x: originX = rectAttribute.x,\n y: originY = rectAttribute.y,\n scaleX = rectAttribute.scaleX,\n scaleY = rectAttribute.scaleY,\n x1,\n y1\n } = rect.attribute;\n\n let { width, height } = rect.attribute;\n\n width = (width ?? x1 - x) || 0;\n height = (height ?? y1 - y) || 0;\n\n const doStrokeOuter = !!(outerBorder && outerBorder.stroke);\n const doStrokeInner = !!(innerBorder && innerBorder.stroke);\n\n if (doOuterBorder) {\n const { distance = rectAttribute.outerBorder.distance } = outerBorder;\n const d = getScaledStroke(context, distance as number, context.dpr);\n const nextX = x - d;\n const nextY = y - d;\n const dw = d * 2;\n if (cornerRadius === 0 || (isArray(cornerRadius) && (<number[]>cornerRadius).every(num => num === 0))) {\n // 不需要处理圆角\n context.beginPath();\n context.rect(nextX, nextY, width + dw, height + dw);\n } else {\n context.beginPath();\n\n // 测试后,cache对于重绘性能提升不大,但是在首屏有一定性能损耗,因此rect不再使用cache\n createRectPath(context, nextX, nextY, width + dw, height + dw, cornerRadius);\n }\n\n // shadow\n context.setShadowBlendStyle && context.setShadowBlendStyle(rect, rect.attribute, rectAttribute);\n\n if (strokeCb) {\n strokeCb(context, outerBorder, rectAttribute.outerBorder);\n } else if (doStrokeOuter) {\n // 存在stroke\n const lastOpacity = (rectAttribute.outerBorder as any).opacity;\n (rectAttribute.outerBorder as any).opacity = opacity;\n context.setStrokeStyle(\n rect,\n outerBorder,\n (originX - x) / scaleX,\n (originY - y) / scaleY,\n rectAttribute.outerBorder as any\n );\n (rectAttribute.outerBorder as any).opacity = lastOpacity;\n context.stroke();\n }\n }\n\n if (doInnerBorder) {\n const { distance = rectAttribute.innerBorder.distance } = innerBorder;\n const d = getScaledStroke(context, distance as number, context.dpr);\n const nextX = x + d;\n const nextY = y + d;\n const dw = d * 2;\n if (cornerRadius === 0 || (isArray(cornerRadius) && (<number[]>cornerRadius).every(num => num === 0))) {\n // 不需要处理圆角\n context.beginPath();\n context.rect(nextX, nextY, width - dw, height - dw);\n } else {\n context.beginPath();\n\n // 测试后,cache对于重绘性能提升不大,但是在首屏有一定性能损耗,因此rect不再使用cache\n createRectPath(context, nextX, nextY, width - dw, height - dw, cornerRadius);\n }\n\n // shadow\n context.setShadowBlendStyle && context.setShadowBlendStyle(rect, rect.attribute, rectAttribute);\n\n if (strokeCb) {\n strokeCb(context, innerBorder, rectAttribute.innerBorder);\n } else if (doStrokeInner) {\n // 存在stroke\n const lastOpacity = (rectAttribute.innerBorder as any).opacity;\n (rectAttribute.innerBorder as any).opacity = opacity;\n context.setStrokeStyle(\n rect,\n innerBorder,\n (originX - x) / scaleX,\n (originY - y) / scaleY,\n rectAttribute.innerBorder as any\n );\n (rectAttribute.innerBorder as any).opacity = lastOpacity;\n context.stroke();\n }\n }\n }\n}\n\n@injectable()\nexport class SplitRectBeforeRenderContribution implements IRectRenderContribution {\n time: BaseRenderContributionTime = BaseRenderContributionTime.beforeFillStroke;\n useStyle: boolean = true;\n order: number = 0;\n drawShape(\n group: IRect,\n context: IContext2d,\n x: number,\n y: number,\n doFill: boolean,\n doStroke: boolean,\n fVisible: boolean,\n sVisible: boolean,\n groupAttribute: Required<IRectGraphicAttribute>,\n drawContext: IDrawContext,\n fillCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean,\n strokeCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean,\n doFillOrStroke?: { doFill: boolean; doStroke: boolean }\n ) {\n const { stroke = groupAttribute.stroke } = group.attribute as any;\n\n // 数组且存在为false的项目,那就不绘制\n if (Array.isArray(stroke) && stroke.some(s => s === false)) {\n doFillOrStroke.doStroke = false;\n }\n }\n}\n\n@injectable()\nexport class SplitRectAfterRenderContribution implements IRectRenderContribution {\n time: BaseRenderContributionTime = BaseRenderContributionTime.afterFillStroke;\n useStyle: boolean = true;\n order: number = 0;\n drawShape(\n rect: IRect,\n context: IContext2d,\n x: number,\n y: number,\n doFill: boolean,\n doStroke: boolean,\n fVisible: boolean,\n sVisible: boolean,\n groupAttribute: Required<IRectGraphicAttribute>,\n drawContext: IDrawContext,\n fillCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean,\n strokeCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean\n ) {\n const {\n x1,\n y1,\n x: originX = groupAttribute.x,\n y: originY = groupAttribute.y,\n stroke = groupAttribute.stroke\n } = rect.attribute as any;\n\n let { width, height } = rect.attribute;\n width = (width ?? x1 - originX) || 0;\n height = (height ?? y1 - originY) || 0;\n\n // 不是数组\n if (!(Array.isArray(stroke) && stroke.some(s => s === false))) {\n return;\n }\n\n context.setStrokeStyle(rect, rect.attribute, x, y, groupAttribute);\n // 单独处理每条边界,目前不考虑圆角\n context.beginPath();\n context.moveTo(x, y);\n // top\n if (stroke[0]) {\n context.lineTo(x + width, y);\n } else {\n context.moveTo(x + width, y);\n }\n // right\n if (stroke[1]) {\n context.lineTo(x + width, y + height);\n } else {\n context.moveTo(x + width, y + height);\n }\n // bottom\n if (stroke[2]) {\n context.lineTo(x, y + height);\n } else {\n context.moveTo(x, y + height);\n }\n // left\n if (stroke[3]) {\n // 没有close path是,起点和终点不连续,需要调整y保证不出现缺口\n const adjustY = stroke[0] ? y - context.lineWidth / 2 : y;\n context.lineTo(x, adjustY);\n } else {\n context.moveTo(x, y);\n }\n\n context.stroke();\n }\n}\n\nexport const defaultRectRenderContribution = new DefaultRectRenderContribution();\n// export const splitRectBeforeRenderContribution = new SplitRectBeforeRenderContribution();\n// export const splitRectAfterRenderContribution = new SplitRectAfterRenderContribution();\nexport const defaultRectTextureRenderContribution = defaultBaseTextureRenderContribution;\nexport const defaultRectBackgroundRenderContribution = defaultBaseBackgroundRenderContribution;\n"]}
@@ -7,10 +7,9 @@ Object.defineProperty(exports, "__esModule", {
7
7
  const canvas_utils_1 = require("../../../../common/canvas-utils"), base_contribution_render_1 = require("./base-contribution-render"), enums_1 = require("../../../../common/enums"), base_texture_contribution_render_1 = require("./base-texture-contribution-render");
8
8
 
9
9
  class DefaultSymbolRenderContribution {
10
- constructor() {
11
- this.time = enums_1.BaseRenderContributionTime.afterFillStroke, this.useStyle = !0,
12
- this.order = 0;
13
- }
10
+ time=enums_1.BaseRenderContributionTime.afterFillStroke;
11
+ useStyle=!0;
12
+ order=0;
14
13
  drawShape(symbol, context, x, y, doFill, doStroke, fVisible, sVisible, symbolAttribute, drawContext, fillCb, strokeCb) {
15
14
  const parsedPath = symbol.getParsedPath();
16
15
  if (!parsedPath) return;
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/render/contributions/render/contributions/symbol-contribution-render.ts"],"names":[],"mappings":";;;AAUA,kEAAkE;AAClE,yEAAqF;AACrF,oDAAsE;AACtE,yFAA0F;AAE1F,MAAa,+BAA+B;IAA5C;QACE,SAAI,GAA+B,kCAA0B,CAAC,eAAe,CAAC;QAC9E,aAAQ,GAAY,IAAI,CAAC;QACzB,UAAK,GAAW,CAAC,CAAC;IA4GpB,CAAC;IA3GC,SAAS,CACP,MAAe,EACf,OAAmB,EACnB,CAAS,EACT,CAAS,EACT,MAAe,EACf,QAAiB,EACjB,QAAiB,EACjB,QAAiB,EACjB,eAAkD,EAClD,WAAyB,EACzB,MAIY,EACZ,QAIY;QAEZ,MAAM,UAAU,GAAG,MAAM,CAAC,aAAa,EAAE,CAAC;QAE1C,IAAI,CAAC,UAAU,EAAE;YACf,OAAO;SACR;QAED,MAAM,EAAE,WAAW,EAAE,WAAW,EAAE,GAAG,MAAM,CAAC,SAAS,CAAC;QACtD,MAAM,aAAa,GAAG,WAAW,IAAI,WAAW,CAAC,OAAO,KAAK,KAAK,CAAC;QACnE,MAAM,aAAa,GAAG,WAAW,IAAI,WAAW,CAAC,OAAO,KAAK,KAAK,CAAC;QACnE,IAAI,CAAC,CAAC,aAAa,IAAI,aAAa,CAAC,EAAE;YACrC,OAAO;SACR;QAED,MAAM,EACJ,IAAI,GAAG,eAAe,CAAC,IAAI,EAC3B,O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WAAW,CAAC;gBAC3D,OAAO,CAAC,MAAM,EAAE,CAAC;aAClB;SACF;IACH,CAAC;CACF;AA/GD,0EA+GC;AAEY,QAAA,+BAA+B,GAAG,IAAI,+BAA+B,EAAE,CAAC;AACxE,QAAA,sCAAsC,GAAG,uEAAoC,CAAC;AAC9E,QAAA,yCAAyC,GAAG,kEAAuC,CAAC","file":"symbol-contribution-render.js","sourcesContent":["import type {\n IGraphicAttribute,\n IContext2d,\n IMarkAttribute,\n ISymbol,\n ISymbolGraphicAttribute,\n IThemeAttribute,\n ISymbolRenderContribution,\n IDrawContext\n} from '../../../../interface';\nimport { getScaledStroke } from '../../../../common/canvas-utils';\nimport { defaultBaseBackgroundRenderContribution } from './base-contribution-render';\nimport { BaseRenderContributionTime } from '../../../../common/enums';\nimport { defaultBaseTextureRenderContribution } from './base-texture-contribution-render';\n\nexport class DefaultSymbolRenderContribution implements ISymbolRenderContribution {\n time: BaseRenderContributionTime = BaseRenderContributionTime.afterFillStroke;\n useStyle: boolean = true;\n order: number = 0;\n drawShape(\n symbol: ISymbol,\n context: IContext2d,\n x: number,\n y: number,\n doFill: boolean,\n doStroke: boolean,\n fVisible: boolean,\n sVisible: boolean,\n symbolAttribute: Required<ISymbolGraphicAttribute>,\n drawContext: IDrawContext,\n fillCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean,\n strokeCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean\n ) {\n const parsedPath = symbol.getParsedPath();\n // todo: 考虑使用path\n if (!parsedPath) {\n return;\n }\n\n const { outerBorder, innerBorder } = symbol.attribute;\n const doOuterBorder = outerBorder && outerBorder.visible !== false;\n const doInnerBorder = innerBorder && innerBorder.visible !== false;\n if (!(doOuterBorder || doInnerBorder)) {\n return;\n }\n\n const {\n size = symbolAttribute.size,\n opacity = symbolAttribute.opacity,\n x: originX = symbolAttribute.x,\n y: originY = symbolAttribute.y,\n scaleX = symbolAttribute.scaleX,\n scaleY = symbolAttribute.scaleY\n } = symbol.attribute;\n\n const doStrokeOuter = !!(outerBorder && outerBorder.stroke);\n const doStrokeInner = !!(innerBorder && innerBorder.stroke);\n\n if (doOuterBorder) {\n const { distance = symbolAttribute.outerBorder.distance } = outerBorder;\n const d = getScaledStroke(context, distance as number, context.dpr);\n\n context.beginPath();\n if (parsedPath.drawOffset(context, size, x, y, d) === false) {\n context.closePath();\n }\n\n // shadow\n context.setShadowBlendStyle && context.setShadowBlendStyle(symbol, symbol.attribute, symbolAttribute);\n\n if (strokeCb) {\n strokeCb(context, outerBorder, symbolAttribute.outerBorder);\n } else if (doStrokeOuter) {\n // 存在stroke\n const lastOpacity = (symbolAttribute.outerBorder as any).opacity;\n (symbolAttribute.outerBorder as any).opacity = opacity;\n context.setStrokeStyle(\n symbol,\n outerBorder,\n (originX - x) / scaleX,\n (originY - y) / scaleY,\n symbolAttribute.outerBorder as any\n );\n (symbolAttribute.outerBorder as any).opacity = lastOpacity;\n context.stroke();\n }\n }\n\n if (doInnerBorder) {\n const { distance = symbolAttribute.innerBorder.distance } = innerBorder;\n const d = getScaledStroke(context, distance as number, context.dpr);\n\n context.beginPath();\n if (parsedPath.drawOffset(context, size, x, y, -d) === false) {\n context.closePath();\n }\n\n // shadow\n context.setShadowBlendStyle && context.setShadowBlendStyle(symbol, symbol.attribute, symbolAttribute);\n\n if (strokeCb) {\n strokeCb(context, innerBorder, symbolAttribute.innerBorder);\n } else if (doStrokeInner) {\n // 存在stroke\n const lastOpacity = (symbolAttribute.innerBorder as any).opacity;\n (symbolAttribute.innerBorder as any).opacity = opacity;\n context.setStrokeStyle(\n symbol,\n innerBorder,\n (originX - x) / scaleX,\n (originY - y) / scaleY,\n symbolAttribute.innerBorder as any\n );\n (symbolAttribute.innerBorder as any).opacity = lastOpacity;\n context.stroke();\n }\n }\n }\n}\n\nexport const defaultSymbolRenderContribution = new DefaultSymbolRenderContribution();\nexport const defaultSymbolTextureRenderContribution = defaultBaseTextureRenderContribution;\nexport const defaultSymbolBackgroundRenderContribution = defaultBaseBackgroundRenderContribution;\n"]}
1
+ {"version":3,"sources":["../src/render/contributions/render/contributions/symbol-contribution-render.ts"],"names":[],"mappings":";;;AAUA,kEAAkE;AAClE,yEAAqF;AACrF,oDAAsE;AACtE,yFAA0F;AAE1F,MAAa,+BAA+B;IAC1C,IAAI,GAA+B,kCAA0B,CAAC,eAAe,CAAC;IAC9E,QAAQ,GAAY,IAAI,CAAC;IACzB,KAAK,GAAW,CAAC,CAAC;IAClB,SAAS,CACP,MAAe,EACf,OAAmB,EACnB,CAAS,EACT,CAAS,EACT,MAAe,EACf,QAAiB,EACjB,QAAiB,EACjB,QAAiB,EACjB,eAAkD,EAClD,WAAyB,EACzB,MAIY,EACZ,QAIY;QAEZ,MAAM,UAAU,GAAG,MAAM,CAAC,aAAa,EAAE,CAAC;QAE1C,IAAI,CAAC,UAAU,EAAE;YACf,OAAO;SACR;QAED,MAAM,EAAE,WAAW,EAAE,WAAW,EAAE,GAAG,MAAM,CAAC,SAAS,CAAC;QACtD,MAAM,aAAa,GAAG,WAAW,IAAI,WAAW,CAAC,OAAO,KAAK,KAAK,CAAC;QACnE,MAAM,aAAa,GAAG,WAAW,IAAI,WAAW,CAAC,OAAO,KAAK,KAAK,CAAC;QACnE,IAAI,CAAC,CAAC,aAAa,IAAI,aAAa,CAAC,EAAE;YACrC,OAAO;SACR;QAED,MAAM,EACJ,IAAI,GAAG,eAAe,CAAC,IAAI,EAC3B,OAAO,GAAG,eAAe,CAAC,OAAO,EACjC,CAAC,EAAE,OAAO,GAAG,eAAe,CAAC,CAAC,EAC9B,CAAC,EAAE,OAAO,GAAG,eAAe,CAAC,CAAC,EAC9B,MAAM,GAAG,eAAe,CAAC,MAAM,EAC/B,MAAM,GAAG,eAAe,CAAC,MAAM,EAChC,GAAG,MAAM,CAAC,SAAS,CAAC;QAErB,MA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","sourcesContent":["import type {\n IGraphicAttribute,\n IContext2d,\n IMarkAttribute,\n ISymbol,\n ISymbolGraphicAttribute,\n IThemeAttribute,\n ISymbolRenderContribution,\n IDrawContext\n} from '../../../../interface';\nimport { getScaledStroke } from '../../../../common/canvas-utils';\nimport { defaultBaseBackgroundRenderContribution } from './base-contribution-render';\nimport { BaseRenderContributionTime } from '../../../../common/enums';\nimport { defaultBaseTextureRenderContribution } from './base-texture-contribution-render';\n\nexport class DefaultSymbolRenderContribution implements ISymbolRenderContribution {\n time: BaseRenderContributionTime = BaseRenderContributionTime.afterFillStroke;\n useStyle: boolean = true;\n order: number = 0;\n drawShape(\n symbol: ISymbol,\n context: IContext2d,\n x: number,\n y: number,\n doFill: boolean,\n doStroke: boolean,\n fVisible: boolean,\n sVisible: boolean,\n symbolAttribute: Required<ISymbolGraphicAttribute>,\n drawContext: IDrawContext,\n fillCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean,\n strokeCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean\n ) {\n const parsedPath = symbol.getParsedPath();\n // todo: 考虑使用path\n if (!parsedPath) {\n return;\n }\n\n const { outerBorder, innerBorder } = symbol.attribute;\n const doOuterBorder = outerBorder && outerBorder.visible !== false;\n const doInnerBorder = innerBorder && innerBorder.visible !== false;\n if (!(doOuterBorder || doInnerBorder)) {\n return;\n }\n\n const {\n size = symbolAttribute.size,\n opacity = symbolAttribute.opacity,\n x: originX = symbolAttribute.x,\n y: originY = symbolAttribute.y,\n scaleX = symbolAttribute.scaleX,\n scaleY = symbolAttribute.scaleY\n } = symbol.attribute;\n\n const doStrokeOuter = !!(outerBorder && outerBorder.stroke);\n const doStrokeInner = !!(innerBorder && innerBorder.stroke);\n\n if (doOuterBorder) {\n const { distance = symbolAttribute.outerBorder.distance } = outerBorder;\n const d = getScaledStroke(context, distance as number, context.dpr);\n\n context.beginPath();\n if (parsedPath.drawOffset(context, size, x, y, d) === false) {\n context.closePath();\n }\n\n // shadow\n context.setShadowBlendStyle && context.setShadowBlendStyle(symbol, symbol.attribute, symbolAttribute);\n\n if (strokeCb) {\n strokeCb(context, outerBorder, symbolAttribute.outerBorder);\n } else if (doStrokeOuter) {\n // 存在stroke\n const lastOpacity = (symbolAttribute.outerBorder as any).opacity;\n (symbolAttribute.outerBorder as any).opacity = opacity;\n context.setStrokeStyle(\n symbol,\n outerBorder,\n (originX - x) / scaleX,\n (originY - y) / scaleY,\n symbolAttribute.outerBorder as any\n );\n (symbolAttribute.outerBorder as any).opacity = lastOpacity;\n context.stroke();\n }\n }\n\n if (doInnerBorder) {\n const { distance = symbolAttribute.innerBorder.distance } = innerBorder;\n const d = getScaledStroke(context, distance as number, context.dpr);\n\n context.beginPath();\n if (parsedPath.drawOffset(context, size, x, y, -d) === false) {\n context.closePath();\n }\n\n // shadow\n context.setShadowBlendStyle && context.setShadowBlendStyle(symbol, symbol.attribute, symbolAttribute);\n\n if (strokeCb) {\n strokeCb(context, innerBorder, symbolAttribute.innerBorder);\n } else if (doStrokeInner) {\n // 存在stroke\n const lastOpacity = (symbolAttribute.innerBorder as any).opacity;\n (symbolAttribute.innerBorder as any).opacity = opacity;\n context.setStrokeStyle(\n symbol,\n innerBorder,\n (originX - x) / scaleX,\n (originY - y) / scaleY,\n symbolAttribute.innerBorder as any\n );\n (symbolAttribute.innerBorder as any).opacity = lastOpacity;\n context.stroke();\n }\n }\n }\n}\n\nexport const defaultSymbolRenderContribution = new DefaultSymbolRenderContribution();\nexport const defaultSymbolTextureRenderContribution = defaultBaseTextureRenderContribution;\nexport const defaultSymbolBackgroundRenderContribution = defaultBaseBackgroundRenderContribution;\n"]}
@@ -7,11 +7,8 @@ Object.defineProperty(exports, "__esModule", {
7
7
  const vutils_1 = require("@visactor/vutils"), enums_1 = require("../../../../common/enums"), base_contribution_render_1 = require("./base-contribution-render"), bounds_allocate_1 = require("../../../../allocator/bounds-allocate"), graphic_1 = require("../../../../graphic"), rect_1 = require("../../../../common/shape/rect");
8
8
 
9
9
  class DefaultTextBackgroundRenderContribution extends base_contribution_render_1.DefaultBaseBackgroundRenderContribution {
10
- constructor() {
11
- super(...arguments), this.time = enums_1.BaseRenderContributionTime.beforeFillStroke;
12
- }
10
+ time=enums_1.BaseRenderContributionTime.beforeFillStroke;
13
11
  drawShape(graphic, context, x, y, doFill, doStroke, fVisible, sVisible, graphicAttribute, drawContext, fillCb, strokeCb) {
14
- var _a, _c, _d, _e, _f, _g, _h, _j, _k, _l;
15
12
  const {backgroundMode: backgroundMode = graphicAttribute.backgroundMode, backgroundFit: backgroundFit = graphicAttribute.backgroundFit} = graphic.attribute;
16
13
  let matrix, {background: background} = graphic.attribute;
17
14
  if (!background) return;
@@ -23,13 +20,14 @@ class DefaultTextBackgroundRenderContribution extends base_contribution_render_1
23
20
  context.save(), context.setTransformForCurrent());
24
21
  const shouldReCalBounds = (0, vutils_1.isObject)(background) && background.background, onlyTranslate = graphic.transMatrix.onlyTranslate();
25
22
  if (shouldReCalBounds) {
26
- const _b = graphic.AABBBounds, x = (null !== (_a = background.x) && void 0 !== _a ? _a : _b.x1) + (null !== (_c = background.dx) && void 0 !== _c ? _c : 0), y = (null !== (_d = background.y) && void 0 !== _d ? _d : _b.y1) + (null !== (_e = background.dy) && void 0 !== _e ? _e : 0), w = null !== (_f = background.width) && void 0 !== _f ? _f : _b.width(), h = null !== (_g = background.height) && void 0 !== _g ? _g : _b.height();
23
+ const _b = graphic.AABBBounds, x = (background.x ?? _b.x1) + (background.dx ?? 0), y = (background.y ?? _b.y1) + (background.dy ?? 0), w = background.width ?? _b.width(), h = background.height ?? _b.height();
27
24
  if (b = bounds_allocate_1.boundsAllocate.allocate(x, y, x + w, y + h), background = background.background,
28
25
  !onlyTranslate) {
29
26
  const w = b.width(), h = b.height();
30
- b.set((null !== (_h = background.x) && void 0 !== _h ? _h : 0) + (null !== (_j = background.dx) && void 0 !== _j ? _j : 0), (null !== (_k = background.y) && void 0 !== _k ? _k : 0) + (null !== (_l = background.dy) && void 0 !== _l ? _l : 0), w, h);
27
+ b.set((background.x ?? 0) + (background.dx ?? 0), (background.y ?? 0) + (background.dy ?? 0), w, h);
31
28
  }
32
- } else b = graphic.AABBBounds, onlyTranslate || (b = (0, graphic_1.getTextBounds)(Object.assign(Object.assign({}, graphic.attribute), {
29
+ } else b = graphic.AABBBounds, onlyTranslate || (b = (0, graphic_1.getTextBounds)({
30
+ ...graphic.attribute,
33
31
  angle: 0,
34
32
  scaleX: 1,
35
33
  scaleY: 1,
@@ -37,7 +35,7 @@ class DefaultTextBackgroundRenderContribution extends base_contribution_render_1
37
35
  y: 0,
38
36
  dx: 0,
39
37
  dy: 0
40
- })).clone());
38
+ }).clone());
41
39
  if (graphic.backgroundImg && graphic.resources) {
42
40
  const res = graphic.resources.get(background);
43
41
  if ("success" !== res.state || !res.data) return void restore();
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/render/contributions/render/contributions/text-contribution-render.ts"],"names":[],"mappings":";;;AACA,6CAA4C;AAC5C,oDAAsE;AAStE,yEAAqF;AACrF,2EAAuE;AACvE,iDAAoD;AACpD,wDAA+D;AAE/D,MAAa,uCACX,SAAQ,kEAAuC;IADjD;;QAIE,SAAI,GAA+B,kCAA0B,CAAC,gBAAgB,CAAC;IA4GjF,CAAC;IA1GC,SAAS,CACP,OAAc,EACd,OAAmB,EACnB,CAAS,EACT,CAAS,EACT,MAAe,EACf,QAAiB,EACjB,QAAiB,EACjB,QAAiB,EACjB,gBAA6C,EAC7C,WAAyB,EACzB,MAAiH,EACjH,QAAmH;;QAEnH,MAAM,EAAE,cAAc,GAAG,gBAAgB,CAAC,cAAc,EAAE,aAAa,GAAG,gBAAgB,CAAC,aAAa,EAAE,GACxG,OAAO,CAAC,SAAS,CAAC;QACpB,IAAI,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC,SAAS,CAAC;QACv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AE,CAAC,CAAC;aACrD;YACD,OAAO,CAAC,sBAAsB,EAAE,CAAC;SAClC;QAED,IAAI,iBAAiB,EAAE;YACrB,gCAAc,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;SACxB;QACD,OAAO,EAAE,CAAC;IACZ,CAAC;CACF;AAhHD,0FAgHC;AAEY,QAAA,uCAAuC,GAAG,IAAI,uCAAuC,EAAE,CAAC","file":"text-contribution-render.js","sourcesContent":["import type { IAABBBounds, IMatrix, IMatrixLike } from '@visactor/vutils';\nimport { isObject } from '@visactor/vutils';\nimport { BaseRenderContributionTime } from '../../../../common/enums';\nimport type {\n IContext2d,\n IDrawContext,\n IGraphicAttribute,\n IText,\n ITextRenderContribution,\n IThemeAttribute\n} from '../../../../interface';\nimport { DefaultBaseBackgroundRenderContribution } from './base-contribution-render';\nimport { boundsAllocate } from '../../../../allocator/bounds-allocate';\nimport { getTextBounds } from '../../../../graphic';\nimport { createRectPath } from '../../../../common/shape/rect';\n\nexport class DefaultTextBackgroundRenderContribution\n extends DefaultBaseBackgroundRenderContribution\n implements ITextRenderContribution\n{\n time: BaseRenderContributionTime = BaseRenderContributionTime.beforeFillStroke;\n\n drawShape(\n graphic: IText,\n context: IContext2d,\n x: number,\n y: number,\n doFill: boolean,\n doStroke: boolean,\n fVisible: boolean,\n sVisible: boolean,\n graphicAttribute: Required<IGraphicAttribute>,\n drawContext: IDrawContext,\n fillCb?: (ctx: IContext2d, markAttribute: Partial<IGraphicAttribute>, themeAttribute: IThemeAttribute) => boolean,\n strokeCb?: (ctx: IContext2d, markAttribute: Partial<IGraphicAttribute>, themeAttribute: IThemeAttribute) => boolean\n ) {\n const { backgroundMode = graphicAttribute.backgroundMode, backgroundFit = graphicAttribute.backgroundFit } =\n graphic.attribute;\n let { background } = graphic.attribute;\n if (!background) {\n return;\n }\n let matrix: IMatrix;\n const save = () => {\n if (graphic.type === 'richtext') {\n matrix = context.currentMatrix.clone();\n context.restore();\n context.save();\n context.setTransformForCurrent();\n }\n };\n const restore = () => {\n if (graphic.type === 'richtext') {\n context.restore();\n context.save();\n matrix && context.setTransformFromMatrix(matrix, true, 1);\n }\n };\n save();\n let b: IAABBBounds;\n const shouldReCalBounds = isObject(background) && (background as any).background;\n const onlyTranslate = graphic.transMatrix.onlyTranslate();\n if (shouldReCalBounds) {\n const _b = graphic.AABBBounds;\n const x = ((background as any).x ?? _b.x1) + ((background as any).dx ?? 0);\n const y = ((background as any).y ?? _b.y1) + ((background as any).dy ?? 0);\n const w = (background as any).width ?? _b.width();\n const h = (background as any).height ?? _b.height();\n b = boundsAllocate.allocate(x, y, x + w, y + h);\n background = (background as any).background;\n if (!onlyTranslate) {\n const w = b.width();\n const h = b.height();\n b.set(\n ((background as any).x ?? 0) + ((background as any).dx ?? 0),\n ((background as any).y ?? 0) + ((background as any).dy ?? 0),\n w,\n h\n );\n }\n } else {\n b = graphic.AABBBounds;\n if (!onlyTranslate) {\n b = getTextBounds({ ...graphic.attribute, angle: 0, scaleX: 1, scaleY: 1, x: 0, y: 0, dx: 0, dy: 0 }).clone();\n }\n }\n\n if (graphic.backgroundImg && graphic.resources) {\n const res = graphic.resources.get(background as any);\n if (res.state !== 'success' || !res.data) {\n restore();\n return;\n }\n\n context.highPerformanceSave();\n // 默认应用旋转\n if (!onlyTranslate) {\n // TODO 性能优化\n // const _b = getTextBounds({ ...graphic.attribute, angle: 0, scaleX: 1, scaleY: 1, x: 0, y: 0, dx: 0, dy: 0 });\n // b.copy(_b);\n } else {\n context.setTransformFromMatrix(graphic.parent.globalTransMatrix, true);\n }\n\n context.setCommonStyle(graphic, graphic.attribute, x, y, graphicAttribute);\n this.doDrawImage(context, res.data, b, backgroundMode, backgroundFit);\n context.highPerformanceRestore();\n context.setTransformForCurrent();\n } else {\n const { backgroundCornerRadius } = graphic.attribute;\n context.highPerformanceSave();\n context.setCommonStyle(graphic, graphic.attribute, x, y, graphicAttribute);\n context.fillStyle = background as string;\n if (backgroundCornerRadius) {\n // 测试后,cache对于重绘性能提升不大,但是在首屏有一定性能损耗,因此rect不再使用cache\n createRectPath(context, b.x1, b.y1, b.width(), b.height(), backgroundCornerRadius);\n context.fill();\n } else {\n context.fillRect(b.x1, b.y1, b.width(), b.height());\n }\n context.highPerformanceRestore();\n }\n\n if (shouldReCalBounds) {\n boundsAllocate.free(b);\n }\n restore();\n }\n}\n\nexport const defaultTextBackgroundRenderContribution = new DefaultTextBackgroundRenderContribution();\n\n// @injectable()\n// export class DefaultTextPopTipRenderContribution\n// extends DefaultBasePopTipRenderContribution\n// implements ITextRenderContribution\n// {\n// time: BaseRenderContributionTime = BaseRenderContributionTime.afterFillStroke;\n// }\n"]}
1
+ {"version":3,"sources":["../src/render/contributions/render/contributions/text-contribution-render.ts"],"names":[],"mappings":";;;AACA,6CAA4C;AAC5C,oDAAsE;AAStE,yEAAqF;AACrF,2EAAuE;AACvE,iDAAoD;AACpD,wDAA+D;AAE/D,MAAa,uCACX,SAAQ,kEAAuC;IAG/C,IAAI,GAA+B,kCAA0B,CAAC,gBAAgB,CAAC;IAE/E,SAAS,CACP,OAAc,EACd,OAAmB,EACnB,CAAS,EACT,CAAS,EACT,MAAe,EACf,QAAiB,EACjB,QAAiB,EACjB,QAAiB,EACjB,gBAA6C,EAC7C,WAAyB,EACzB,MAAiH,EACjH,QAAmH;QAEnH,MAAM,EAAE,cAAc,GAAG,gBAAgB,CAAC,cAAc,EAAE,aAAa,GAAG,gBAAgB,CAAC,aAAa,EAAE,GACxG,OAAO,CAAC,SAAS,CAAC;QACpB,IAAI,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC,SAAS,CAAC;QACvC,IAAI,CAAC,UAAU,EAAE;YACf,OAAO;SACR;QACD,IAAI,MAAe,CAAC;QACpB,MAAM,IAAI,GAAG,GAAG,EAAE;YAChB,IAAI,OAAO,CAAC,IAAI,KAAK,UAAU,EAAE;gBAC/B,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,KAAK,EAAE,CAAC;gBACvC,OAAO,CAAC,OAAO,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IMatrix, IMatrixLike } from '@visactor/vutils';\nimport { isObject } from '@visactor/vutils';\nimport { BaseRenderContributionTime } from '../../../../common/enums';\nimport type {\n IContext2d,\n IDrawContext,\n IGraphicAttribute,\n IText,\n ITextRenderContribution,\n IThemeAttribute\n} from '../../../../interface';\nimport { DefaultBaseBackgroundRenderContribution } from './base-contribution-render';\nimport { boundsAllocate } from '../../../../allocator/bounds-allocate';\nimport { getTextBounds } from '../../../../graphic';\nimport { createRectPath } from '../../../../common/shape/rect';\n\nexport class DefaultTextBackgroundRenderContribution\n extends DefaultBaseBackgroundRenderContribution\n implements ITextRenderContribution\n{\n time: BaseRenderContributionTime = BaseRenderContributionTime.beforeFillStroke;\n\n drawShape(\n graphic: IText,\n context: IContext2d,\n x: number,\n y: number,\n doFill: boolean,\n doStroke: boolean,\n fVisible: boolean,\n sVisible: boolean,\n graphicAttribute: Required<IGraphicAttribute>,\n drawContext: IDrawContext,\n fillCb?: (ctx: IContext2d, markAttribute: Partial<IGraphicAttribute>, themeAttribute: IThemeAttribute) => boolean,\n strokeCb?: (ctx: IContext2d, markAttribute: Partial<IGraphicAttribute>, themeAttribute: IThemeAttribute) => boolean\n ) {\n const { backgroundMode = graphicAttribute.backgroundMode, backgroundFit = graphicAttribute.backgroundFit } =\n graphic.attribute;\n let { background } = graphic.attribute;\n if (!background) {\n return;\n }\n let matrix: IMatrix;\n const save = () => {\n if (graphic.type === 'richtext') {\n matrix = context.currentMatrix.clone();\n context.restore();\n context.save();\n context.setTransformForCurrent();\n }\n };\n const restore = () => {\n if (graphic.type === 'richtext') {\n context.restore();\n context.save();\n matrix && context.setTransformFromMatrix(matrix, true, 1);\n }\n };\n save();\n let b: IAABBBounds;\n const shouldReCalBounds = isObject(background) && (background as any).background;\n const onlyTranslate = graphic.transMatrix.onlyTranslate();\n if (shouldReCalBounds) {\n const _b = graphic.AABBBounds;\n const x = ((background as any).x ?? _b.x1) + ((background as any).dx ?? 0);\n const y = ((background as any).y ?? _b.y1) + ((background as any).dy ?? 0);\n const w = (background as any).width ?? _b.width();\n const h = (background as any).height ?? _b.height();\n b = boundsAllocate.allocate(x, y, x + w, y + h);\n background = (background as any).background;\n if (!onlyTranslate) {\n const w = b.width();\n const h = b.height();\n b.set(\n ((background as any).x ?? 0) + ((background as any).dx ?? 0),\n ((background as any).y ?? 0) + ((background as any).dy ?? 0),\n w,\n h\n );\n }\n } else {\n b = graphic.AABBBounds;\n if (!onlyTranslate) {\n b = getTextBounds({ ...graphic.attribute, angle: 0, scaleX: 1, scaleY: 1, x: 0, y: 0, dx: 0, dy: 0 }).clone();\n }\n }\n\n if (graphic.backgroundImg && graphic.resources) {\n const res = graphic.resources.get(background as any);\n if (res.state !== 'success' || !res.data) {\n restore();\n return;\n }\n\n context.highPerformanceSave();\n // 默认应用旋转\n if (!onlyTranslate) {\n // TODO 性能优化\n // const _b = getTextBounds({ ...graphic.attribute, angle: 0, scaleX: 1, scaleY: 1, x: 0, y: 0, dx: 0, dy: 0 });\n // b.copy(_b);\n } else {\n context.setTransformFromMatrix(graphic.parent.globalTransMatrix, true);\n }\n\n context.setCommonStyle(graphic, graphic.attribute, x, y, graphicAttribute);\n this.doDrawImage(context, res.data, b, backgroundMode, backgroundFit);\n context.highPerformanceRestore();\n context.setTransformForCurrent();\n } else {\n const { backgroundCornerRadius } = graphic.attribute;\n context.highPerformanceSave();\n context.setCommonStyle(graphic, graphic.attribute, x, y, graphicAttribute);\n context.fillStyle = background as string;\n if (backgroundCornerRadius) {\n // 测试后,cache对于重绘性能提升不大,但是在首屏有一定性能损耗,因此rect不再使用cache\n createRectPath(context, b.x1, b.y1, b.width(), b.height(), backgroundCornerRadius);\n context.fill();\n } else {\n context.fillRect(b.x1, b.y1, b.width(), b.height());\n }\n context.highPerformanceRestore();\n }\n\n if (shouldReCalBounds) {\n boundsAllocate.free(b);\n }\n restore();\n }\n}\n\nexport const defaultTextBackgroundRenderContribution = new DefaultTextBackgroundRenderContribution();\n\n// @injectable()\n// export class DefaultTextPopTipRenderContribution\n// extends DefaultBasePopTipRenderContribution\n// implements ITextRenderContribution\n// {\n// time: BaseRenderContributionTime = BaseRenderContributionTime.afterFillStroke;\n// }\n"]}
@@ -19,6 +19,8 @@ Object.defineProperty(exports, "__esModule", {
19
19
  const inversify_lite_1 = require("../../../common/inversify-lite"), sort_1 = require("../../../common/sort"), contribution_provider_1 = require("../../../common/contribution-provider"), graphic_1 = require("../../../graphic"), vutils_1 = require("@visactor/vutils"), container_1 = require("../../../container"), symbol_1 = require("./symbol"), draw_interceptor_1 = require("./draw-interceptor"), canvas_utils_1 = require("../../../common/canvas-utils"), bounds_allocate_1 = require("../../../allocator/bounds-allocate"), matrix_allocate_1 = require("../../../allocator/matrix-allocate"), application_1 = require("../../../application");
20
20
 
21
21
  let DefaultDrawContribution = class {
22
+ contributions;
23
+ drawItemInterceptorContributions;
22
24
  constructor(contributions, drawItemInterceptorContributions) {
23
25
  this.contributions = contributions, this.drawItemInterceptorContributions = drawItemInterceptorContributions,
24
26
  this.currentRenderMap = new Map, this.defaultRenderMap = new Map, this.styleRenderMap = new Map,
@@ -58,10 +60,7 @@ let DefaultDrawContribution = class {
58
60
  context.beginPath(), context.rect(dirtyBounds.x1, dirtyBounds.y1, dirtyBounds.width(), dirtyBounds.height()),
59
61
  context.clip(), stage.camera && (this.dirtyBounds.setValue(-1 / 0, -1 / 0, 1 / 0, 1 / 0),
60
62
  this.backupDirtyBounds.setValue(-1 / 0, -1 / 0, 1 / 0, 1 / 0)), this.clearScreen(renderService, context, drawContext),
61
- context.save(), renderService.renderTreeRoots.sort(((a, b) => {
62
- var _a, _b;
63
- return (null !== (_a = a.attribute.zIndex) && void 0 !== _a ? _a : graphic_1.DefaultAttribute.zIndex) - (null !== (_b = b.attribute.zIndex) && void 0 !== _b ? _b : graphic_1.DefaultAttribute.zIndex);
64
- })).forEach((group => {
63
+ context.save(), renderService.renderTreeRoots.sort(((a, b) => (a.attribute.zIndex ?? graphic_1.DefaultAttribute.zIndex) - (b.attribute.zIndex ?? graphic_1.DefaultAttribute.zIndex))).forEach((group => {
65
64
  group.isContainer ? this.renderGroup(group, drawContext, matrix_allocate_1.matrixAllocate.allocate(1, 0, 0, 1, 0, 0)) : this.renderItem(group, drawContext);
66
65
  })), context.restore(), context.setClearMatrix(1, 0, 0, 1, 0, 0), context.inuse = !1,
67
66
  context.draw();
@@ -92,12 +91,11 @@ let DefaultDrawContribution = class {
92
91
  }
93
92
  this.renderItem(group, drawContext, {
94
93
  drawingCb: () => {
95
- var _a;
96
94
  skipSort ? group.forEachChildren((item => {
97
95
  drawContext.break || (item.isContainer ? this.renderGroup(item, drawContext, nextM) : this.renderItem(item, drawContext));
98
96
  })) : (0, sort_1.foreach)(group, graphic_1.DefaultAttribute.zIndex, (item => {
99
97
  drawContext.break || (item.isContainer ? this.renderGroup(item, drawContext, nextM) : this.renderItem(item, drawContext));
100
- }), !1, !!(null === (_a = drawContext.context) || void 0 === _a ? void 0 : _a.camera));
98
+ }), !1, !!drawContext.context?.camera);
101
99
  }
102
100
  }), this.useDirtyBounds && (this.dirtyBounds.copy(tempBounds), bounds_allocate_1.boundsAllocate.free(tempBounds),
103
101
  matrix_allocate_1.matrixAllocate.free(nextM));
@@ -112,14 +110,15 @@ let DefaultDrawContribution = class {
112
110
  }, subLayers.set(group._uid, incrementalLayer));
113
111
  const incrementalContext = incrementalLayer.layer.getNativeHandler().getContext(), idc = incrementalLayer.drawContribution || container_1.container.get(symbol_1.IncrementalDrawContribution);
114
112
  idc.dirtyBounds.setValue(-1 / 0, -1 / 0, 1 / 0, 1 / 0), idc.backupDirtyBounds.setValue(-1 / 0, -1 / 0, 1 / 0, 1 / 0),
115
- idc.draw(this.currentRenderService, Object.assign(Object.assign({}, drawContext), {
113
+ idc.draw(this.currentRenderService, {
114
+ ...drawContext,
116
115
  drawContribution: idc,
117
116
  clear: "transparent",
118
117
  layer: incrementalLayer.layer,
119
118
  context: incrementalContext,
120
119
  startAtId: group._uid,
121
120
  break: !1
122
- })), incrementalLayer.drawContribution = idc;
121
+ }), incrementalLayer.drawContribution = idc;
123
122
  const nextGraphic = this._findNextGraphic(group);
124
123
  if (nextGraphic) if (nextGraphic.isContainer && nextGraphic.incremental) this._increaseRender(nextGraphic, drawContext); else {
125
124
  let afterLayer = subLayers.get(nextGraphic._uid);
@@ -128,14 +127,15 @@ let DefaultDrawContribution = class {
128
127
  zIndex: subLayers.size
129
128
  }, subLayers.set(nextGraphic._uid, afterLayer));
130
129
  const afterContext = afterLayer.layer.getNativeHandler().getContext();
131
- this.draw(this.currentRenderService, Object.assign(Object.assign({}, drawContext), {
130
+ this.draw(this.currentRenderService, {
131
+ ...drawContext,
132
132
  drawContribution: idc,
133
133
  clear: "transparent",
134
134
  layer: afterLayer.layer,
135
135
  context: afterContext,
136
136
  startAtId: nextGraphic._uid,
137
137
  break: !1
138
- }));
138
+ });
139
139
  }
140
140
  }
141
141
  getRenderContribution(graphic) {
@@ -180,13 +180,11 @@ let DefaultDrawContribution = class {
180
180
  return data || this.currentRenderMap.get(type) || this.defaultRenderMap.get(type);
181
181
  }
182
182
  clearScreen(renderService, context, drawContext) {
183
- var _a, _b;
184
183
  const {clear: clear, viewBox: viewBox} = drawContext, width = viewBox.width(), height = viewBox.height();
185
184
  if (clear) {
186
185
  context.clearRect(0, 0, width, height);
187
- const stage = null === (_a = renderService.drawParams) || void 0 === _a ? void 0 : _a.stage;
188
- if (stage && (context.globalAlpha = null !== (_b = stage.attribute.opacity) && void 0 !== _b ? _b : 1),
189
- stage && stage.backgroundImg && stage.resources) {
186
+ const stage = renderService.drawParams?.stage;
187
+ if (stage && (context.globalAlpha = stage.attribute.opacity ?? 1), stage && stage.backgroundImg && stage.resources) {
190
188
  const res = stage.resources.get(clear);
191
189
  res && "success" === res.state && res.data && context.drawImage(res.data, 0, 0, width, height);
192
190
  } else context.fillStyle = (0, canvas_utils_1.createColor)(context, clear, {
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/render/contributions/render/draw-contribution.ts"],"names":[],"m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AE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,GAAG,KAAK,EAAE,EAAE,EAAE,CAAC,GAAG,MAAM,EAAE;iBAC5D,EACD,CAAC,EACD,CAAC,CACF,CAAC;gBACF,OAAO,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;aACvC;SACF;IACH,CAAC;IAED,SAAS,CAAC,aAA6B,EAAE,UAAwB;QAC/D,OAAO;IACT,CAAC;CACF,CAAA;AAzZY,uBAAuB;IADnC,IAAA,2BAAU,GAAE;IAmBR,WAAA,IAAA,4BAAW,EAAC,sBAAa,CAAC,CAAA;IAG1B,WAAA,IAAA,uBAAM,EAAC,4CAAoB,CAAC,CAAA;IAC5B,WAAA,IAAA,sBAAK,EAAC,sCAAmB,CAAC,CAAA;;GAtBlB,uBAAuB,CAyZnC;AAzZY,0DAAuB","file":"draw-contribution.js","sourcesContent":["import { injectable, inject, named, multiInject } from '../../../common/inversify-lite';\nimport type {\n IContext2d,\n MaybePromise,\n IGraphic,\n IGroup,\n IDrawContext,\n IRenderService,\n IGraphicRender,\n IGraphicRenderDrawParams,\n IContributionProvider,\n IDrawItemInterceptorContribution,\n IDrawContribution,\n IRenderSelector,\n IGlobal\n} from '../../../interface';\nimport { findNextGraphic, foreach } from '../../../common/sort';\n// eslint-disable-next-line @typescript-eslint/consistent-type-imports\nimport { ContributionProvider } from '../../../common/contribution-provider';\nimport { DefaultAttribute } from '../../../graphic';\nimport type { IAABBBounds, IBounds, IBoundsLike, IMatrix, IMatrixLike } from '@visactor/vutils';\nimport { Bounds, Logger, getRectIntersect, isRectIntersect, last } from '@visactor/vutils';\nimport { LayerService } from '../../../core/constants';\nimport { container } from '../../../container';\nimport { GraphicRender, IncrementalDrawContribution, RenderSelector } from './symbol';\nimport { DrawItemInterceptor } from './draw-interceptor';\nimport { createColor } from '../../../common/canvas-utils';\nimport type { ILayerService } from '../../../interface/core';\nimport { boundsAllocate } from '../../../allocator/bounds-allocate';\nimport { matrixAllocate } from '../../../allocator/matrix-allocate';\nimport { application } from '../../../application';\n\n/**\n * 默认的渲染contribution,基于树状结构针对图元的渲染\n */\n@injectable()\nexport class DefaultDrawContribution implements IDrawContribution {\n declare currentRenderMap: Map<number, IGraphicRender>;\n declare defaultRenderMap: Map<number, IGraphicRender>;\n declare styleRenderMap: Map<string, Map<number, IGraphicRender>>;\n declare dirtyBounds: IBounds;\n declare backupDirtyBounds: IBounds;\n // 是否使用dirtyBounds\n declare useDirtyBounds: boolean;\n declare currentRenderService: IRenderService;\n declare InterceptorContributions: IDrawItemInterceptorContribution[];\n\n declare global: IGlobal;\n declare layerService: ILayerService;\n\n constructor(\n // @inject(ContributionProvider)\n // @named(GraphicRender)\n // protected readonly contributions: ContributionProvider<IGraphicRender>,\n @multiInject(GraphicRender) protected readonly contributions: IGraphicRender[],\n // @inject(RenderSelector) protected readonly renderSelector: IRenderSelector, // 根据图元类型选择对应的renderItem进行渲染\n // 拦截器\n @inject(ContributionProvider)\n @named(DrawItemInterceptor)\n protected readonly drawItemInterceptorContributions: IContributionProvider<IDrawItemInterceptorContribution>\n ) {\n this.currentRenderMap = new Map();\n this.defaultRenderMap = new Map();\n this.styleRenderMap = new Map();\n this.dirtyBounds = new Bounds();\n this.backupDirtyBounds = new Bounds();\n this.global = application.global;\n this.layerService = application.layerService;\n this.init();\n }\n\n init() {\n this.contributions.forEach(item => {\n if (item.style) {\n const map = this.styleRenderMap.get(item.style) || new Map();\n map.set(item.numberType, item);\n this.styleRenderMap.set(item.style, map);\n } else {\n this.defaultRenderMap.set(item.numberType, item);\n }\n });\n this.InterceptorContributions = this.drawItemInterceptorContributions\n .getContributions()\n .sort((a, b) => a.order - b.order);\n }\n\n prepareForDraw(renderService: IRenderService, drawContext: IDrawContext) {\n // 有dirtyBounds用dirtyBounds\n if (drawContext.updateBounds) {\n this.useDirtyBounds = true;\n } else {\n // 没有的话,看看是否需要跳过outRange的渲染\n this.useDirtyBounds = !drawContext.stage.params.optimize.disableCheckGraphicWidthOutRange;\n }\n }\n\n draw(renderService: IRenderService, drawContext: IDrawContext): MaybePromise<void> {\n this.prepareForDraw(renderService, drawContext);\n drawContext.drawContribution = this;\n this.currentRenderMap = this.styleRenderMap.get(drawContext.renderStyle) || this.defaultRenderMap;\n // this.startAtId = drawParams.startAtId;\n this.currentRenderService = renderService;\n // this.drawParams = drawParams;\n const { context, stage, viewBox, transMatrix } = drawContext;\n\n if (!context) {\n return;\n }\n // if (context.drawPromise) {\n // return;\n // }\n const dirtyBounds: IBounds | undefined = this.dirtyBounds.setValue(0, 0, viewBox.width(), viewBox.height());\n if (stage.dirtyBounds && !stage.dirtyBounds.empty()) {\n const b = getRectIntersect(dirtyBounds, stage.dirtyBounds, false);\n dirtyBounds.x1 = Math.floor(b.x1);\n dirtyBounds.y1 = Math.floor(b.y1);\n dirtyBounds.x2 = Math.ceil(b.x2);\n dirtyBounds.y2 = Math.ceil(b.y2);\n }\n // 如果dpr不是整数或者.5的小数,需要格式化dirtyBounds\n const d = context.dpr % 1;\n if (d || d !== 0.5) {\n dirtyBounds.x1 = Math.floor(dirtyBounds.x1 * context.dpr) / context.dpr;\n dirtyBounds.y1 = Math.floor(dirtyBounds.y1 * context.dpr) / context.dpr;\n dirtyBounds.x2 = Math.ceil(dirtyBounds.x2 * context.dpr) / context.dpr;\n dirtyBounds.y2 = Math.ceil(dirtyBounds.y2 * context.dpr) / context.dpr;\n }\n this.backupDirtyBounds.copy(dirtyBounds);\n context.inuse = true;\n context.setClearMatrix(transMatrix.a, transMatrix.b, transMatrix.c, transMatrix.d, transMatrix.e, transMatrix.f);\n // 初始化context\n context.clearMatrix();\n context.setTransformForCurrent(true);\n\n // const drawInArea =\n // dirtyBounds.width() * context.dpr < context.canvas.width ||\n // dirtyBounds.height() * context.dpr < context.canvas.height;\n // context.save();\n\n // 设置translate\n context.translate(viewBox.x1, viewBox.y1, true);\n context.beginPath();\n context.rect(dirtyBounds.x1, dirtyBounds.y1, dirtyBounds.width(), dirtyBounds.height());\n context.clip();\n\n // 如果存在3d视角,那么不使用dirtyBounds\n if (stage.camera) {\n this.dirtyBounds.setValue(-Infinity, -Infinity, Infinity, Infinity);\n this.backupDirtyBounds.setValue(-Infinity, -Infinity, Infinity, Infinity);\n }\n\n this.clearScreen(renderService, context, drawContext);\n // // 渲染的时候图元的起始位置就是x,y\n // this.backupDirtyBounds.translate(-x, -y);\n // this.dirtyBounds.translate(-x, -y);\n\n // // 设置translate\n // context.translate(x, y, true);\n\n context.save();\n renderService.renderTreeRoots\n .sort((a, b) => {\n return (a.attribute.zIndex ?? DefaultAttribute.zIndex) - (b.attribute.zIndex ?? DefaultAttribute.zIndex);\n })\n .forEach(group => {\n group.isContainer\n ? this.renderGroup(group as IGroup, drawContext, matrixAllocate.allocate(1, 0, 0, 1, 0, 0))\n : this.renderItem(group as IGraphic, drawContext);\n });\n\n // context.restore();\n context.restore();\n context.setClearMatrix(1, 0, 0, 1, 0, 0);\n // this.break = false;\n context.inuse = false;\n context.draw();\n }\n\n doRegister() {\n throw new Error('暂不支持');\n }\n\n // 找到下一个graphic\n protected _findNextGraphic(group: IGroup): IGraphic | null {\n let parent = group.parent;\n let id = group._uid;\n while (parent) {\n const g = findNextGraphic(parent, id, DefaultAttribute.zIndex);\n if (g) {\n return g;\n }\n id = parent._uid;\n parent = parent.parent;\n }\n return null;\n }\n\n renderGroup(group: IGroup, drawContext: IDrawContext, parentMatrix: IMatrix, skipSort?: boolean) {\n if (drawContext.break || group.attribute.visibleAll === false) {\n return;\n }\n if (group.incremental && (drawContext.startAtId == null || drawContext.startAtId === group._uid)) {\n drawContext.break = true;\n this._increaseRender(group, drawContext);\n return;\n }\n\n if (this.useDirtyBounds && !isRectIntersect(group.AABBBounds, this.dirtyBounds, false)) {\n return;\n }\n\n let nextM: IMatrix = parentMatrix;\n let tempBounds: IBounds;\n\n if (this.useDirtyBounds) {\n tempBounds = boundsAllocate.allocateByObj(this.dirtyBounds);\n // 变换dirtyBounds\n const gm = group.transMatrix;\n nextM = matrixAllocate.allocateByObj(parentMatrix).multiply(gm.a, gm.b, gm.c, gm.d, gm.e, gm.f);\n // const m = group.globalTransMatrix.getInverse();\n this.dirtyBounds.copy(this.backupDirtyBounds).transformWithMatrix(nextM.getInverse());\n }\n\n this.renderItem(group, drawContext, {\n drawingCb: () => {\n skipSort\n ? group.forEachChildren((item: IGraphic) => {\n if (drawContext.break) {\n return;\n }\n if (item.isContainer) {\n this.renderGroup(item as IGroup, drawContext, nextM);\n } else {\n this.renderItem(item, drawContext);\n }\n })\n : foreach(\n group,\n DefaultAttribute.zIndex,\n (item: IGraphic) => {\n if (drawContext.break) {\n return;\n }\n if (item.isContainer) {\n this.renderGroup(item as IGroup, drawContext, nextM);\n } else {\n this.renderItem(item, drawContext);\n }\n },\n false,\n !!drawContext.context?.camera\n );\n }\n });\n\n if (this.useDirtyBounds) {\n this.dirtyBounds.copy(tempBounds);\n boundsAllocate.free(tempBounds);\n matrixAllocate.free(nextM);\n }\n }\n\n protected _increaseRender(group: IGroup, drawContext: IDrawContext) {\n const { layer, stage } = drawContext;\n const { subLayers } = layer;\n // 获取渐进渲染层\n let incrementalLayer = subLayers.get(group._uid);\n if (!incrementalLayer) {\n incrementalLayer = {\n layer: this.layerService.createLayer(stage),\n zIndex: subLayers.size,\n group\n };\n subLayers.set(group._uid, incrementalLayer);\n }\n // 渲染\n const incrementalContext = incrementalLayer.layer.getNativeHandler().getContext();\n const idc = incrementalLayer.drawContribution || container.get(IncrementalDrawContribution);\n idc.dirtyBounds.setValue(-Infinity, -Infinity, Infinity, Infinity);\n idc.backupDirtyBounds.setValue(-Infinity, -Infinity, Infinity, Infinity);\n (idc as any).draw(this.currentRenderService, {\n ...drawContext,\n drawContribution: idc,\n clear: 'transparent',\n layer: incrementalLayer.layer,\n context: incrementalContext,\n startAtId: group._uid,\n break: false\n });\n incrementalLayer.drawContribution = idc;\n // this.draw(this.currentRenderService, {...this.drawParams, startAtId: group._uid})\n // this.draw(this.currentRenderService, {...this.drawParams, clear: 'transparent', layer: incrementalContext.layer, context: incrementalContext, startAtId: group._uid})\n const nextGraphic = this._findNextGraphic(group);\n if (nextGraphic) {\n // 如果是下一个渐进渲染层,那就再来一次\n if (nextGraphic.isContainer && nextGraphic.incremental) {\n this._increaseRender(nextGraphic as IGroup, drawContext);\n } else {\n // 如果不是渐进渲染层,那就默认图层渲染\n let afterLayer = subLayers.get(nextGraphic._uid);\n if (!afterLayer) {\n afterLayer = {\n layer: this.layerService.createLayer(stage),\n zIndex: subLayers.size\n };\n subLayers.set(nextGraphic._uid, afterLayer);\n }\n const afterContext = afterLayer.layer.getNativeHandler().getContext();\n this.draw(this.currentRenderService, {\n ...drawContext,\n drawContribution: idc,\n clear: 'transparent',\n layer: afterLayer.layer,\n context: afterContext,\n startAtId: nextGraphic._uid,\n break: false\n });\n }\n }\n }\n\n getRenderContribution(graphic: IGraphic): IGraphicRender | null {\n let renderer;\n if (!renderer) {\n renderer = this.selectRenderByNumberType(graphic.numberType, graphic);\n }\n if (!renderer) {\n renderer = this.selectRenderByType(graphic.type);\n }\n return renderer;\n }\n\n renderItem(graphic: IGraphic, drawContext: IDrawContext, params?: IGraphicRenderDrawParams) {\n // 添加拦截器\n if (this.InterceptorContributions.length) {\n for (let i = 0; i < this.InterceptorContributions.length; i++) {\n const drawContribution = this.InterceptorContributions[i];\n if (\n drawContribution.beforeDrawItem &&\n drawContribution.beforeDrawItem(graphic, this.currentRenderService, drawContext, this, params)\n ) {\n return;\n }\n }\n }\n\n const renderer = this.getRenderContribution(graphic);\n if (!renderer) {\n return;\n }\n\n let retrans: boolean = false;\n let tempBounds: IAABBBounds;\n\n if (graphic.parent) {\n const { scrollX = 0, scrollY = 0 } = graphic.parent.attribute;\n retrans = !!(scrollX || scrollY);\n if (retrans) {\n tempBounds = this.dirtyBounds.clone();\n // 变换dirtyBounds\n const m = graphic.globalTransMatrix.getInverse();\n this.dirtyBounds.copy(this.backupDirtyBounds).transformWithMatrix(m);\n this.dirtyBounds.translate(-scrollX, -scrollY);\n }\n }\n\n if (this.useDirtyBounds && !(graphic.isContainer || isRectIntersect(graphic.AABBBounds, this.dirtyBounds, false))) {\n retrans && this.dirtyBounds.copy(tempBounds);\n return;\n }\n\n const skipDraw = drawContext.startAtId != null && graphic._uid !== drawContext.startAtId;\n if (graphic._uid === drawContext.startAtId) {\n drawContext.startAtId = null;\n }\n params && (params.skipDraw = skipDraw);\n if (skipDraw) {\n graphic.isContainer && renderer.draw(graphic, this.currentRenderService, drawContext, params);\n } else {\n renderer.draw(graphic, this.currentRenderService, drawContext, params);\n }\n\n retrans && this.dirtyBounds.copy(tempBounds);\n\n // 添加拦截器\n if (this.InterceptorContributions.length) {\n for (let i = 0; i < this.InterceptorContributions.length; i++) {\n const drawContribution = this.InterceptorContributions[i];\n if (drawContribution.afterDrawItem) {\n if (drawContribution.afterDrawItem(graphic, this.currentRenderService, drawContext, this)) {\n return;\n }\n }\n }\n }\n }\n // 根据type选择对应的render\n protected selectRenderByType(type?: string): IGraphicRender | null {\n Logger.getInstance().warn('未知错误,不应该走到这里');\n return null;\n }\n // 根据type选择对应的render\n protected selectRenderByNumberType(type: number, graphic: IGraphic): IGraphicRender | null {\n let data;\n if (graphic.attribute.renderStyle) {\n const currentRenderMap = this.styleRenderMap.get(graphic.attribute.renderStyle);\n data = currentRenderMap && currentRenderMap.get(type);\n }\n return data || this.currentRenderMap.get(type) || this.defaultRenderMap.get(type);\n }\n\n protected clearScreen(renderService: IRenderService, context: IContext2d, drawContext: IDrawContext) {\n const { clear, viewBox } = drawContext;\n // 已经translate过了\n const x = 0;\n const y = 0;\n const width = viewBox.width();\n const height = viewBox.height();\n if (clear) {\n context.clearRect(x, y, width, height);\n const stage = renderService.drawParams?.stage;\n stage && (context.globalAlpha = (stage as any).attribute.opacity ?? 1);\n if (stage && (stage as any).backgroundImg && (stage as any).resources) {\n const res = (stage as any).resources.get(clear);\n if (res && res.state === 'success' && res.data) {\n context.drawImage(res.data, x, y, width, height);\n }\n } else {\n context.fillStyle = createColor(\n context,\n clear,\n {\n AABBBounds: { x1: x, y1: y, x2: x + width, y2: y + height }\n },\n 0,\n 0\n );\n context.fillRect(x, y, width, height);\n }\n }\n }\n\n afterDraw(renderService: IRenderService, drawParams: IDrawContext) {\n return;\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/render/contributions/render/draw-contribution.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,mEAAwF;AAgBxF,+CAAgE;AAEhE,iFAA6E;AAC7E,8CAAoD;AAEpD,6CAA2F;AAE3F,kDAA+C;AAC/C,qCAAsF;AACtF,yDAAyD;AACzD,+DAA2D;AAE3D,wEAAoE;AACpE,wEAAoE;AACpE,sDAAmD;AAM5C,IAAM,uBAAuB,GAA7B,MAAM,uBAAuB;IAkBe;IAK5B;IATrB,YAIiD,aAA+B,EAK3D,gCAAyF;QAL7D,kBAAa,GAAb,aAAa,CAAkB;QAK3D,qCAAgC,GAAhC,gCAAgC,CAAyD;QAE5G,IAAI,CAAC,gBAAgB,GAAG,IAAI,GAAG,EAAE,CAAC;QAClC,IAAI,CAAC,gBAAgB,GAAG,IAAI,GAAG,EAAE,CAAC;QAClC,IAAI,CAAC,cAAc,GAAG,IAAI,GAAG,EAAE,CAAC;QAChC,IAAI,CAAC,WAAW,GAAG,IAAI,eAAM,EAAE,CAAC;QAChC,IAAI,CAAC,iBAAiB,GAAG,IAAI,eAAM,EAAE,CAAC;QACtC,IAAI,CAAC,MAAM,GAAG,yBAAW,CAAC,MAAM,CAAC;QACjC,IAAI,CAAC,YAAY,GAAG,yBAAW,CAAC,YAAY,CAAC;QAC7C,IAAI,CAAC,IAAI,EAAE,CAAC;IACd,CAAC;IAED,IAAI;QACF,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;YAChC,IAAI,IAAI,CAAC,KAAK,EAAE;gBACd,MAAM,GAAG,GAAG,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,IAAI,CAAC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AC9C,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;iBAClD;aACF;iBAAM;gBACL,OAAO,CAAC,SAAS,GAAG,IAAA,0BAAW,EAC7B,OAAO,EACP,KAAK,EACL;oBACE,UAAU,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,GAAG,KAAK,EAAE,EAAE,EAAE,CAAC,GAAG,MAAM,EAAE;iBAC5D,EACD,CAAC,EACD,CAAC,CACF,CAAC;gBACF,OAAO,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;aACvC;SACF;IACH,CAAC;IAED,SAAS,CAAC,aAA6B,EAAE,UAAwB;QAC/D,OAAO;IACT,CAAC;CACF,CAAA;AAzZY,uBAAuB;IADnC,IAAA,2BAAU,GAAE;IAmBR,WAAA,IAAA,4BAAW,EAAC,sBAAa,CAAC,CAAA;IAG1B,WAAA,IAAA,uBAAM,EAAC,4CAAoB,CAAC,CAAA;IAC5B,WAAA,IAAA,sBAAK,EAAC,sCAAmB,CAAC,CAAA;;GAtBlB,uBAAuB,CAyZnC;AAzZY,0DAAuB","file":"draw-contribution.js","sourcesContent":["import { injectable, inject, named, multiInject } from '../../../common/inversify-lite';\nimport type {\n IContext2d,\n MaybePromise,\n IGraphic,\n IGroup,\n IDrawContext,\n IRenderService,\n IGraphicRender,\n IGraphicRenderDrawParams,\n IContributionProvider,\n IDrawItemInterceptorContribution,\n IDrawContribution,\n IRenderSelector,\n IGlobal\n} from '../../../interface';\nimport { findNextGraphic, foreach } from '../../../common/sort';\n// eslint-disable-next-line @typescript-eslint/consistent-type-imports\nimport { ContributionProvider } from '../../../common/contribution-provider';\nimport { DefaultAttribute } from '../../../graphic';\nimport type { IAABBBounds, IBounds, IBoundsLike, IMatrix, IMatrixLike } from '@visactor/vutils';\nimport { Bounds, Logger, getRectIntersect, isRectIntersect, last } from '@visactor/vutils';\nimport { LayerService } from '../../../core/constants';\nimport { container } from '../../../container';\nimport { GraphicRender, IncrementalDrawContribution, RenderSelector } from './symbol';\nimport { DrawItemInterceptor } from './draw-interceptor';\nimport { createColor } from '../../../common/canvas-utils';\nimport type { ILayerService } from '../../../interface/core';\nimport { boundsAllocate } from '../../../allocator/bounds-allocate';\nimport { matrixAllocate } from '../../../allocator/matrix-allocate';\nimport { application } from '../../../application';\n\n/**\n * 默认的渲染contribution,基于树状结构针对图元的渲染\n */\n@injectable()\nexport class DefaultDrawContribution implements IDrawContribution {\n declare currentRenderMap: Map<number, IGraphicRender>;\n declare defaultRenderMap: Map<number, IGraphicRender>;\n declare styleRenderMap: Map<string, Map<number, IGraphicRender>>;\n declare dirtyBounds: IBounds;\n declare backupDirtyBounds: IBounds;\n // 是否使用dirtyBounds\n declare useDirtyBounds: boolean;\n declare currentRenderService: IRenderService;\n declare InterceptorContributions: IDrawItemInterceptorContribution[];\n\n declare global: IGlobal;\n declare layerService: ILayerService;\n\n constructor(\n // @inject(ContributionProvider)\n // @named(GraphicRender)\n // protected readonly contributions: ContributionProvider<IGraphicRender>,\n @multiInject(GraphicRender) protected readonly contributions: IGraphicRender[],\n // @inject(RenderSelector) protected readonly renderSelector: IRenderSelector, // 根据图元类型选择对应的renderItem进行渲染\n // 拦截器\n @inject(ContributionProvider)\n @named(DrawItemInterceptor)\n protected readonly drawItemInterceptorContributions: IContributionProvider<IDrawItemInterceptorContribution>\n ) {\n this.currentRenderMap = new Map();\n this.defaultRenderMap = new Map();\n this.styleRenderMap = new Map();\n this.dirtyBounds = new Bounds();\n this.backupDirtyBounds = new Bounds();\n this.global = application.global;\n this.layerService = application.layerService;\n this.init();\n }\n\n init() {\n this.contributions.forEach(item => {\n if (item.style) {\n const map = this.styleRenderMap.get(item.style) || new Map();\n map.set(item.numberType, item);\n this.styleRenderMap.set(item.style, map);\n } else {\n this.defaultRenderMap.set(item.numberType, item);\n }\n });\n this.InterceptorContributions = this.drawItemInterceptorContributions\n .getContributions()\n .sort((a, b) => a.order - b.order);\n }\n\n prepareForDraw(renderService: IRenderService, drawContext: IDrawContext) {\n // 有dirtyBounds用dirtyBounds\n if (drawContext.updateBounds) {\n this.useDirtyBounds = true;\n } else {\n // 没有的话,看看是否需要跳过outRange的渲染\n this.useDirtyBounds = !drawContext.stage.params.optimize.disableCheckGraphicWidthOutRange;\n }\n }\n\n draw(renderService: IRenderService, drawContext: IDrawContext): MaybePromise<void> {\n this.prepareForDraw(renderService, drawContext);\n drawContext.drawContribution = this;\n this.currentRenderMap = this.styleRenderMap.get(drawContext.renderStyle) || this.defaultRenderMap;\n // this.startAtId = drawParams.startAtId;\n this.currentRenderService = renderService;\n // this.drawParams = drawParams;\n const { context, stage, viewBox, transMatrix } = drawContext;\n\n if (!context) {\n return;\n }\n // if (context.drawPromise) {\n // return;\n // }\n const dirtyBounds: IBounds | undefined = this.dirtyBounds.setValue(0, 0, viewBox.width(), viewBox.height());\n if (stage.dirtyBounds && !stage.dirtyBounds.empty()) {\n const b = getRectIntersect(dirtyBounds, stage.dirtyBounds, false);\n dirtyBounds.x1 = Math.floor(b.x1);\n dirtyBounds.y1 = Math.floor(b.y1);\n dirtyBounds.x2 = Math.ceil(b.x2);\n dirtyBounds.y2 = Math.ceil(b.y2);\n }\n // 如果dpr不是整数或者.5的小数,需要格式化dirtyBounds\n const d = context.dpr % 1;\n if (d || d !== 0.5) {\n dirtyBounds.x1 = Math.floor(dirtyBounds.x1 * context.dpr) / context.dpr;\n dirtyBounds.y1 = Math.floor(dirtyBounds.y1 * context.dpr) / context.dpr;\n dirtyBounds.x2 = Math.ceil(dirtyBounds.x2 * context.dpr) / context.dpr;\n dirtyBounds.y2 = Math.ceil(dirtyBounds.y2 * context.dpr) / context.dpr;\n }\n this.backupDirtyBounds.copy(dirtyBounds);\n context.inuse = true;\n context.setClearMatrix(transMatrix.a, transMatrix.b, transMatrix.c, transMatrix.d, transMatrix.e, transMatrix.f);\n // 初始化context\n context.clearMatrix();\n context.setTransformForCurrent(true);\n\n // const drawInArea =\n // dirtyBounds.width() * context.dpr < context.canvas.width ||\n // dirtyBounds.height() * context.dpr < context.canvas.height;\n // context.save();\n\n // 设置translate\n context.translate(viewBox.x1, viewBox.y1, true);\n context.beginPath();\n context.rect(dirtyBounds.x1, dirtyBounds.y1, dirtyBounds.width(), dirtyBounds.height());\n context.clip();\n\n // 如果存在3d视角,那么不使用dirtyBounds\n if (stage.camera) {\n this.dirtyBounds.setValue(-Infinity, -Infinity, Infinity, Infinity);\n this.backupDirtyBounds.setValue(-Infinity, -Infinity, Infinity, Infinity);\n }\n\n this.clearScreen(renderService, context, drawContext);\n // // 渲染的时候图元的起始位置就是x,y\n // this.backupDirtyBounds.translate(-x, -y);\n // this.dirtyBounds.translate(-x, -y);\n\n // // 设置translate\n // context.translate(x, y, true);\n\n context.save();\n renderService.renderTreeRoots\n .sort((a, b) => {\n return (a.attribute.zIndex ?? DefaultAttribute.zIndex) - (b.attribute.zIndex ?? DefaultAttribute.zIndex);\n })\n .forEach(group => {\n group.isContainer\n ? this.renderGroup(group as IGroup, drawContext, matrixAllocate.allocate(1, 0, 0, 1, 0, 0))\n : this.renderItem(group as IGraphic, drawContext);\n });\n\n // context.restore();\n context.restore();\n context.setClearMatrix(1, 0, 0, 1, 0, 0);\n // this.break = false;\n context.inuse = false;\n context.draw();\n }\n\n doRegister() {\n throw new Error('暂不支持');\n }\n\n // 找到下一个graphic\n protected _findNextGraphic(group: IGroup): IGraphic | null {\n let parent = group.parent;\n let id = group._uid;\n while (parent) {\n const g = findNextGraphic(parent, id, DefaultAttribute.zIndex);\n if (g) {\n return g;\n }\n id = parent._uid;\n parent = parent.parent;\n }\n return null;\n }\n\n renderGroup(group: IGroup, drawContext: IDrawContext, parentMatrix: IMatrix, skipSort?: boolean) {\n if (drawContext.break || group.attribute.visibleAll === false) {\n return;\n }\n if (group.incremental && (drawContext.startAtId == null || drawContext.startAtId === group._uid)) {\n drawContext.break = true;\n this._increaseRender(group, drawContext);\n return;\n }\n\n if (this.useDirtyBounds && !isRectIntersect(group.AABBBounds, this.dirtyBounds, false)) {\n return;\n }\n\n let nextM: IMatrix = parentMatrix;\n let tempBounds: IBounds;\n\n if (this.useDirtyBounds) {\n tempBounds = boundsAllocate.allocateByObj(this.dirtyBounds);\n // 变换dirtyBounds\n const gm = group.transMatrix;\n nextM = matrixAllocate.allocateByObj(parentMatrix).multiply(gm.a, gm.b, gm.c, gm.d, gm.e, gm.f);\n // const m = group.globalTransMatrix.getInverse();\n this.dirtyBounds.copy(this.backupDirtyBounds).transformWithMatrix(nextM.getInverse());\n }\n\n this.renderItem(group, drawContext, {\n drawingCb: () => {\n skipSort\n ? group.forEachChildren((item: IGraphic) => {\n if (drawContext.break) {\n return;\n }\n if (item.isContainer) {\n this.renderGroup(item as IGroup, drawContext, nextM);\n } else {\n this.renderItem(item, drawContext);\n }\n })\n : foreach(\n group,\n DefaultAttribute.zIndex,\n (item: IGraphic) => {\n if (drawContext.break) {\n return;\n }\n if (item.isContainer) {\n this.renderGroup(item as IGroup, drawContext, nextM);\n } else {\n this.renderItem(item, drawContext);\n }\n },\n false,\n !!drawContext.context?.camera\n );\n }\n });\n\n if (this.useDirtyBounds) {\n this.dirtyBounds.copy(tempBounds);\n boundsAllocate.free(tempBounds);\n matrixAllocate.free(nextM);\n }\n }\n\n protected _increaseRender(group: IGroup, drawContext: IDrawContext) {\n const { layer, stage } = drawContext;\n const { subLayers } = layer;\n // 获取渐进渲染层\n let incrementalLayer = subLayers.get(group._uid);\n if (!incrementalLayer) {\n incrementalLayer = {\n layer: this.layerService.createLayer(stage),\n zIndex: subLayers.size,\n group\n };\n subLayers.set(group._uid, incrementalLayer);\n }\n // 渲染\n const incrementalContext = incrementalLayer.layer.getNativeHandler().getContext();\n const idc = incrementalLayer.drawContribution || container.get(IncrementalDrawContribution);\n idc.dirtyBounds.setValue(-Infinity, -Infinity, Infinity, Infinity);\n idc.backupDirtyBounds.setValue(-Infinity, -Infinity, Infinity, Infinity);\n (idc as any).draw(this.currentRenderService, {\n ...drawContext,\n drawContribution: idc,\n clear: 'transparent',\n layer: incrementalLayer.layer,\n context: incrementalContext,\n startAtId: group._uid,\n break: false\n });\n incrementalLayer.drawContribution = idc;\n // this.draw(this.currentRenderService, {...this.drawParams, startAtId: group._uid})\n // this.draw(this.currentRenderService, {...this.drawParams, clear: 'transparent', layer: incrementalContext.layer, context: incrementalContext, startAtId: group._uid})\n const nextGraphic = this._findNextGraphic(group);\n if (nextGraphic) {\n // 如果是下一个渐进渲染层,那就再来一次\n if (nextGraphic.isContainer && nextGraphic.incremental) {\n this._increaseRender(nextGraphic as IGroup, drawContext);\n } else {\n // 如果不是渐进渲染层,那就默认图层渲染\n let afterLayer = subLayers.get(nextGraphic._uid);\n if (!afterLayer) {\n afterLayer = {\n layer: this.layerService.createLayer(stage),\n zIndex: subLayers.size\n };\n subLayers.set(nextGraphic._uid, afterLayer);\n }\n const afterContext = afterLayer.layer.getNativeHandler().getContext();\n this.draw(this.currentRenderService, {\n ...drawContext,\n drawContribution: idc,\n clear: 'transparent',\n layer: afterLayer.layer,\n context: afterContext,\n startAtId: nextGraphic._uid,\n break: false\n });\n }\n }\n }\n\n getRenderContribution(graphic: IGraphic): IGraphicRender | null {\n let renderer;\n if (!renderer) {\n renderer = this.selectRenderByNumberType(graphic.numberType, graphic);\n }\n if (!renderer) {\n renderer = this.selectRenderByType(graphic.type);\n }\n return renderer;\n }\n\n renderItem(graphic: IGraphic, drawContext: IDrawContext, params?: IGraphicRenderDrawParams) {\n // 添加拦截器\n if (this.InterceptorContributions.length) {\n for (let i = 0; i < this.InterceptorContributions.length; i++) {\n const drawContribution = this.InterceptorContributions[i];\n if (\n drawContribution.beforeDrawItem &&\n drawContribution.beforeDrawItem(graphic, this.currentRenderService, drawContext, this, params)\n ) {\n return;\n }\n }\n }\n\n const renderer = this.getRenderContribution(graphic);\n if (!renderer) {\n return;\n }\n\n let retrans: boolean = false;\n let tempBounds: IAABBBounds;\n\n if (graphic.parent) {\n const { scrollX = 0, scrollY = 0 } = graphic.parent.attribute;\n retrans = !!(scrollX || scrollY);\n if (retrans) {\n tempBounds = this.dirtyBounds.clone();\n // 变换dirtyBounds\n const m = graphic.globalTransMatrix.getInverse();\n this.dirtyBounds.copy(this.backupDirtyBounds).transformWithMatrix(m);\n this.dirtyBounds.translate(-scrollX, -scrollY);\n }\n }\n\n if (this.useDirtyBounds && !(graphic.isContainer || isRectIntersect(graphic.AABBBounds, this.dirtyBounds, false))) {\n retrans && this.dirtyBounds.copy(tempBounds);\n return;\n }\n\n const skipDraw = drawContext.startAtId != null && graphic._uid !== drawContext.startAtId;\n if (graphic._uid === drawContext.startAtId) {\n drawContext.startAtId = null;\n }\n params && (params.skipDraw = skipDraw);\n if (skipDraw) {\n graphic.isContainer && renderer.draw(graphic, this.currentRenderService, drawContext, params);\n } else {\n renderer.draw(graphic, this.currentRenderService, drawContext, params);\n }\n\n retrans && this.dirtyBounds.copy(tempBounds);\n\n // 添加拦截器\n if (this.InterceptorContributions.length) {\n for (let i = 0; i < this.InterceptorContributions.length; i++) {\n const drawContribution = this.InterceptorContributions[i];\n if (drawContribution.afterDrawItem) {\n if (drawContribution.afterDrawItem(graphic, this.currentRenderService, drawContext, this)) {\n return;\n }\n }\n }\n }\n }\n // 根据type选择对应的render\n protected selectRenderByType(type?: string): IGraphicRender | null {\n Logger.getInstance().warn('未知错误,不应该走到这里');\n return null;\n }\n // 根据type选择对应的render\n protected selectRenderByNumberType(type: number, graphic: IGraphic): IGraphicRender | null {\n let data;\n if (graphic.attribute.renderStyle) {\n const currentRenderMap = this.styleRenderMap.get(graphic.attribute.renderStyle);\n data = currentRenderMap && currentRenderMap.get(type);\n }\n return data || this.currentRenderMap.get(type) || this.defaultRenderMap.get(type);\n }\n\n protected clearScreen(renderService: IRenderService, context: IContext2d, drawContext: IDrawContext) {\n const { clear, viewBox } = drawContext;\n // 已经translate过了\n const x = 0;\n const y = 0;\n const width = viewBox.width();\n const height = viewBox.height();\n if (clear) {\n context.clearRect(x, y, width, height);\n const stage = renderService.drawParams?.stage;\n stage && (context.globalAlpha = (stage as any).attribute.opacity ?? 1);\n if (stage && (stage as any).backgroundImg && (stage as any).resources) {\n const res = (stage as any).resources.get(clear);\n if (res && res.state === 'success' && res.data) {\n context.drawImage(res.data, x, y, width, height);\n }\n } else {\n context.fillStyle = createColor(\n context,\n clear,\n {\n AABBBounds: { x1: x, y1: y, x2: x + width, y2: y + height }\n },\n 0,\n 0\n );\n context.fillRect(x, y, width, height);\n }\n }\n }\n\n afterDraw(renderService: IRenderService, drawParams: IDrawContext) {\n return;\n }\n}\n"]}
@@ -19,9 +19,7 @@ exports.DrawItemInterceptor = Symbol.for("DrawItemInterceptor");
19
19
  const tempDirtyBounds = new vutils_1.AABBBounds;
20
20
 
21
21
  class ShadowRootDrawItemInterceptorContribution {
22
- constructor() {
23
- this.order = 1;
24
- }
22
+ order=1;
25
23
  afterDrawItem(graphic, renderService, drawContext, drawContribution, params) {
26
24
  return (graphic.attribute.shadowRootIdx > 0 || !graphic.attribute.shadowRootIdx) && this.drawItem(graphic, renderService, drawContext, drawContribution, params),
27
25
  !1;
@@ -48,9 +46,7 @@ class ShadowRootDrawItemInterceptorContribution {
48
46
  exports.ShadowRootDrawItemInterceptorContribution = ShadowRootDrawItemInterceptorContribution;
49
47
 
50
48
  class DebugDrawItemInterceptorContribution {
51
- constructor() {
52
- this.order = 1;
53
- }
49
+ order=1;
54
50
  afterDrawItem(graphic, renderService, drawContext, drawContribution, params) {
55
51
  return graphic.attribute._debug_bounds && this.drawItem(graphic, renderService, drawContext, drawContribution, params),
56
52
  !1;
@@ -70,8 +66,10 @@ class DebugDrawItemInterceptorContribution {
70
66
  exports.DebugDrawItemInterceptorContribution = DebugDrawItemInterceptorContribution;
71
67
 
72
68
  let CommonDrawItemInterceptorContribution = class {
69
+ order=1;
70
+ interceptors;
73
71
  constructor() {
74
- this.order = 1, this.interceptors = [ new ShadowRootDrawItemInterceptorContribution, new Canvas3DDrawItemInterceptor, new InteractiveDrawItemInterceptorContribution, new DebugDrawItemInterceptorContribution ];
72
+ this.interceptors = [ new ShadowRootDrawItemInterceptorContribution, new Canvas3DDrawItemInterceptor, new InteractiveDrawItemInterceptorContribution, new DebugDrawItemInterceptorContribution ];
75
73
  }
76
74
  afterDrawItem(graphic, renderService, drawContext, drawContribution, params) {
77
75
  for (let i = 0; i < this.interceptors.length; i++) if (this.interceptors[i].afterDrawItem && this.interceptors[i].afterDrawItem(graphic, renderService, drawContext, drawContribution, params)) return !0;
@@ -88,9 +86,8 @@ CommonDrawItemInterceptorContribution = __decorate([ (0, inversify_lite_1.inject
88
86
  exports.CommonDrawItemInterceptorContribution = CommonDrawItemInterceptorContribution;
89
87
 
90
88
  class InteractiveDrawItemInterceptorContribution {
91
- constructor() {
92
- this.order = 1;
93
- }
89
+ order=1;
90
+ processing;
94
91
  beforeDrawItem(graphic, renderService, drawContext, drawContribution, params) {
95
92
  return !this.processing && (graphic.baseGraphic ? this.beforeDrawInteractive(graphic, renderService, drawContext, drawContribution, params) : this.beforeSetInteractive(graphic, renderService, drawContext, drawContribution, params));
96
93
  }
@@ -139,19 +136,16 @@ class InteractiveDrawItemInterceptorContribution {
139
136
  return !1;
140
137
  }
141
138
  getShadowRoot(interactiveLayer) {
142
- var _a;
143
139
  let group = interactiveLayer.getElementById("_interactive_group");
144
140
  return group || (group = graphic_1.graphicCreator.CreateGraphic("group", {}), group.id = "_interactive_group",
145
- interactiveLayer.add(group)), null !== (_a = group.shadowRoot) && void 0 !== _a ? _a : group.attachShadow();
141
+ interactiveLayer.add(group)), group.shadowRoot ?? group.attachShadow();
146
142
  }
147
143
  }
148
144
 
149
145
  exports.InteractiveDrawItemInterceptorContribution = InteractiveDrawItemInterceptorContribution;
150
146
 
151
147
  class Canvas3DDrawItemInterceptor {
152
- constructor() {
153
- this.order = 1;
154
- }
148
+ order=1;
155
149
  beforeDrawItem(graphic, renderService, drawContext, drawContribution, params) {
156
150
  if (!graphic.in3dMode || drawContext.in3dInterceptor) return !1;
157
151
  drawContext.in3dInterceptor = !0;
@@ -176,8 +170,7 @@ class Canvas3DDrawItemInterceptor {
176
170
  !isPie))), graphic.forEachChildren((c => (is3d = !!c.findFace, !is3d))), isPie) {
177
171
  const children = graphic.getChildren(), sortedChildren = [ ...children ];
178
172
  sortedChildren.sort(((a, b) => {
179
- var _a, _b, _c, _d;
180
- let angle1 = ((null !== (_a = a.attribute.startAngle) && void 0 !== _a ? _a : 0) + (null !== (_b = a.attribute.endAngle) && void 0 !== _b ? _b : 0)) / 2, angle2 = ((null !== (_c = b.attribute.startAngle) && void 0 !== _c ? _c : 0) + (null !== (_d = b.attribute.endAngle) && void 0 !== _d ? _d : 0)) / 2;
173
+ let angle1 = ((a.attribute.startAngle ?? 0) + (a.attribute.endAngle ?? 0)) / 2, angle2 = ((b.attribute.startAngle ?? 0) + (b.attribute.endAngle ?? 0)) / 2;
181
174
  for (;angle1 < 0; ) angle1 += vutils_1.pi2;
182
175
  for (;angle2 < 0; ) angle2 += vutils_1.pi2;
183
176
  return angle2 - angle1;
@@ -197,10 +190,7 @@ class Canvas3DDrawItemInterceptor {
197
190
  }));
198
191
  } else if (is3d) {
199
192
  const children = graphic.getChildren(), zChildren = children.map((g => ({
200
- ave_z: g.findFace().vertices.map((v => {
201
- var _a;
202
- return context.view(v[0], v[1], null !== (_a = v[2] + g.attribute.z) && void 0 !== _a ? _a : 0)[2];
203
- })).reduce(((a, b) => a + b), 0),
193
+ ave_z: g.findFace().vertices.map((v => context.view(v[0], v[1], v[2] + g.attribute.z ?? 0)[2])).reduce(((a, b) => a + b), 0),
204
194
  g: g
205
195
  })));
206
196
  zChildren.sort(((a, b) => b.ave_z - a.ave_z)), graphic.removeAllChild(), zChildren.forEach((i => {