@visactor/vrender-core 0.17.0-alpha.8 → 0.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (706) hide show
  1. package/cjs/allocator/bounds-allocate.d.ts +13 -0
  2. package/cjs/allocator/bounds-allocate.js +38 -0
  3. package/cjs/allocator/bounds-allocate.js.map +1 -0
  4. package/cjs/allocator/canvas-allocate.d.ts +4 -0
  5. package/cjs/allocator/canvas-allocate.js +19 -6
  6. package/cjs/allocator/canvas-allocate.js.map +1 -1
  7. package/cjs/allocator/graphic-allocate.d.ts +56 -1
  8. package/cjs/allocator/graphic-allocate.js +163 -1
  9. package/cjs/allocator/graphic-allocate.js.map +1 -1
  10. package/cjs/animate/Ticker/default-ticker.js +3 -3
  11. package/cjs/animate/Ticker/default-ticker.js.map +1 -1
  12. package/cjs/animate/animate.js +2 -2
  13. package/cjs/animate/animate.js.map +1 -1
  14. package/cjs/animate/config.js +1 -2
  15. package/cjs/animate/custom-animate.d.ts +14 -3
  16. package/cjs/animate/custom-animate.js +100 -5
  17. package/cjs/animate/custom-animate.js.map +1 -1
  18. package/cjs/animate/default-ticker.js +2 -1
  19. package/cjs/canvas/contributions/base-canvas.js +4 -2
  20. package/cjs/canvas/contributions/base-canvas.js.map +1 -1
  21. package/cjs/common/Reflect-metadata.js +349 -359
  22. package/cjs/common/Reflect-metadata.js.map +1 -1
  23. package/cjs/common/bounds-context.js +2 -1
  24. package/cjs/common/inversify/annotation/inject.d.ts +1 -0
  25. package/cjs/common/inversify/annotation/inject.js +10 -0
  26. package/cjs/common/inversify/annotation/inject.js.map +1 -0
  27. package/cjs/common/inversify/annotation/inject_base.d.ts +14 -0
  28. package/cjs/common/inversify/annotation/inject_base.js +39 -0
  29. package/cjs/common/inversify/annotation/inject_base.js.map +1 -0
  30. package/cjs/common/inversify/annotation/injectable.d.ts +1 -0
  31. package/cjs/common/{inversify-lite/annotation/post_construct.js → inversify/annotation/injectable.js} +15 -5
  32. package/cjs/common/inversify/annotation/injectable.js.map +1 -0
  33. package/cjs/common/inversify/annotation/multi_inject.d.ts +1 -0
  34. package/cjs/common/inversify/annotation/multi_inject.js +10 -0
  35. package/cjs/common/inversify/annotation/multi_inject.js.map +1 -0
  36. package/cjs/common/inversify/annotation/named.d.ts +1 -0
  37. package/cjs/common/inversify/annotation/named.js +14 -0
  38. package/cjs/common/inversify/annotation/named.js.map +1 -0
  39. package/cjs/common/inversify/binding.d.ts +18 -0
  40. package/cjs/common/inversify/binding.js +26 -0
  41. package/cjs/common/inversify/binding.js.map +1 -0
  42. package/cjs/common/inversify/container.d.ts +28 -0
  43. package/cjs/common/inversify/container.js +155 -0
  44. package/cjs/common/inversify/container.js.map +1 -0
  45. package/cjs/common/inversify/cotainer-module.d.ts +6 -0
  46. package/cjs/common/inversify/cotainer-module.js +16 -0
  47. package/cjs/common/inversify/cotainer-module.js.map +1 -0
  48. package/cjs/common/inversify/index.d.ts +7 -0
  49. package/cjs/common/inversify/index.js +75 -0
  50. package/cjs/common/inversify/index.js.map +1 -0
  51. package/cjs/common/inversify/interfaces.d.ts +218 -0
  52. package/cjs/common/inversify/interfaces.js +6 -0
  53. package/cjs/common/inversify/interfaces.js.map +1 -0
  54. package/cjs/common/inversify/literal_types.d.ts +5 -0
  55. package/cjs/common/inversify/literal_types.js +34 -0
  56. package/cjs/common/inversify/literal_types.js.map +1 -0
  57. package/cjs/common/inversify/meta-data.d.ts +6 -0
  58. package/cjs/common/inversify/meta-data.js +19 -0
  59. package/cjs/common/inversify/meta-data.js.map +1 -0
  60. package/cjs/common/inversify/metadata_keys.d.ts +12 -0
  61. package/cjs/common/inversify/metadata_keys.js +15 -0
  62. package/cjs/common/inversify/metadata_keys.js.map +1 -0
  63. package/cjs/common/inversify/metadata_reader.d.ts +6 -0
  64. package/cjs/common/inversify/metadata_reader.js +28 -0
  65. package/cjs/common/inversify/metadata_reader.js.map +1 -0
  66. package/cjs/common/inversify/syntax/binding_in_syntax.d.ts +10 -0
  67. package/cjs/common/inversify/syntax/binding_in_syntax.js +29 -0
  68. package/cjs/common/inversify/syntax/binding_in_syntax.js.map +1 -0
  69. package/cjs/common/inversify/syntax/binding_to_syntax.d.ts +12 -0
  70. package/cjs/common/inversify/syntax/binding_to_syntax.js +40 -0
  71. package/cjs/common/inversify/syntax/binding_to_syntax.js.map +1 -0
  72. package/cjs/common/inversify/syntax/constraint_helpers.d.ts +2 -0
  73. package/cjs/common/inversify/syntax/constraint_helpers.js +20 -0
  74. package/cjs/common/inversify/syntax/constraint_helpers.js.map +1 -0
  75. package/cjs/common/inversify-lite/container/container.js +1 -3
  76. package/cjs/common/inversify-lite/container/container.js.map +1 -1
  77. package/cjs/common/inversify-lite/index.d.ts +1 -8
  78. package/cjs/common/inversify-lite/index.js +1 -64
  79. package/cjs/common/inversify-lite/index.js.map +1 -1
  80. package/cjs/common/inversify-lite/interfaces/interfaces.d.ts +0 -2
  81. package/cjs/common/inversify-lite/interfaces/interfaces.js.map +1 -1
  82. package/cjs/common/inversify-lite/planning/queryable_string.d.ts +0 -2
  83. package/cjs/common/inversify-lite/planning/queryable_string.js +0 -10
  84. package/cjs/common/inversify-lite/planning/queryable_string.js.map +1 -1
  85. package/cjs/common/inversify-lite/resolution/resolver.js.map +1 -1
  86. package/cjs/common/segment/monotone.js +2 -2
  87. package/cjs/common/segment/monotone.js.map +1 -1
  88. package/cjs/common/shape/rect.js +2 -1
  89. package/cjs/common/shape/rect.js.map +1 -1
  90. package/cjs/common/sort.js +1 -2
  91. package/cjs/common/store.js +2 -1
  92. package/cjs/common/utils.d.ts +1 -0
  93. package/cjs/common/utils.js +10 -1
  94. package/cjs/common/utils.js.map +1 -1
  95. package/cjs/common/xml/OrderedObjParser.js +2 -2
  96. package/cjs/common/xml/OrderedObjParser.js.map +1 -1
  97. package/cjs/core/contributions/layerHandler/canvas2d-contribution.d.ts +2 -2
  98. package/cjs/core/contributions/layerHandler/canvas2d-contribution.js +4 -9
  99. package/cjs/core/contributions/layerHandler/canvas2d-contribution.js.map +1 -1
  100. package/cjs/core/contributions/layerHandler/empty-contribution.d.ts +2 -2
  101. package/cjs/core/contributions/layerHandler/empty-contribution.js +4 -9
  102. package/cjs/core/contributions/layerHandler/empty-contribution.js.map +1 -1
  103. package/cjs/core/contributions/layerHandler/offscreen2d-contribution.d.ts +2 -2
  104. package/cjs/core/contributions/layerHandler/offscreen2d-contribution.js +4 -9
  105. package/cjs/core/contributions/layerHandler/offscreen2d-contribution.js.map +1 -1
  106. package/cjs/core/contributions/textMeasure/AtextMeasure.d.ts +14 -2
  107. package/cjs/core/contributions/textMeasure/AtextMeasure.js +99 -13
  108. package/cjs/core/contributions/textMeasure/AtextMeasure.js.map +1 -1
  109. package/cjs/core/contributions/textMeasure/layout.d.ts +2 -2
  110. package/cjs/core/contributions/textMeasure/layout.js +4 -4
  111. package/cjs/core/contributions/textMeasure/layout.js.map +1 -1
  112. package/cjs/core/contributions/textMeasure/modules.js +1 -2
  113. package/cjs/core/contributions/textMeasure/modules.js.map +1 -1
  114. package/cjs/core/core-modules.js +5 -6
  115. package/cjs/core/core-modules.js.map +1 -1
  116. package/cjs/core/global-module.js +2 -0
  117. package/cjs/core/global.d.ts +9 -0
  118. package/cjs/core/global.js +23 -5
  119. package/cjs/core/global.js.map +1 -1
  120. package/cjs/core/graphic-utils.d.ts +7 -4
  121. package/cjs/core/graphic-utils.js +18 -14
  122. package/cjs/core/graphic-utils.js.map +1 -1
  123. package/cjs/core/layer-service.d.ts +5 -2
  124. package/cjs/core/layer-service.js +17 -15
  125. package/cjs/core/layer-service.js.map +1 -1
  126. package/cjs/core/stage.d.ts +8 -4
  127. package/cjs/core/stage.js +42 -27
  128. package/cjs/core/stage.js.map +1 -1
  129. package/cjs/core/window.d.ts +2 -2
  130. package/cjs/core/window.js +7 -12
  131. package/cjs/core/window.js.map +1 -1
  132. package/cjs/env-check.d.ts +3 -0
  133. package/cjs/env-check.js +19 -0
  134. package/cjs/env-check.js.map +1 -0
  135. package/cjs/event/event-manager.d.ts +5 -1
  136. package/cjs/event/event-manager.js +31 -25
  137. package/cjs/event/event-manager.js.map +1 -1
  138. package/cjs/event/event-system.js +12 -11
  139. package/cjs/event/event-system.js.map +1 -1
  140. package/cjs/event/federated-event/base-event.d.ts +5 -6
  141. package/cjs/event/federated-event/base-event.js +15 -5
  142. package/cjs/event/federated-event/base-event.js.map +1 -1
  143. package/cjs/event/federated-event/mouse-event.d.ts +6 -6
  144. package/cjs/event/federated-event/mouse-event.js +17 -3
  145. package/cjs/event/federated-event/mouse-event.js.map +1 -1
  146. package/cjs/graphic/area.js +1 -0
  147. package/cjs/graphic/area.js.map +1 -1
  148. package/cjs/graphic/builtin-symbol/index.d.ts +1 -0
  149. package/cjs/graphic/builtin-symbol/index.js +7 -2
  150. package/cjs/graphic/builtin-symbol/index.js.map +1 -1
  151. package/cjs/graphic/builtin-symbol/rect.d.ts +2 -1
  152. package/cjs/graphic/builtin-symbol/rect.js +11 -6
  153. package/cjs/graphic/builtin-symbol/rect.js.map +1 -1
  154. package/cjs/graphic/config.js +11 -3
  155. package/cjs/graphic/config.js.map +1 -1
  156. package/cjs/graphic/graphic-service/arc-contribution.d.ts +1 -5
  157. package/cjs/graphic/graphic-service/arc-contribution.js +0 -18
  158. package/cjs/graphic/graphic-service/arc-contribution.js.map +1 -1
  159. package/cjs/graphic/graphic-service/area-contribution.d.ts +1 -1
  160. package/cjs/graphic/graphic-service/area-contribution.js +1 -4
  161. package/cjs/graphic/graphic-service/area-contribution.js.map +1 -1
  162. package/cjs/graphic/graphic-service/circle-contribution.d.ts +1 -5
  163. package/cjs/graphic/graphic-service/circle-contribution.js +0 -18
  164. package/cjs/graphic/graphic-service/circle-contribution.js.map +1 -1
  165. package/cjs/graphic/graphic-service/common-contribution.js +2 -11
  166. package/cjs/graphic/graphic-service/common-contribution.js.map +1 -1
  167. package/cjs/graphic/graphic-service/graphic-module.js +2 -17
  168. package/cjs/graphic/graphic-service/graphic-module.js.map +1 -1
  169. package/cjs/graphic/graphic-service/graphic-service.d.ts +5 -9
  170. package/cjs/graphic/graphic-service/graphic-service.js +43 -32
  171. package/cjs/graphic/graphic-service/graphic-service.js.map +1 -1
  172. package/cjs/graphic/graphic-service/path-contribution.d.ts +1 -5
  173. package/cjs/graphic/graphic-service/path-contribution.js +0 -18
  174. package/cjs/graphic/graphic-service/path-contribution.js.map +1 -1
  175. package/cjs/graphic/graphic-service/rect-contribution.d.ts +1 -5
  176. package/cjs/graphic/graphic-service/rect-contribution.js +0 -18
  177. package/cjs/graphic/graphic-service/rect-contribution.js.map +1 -1
  178. package/cjs/graphic/graphic-service/symbol-contribution.d.ts +0 -1
  179. package/cjs/graphic/graphic-service/symbol-contribution.js +4 -13
  180. package/cjs/graphic/graphic-service/symbol-contribution.js.map +1 -1
  181. package/cjs/graphic/graphic.js +9 -7
  182. package/cjs/graphic/graphic.js.map +1 -1
  183. package/cjs/graphic/group.d.ts +1 -0
  184. package/cjs/graphic/group.js +7 -3
  185. package/cjs/graphic/group.js.map +1 -1
  186. package/cjs/graphic/line.js +1 -0
  187. package/cjs/graphic/line.js.map +1 -1
  188. package/cjs/graphic/node-tree.js +1 -1
  189. package/cjs/graphic/node-tree.js.map +1 -1
  190. package/cjs/graphic/rect.d.ts +2 -3
  191. package/cjs/graphic/rect.js +3 -5
  192. package/cjs/graphic/rect.js.map +1 -1
  193. package/cjs/graphic/richtext/line.d.ts +1 -0
  194. package/cjs/graphic/richtext/line.js +6 -3
  195. package/cjs/graphic/richtext/line.js.map +1 -1
  196. package/cjs/graphic/richtext/paragraph.js +12 -11
  197. package/cjs/graphic/richtext/paragraph.js.map +1 -1
  198. package/cjs/graphic/richtext/utils.js +2 -1
  199. package/cjs/graphic/richtext/utils.js.map +1 -1
  200. package/cjs/graphic/richtext.d.ts +3 -3
  201. package/cjs/graphic/richtext.js +12 -3
  202. package/cjs/graphic/richtext.js.map +1 -1
  203. package/cjs/graphic/symbol.js +11 -9
  204. package/cjs/graphic/symbol.js.map +1 -1
  205. package/cjs/graphic/text.d.ts +1 -0
  206. package/cjs/graphic/text.js +97 -11
  207. package/cjs/graphic/text.js.map +1 -1
  208. package/cjs/graphic/theme.d.ts +4 -4
  209. package/cjs/graphic/theme.js +26 -27
  210. package/cjs/graphic/theme.js.map +1 -1
  211. package/cjs/graphic/tools.js +1 -1
  212. package/cjs/graphic/tools.js.map +1 -1
  213. package/cjs/graphic/wrap-text.js +6 -5
  214. package/cjs/graphic/wrap-text.js.map +1 -1
  215. package/cjs/index.d.ts +3 -0
  216. package/cjs/index.js +3 -1
  217. package/cjs/index.js.map +1 -1
  218. package/cjs/interface/allocator.d.ts +1 -0
  219. package/cjs/interface/allocator.js.map +1 -1
  220. package/cjs/interface/event.d.ts +15 -44
  221. package/cjs/interface/event.js.map +1 -1
  222. package/cjs/interface/global.d.ts +1 -0
  223. package/cjs/interface/global.js.map +1 -1
  224. package/cjs/interface/graphic/rect.d.ts +2 -0
  225. package/cjs/interface/graphic/rect.js.map +1 -1
  226. package/cjs/interface/graphic/richText.d.ts +1 -1
  227. package/cjs/interface/graphic/richText.js.map +1 -1
  228. package/cjs/interface/graphic/text.d.ts +5 -1
  229. package/cjs/interface/graphic/text.js.map +1 -1
  230. package/cjs/interface/graphic.d.ts +3 -2
  231. package/cjs/interface/graphic.js.map +1 -1
  232. package/cjs/interface/render.d.ts +2 -2
  233. package/cjs/interface/render.js.map +1 -1
  234. package/cjs/interface/stage.d.ts +8 -1
  235. package/cjs/interface/stage.js.map +1 -1
  236. package/cjs/interface/text.d.ts +2 -2
  237. package/cjs/interface/text.js.map +1 -1
  238. package/cjs/modules.d.ts +1 -2
  239. package/cjs/modules.js +8 -8
  240. package/cjs/modules.js.map +1 -1
  241. package/cjs/picker/global-picker-service.d.ts +2 -2
  242. package/cjs/picker/global-picker-service.js +4 -9
  243. package/cjs/picker/global-picker-service.js.map +1 -1
  244. package/cjs/picker/pick-interceptor.js +2 -1
  245. package/cjs/picker/pick-interceptor.js.map +1 -1
  246. package/cjs/picker/pick-modules.js +2 -4
  247. package/cjs/picker/pick-modules.js.map +1 -1
  248. package/cjs/picker/picker-service.d.ts +2 -2
  249. package/cjs/picker/picker-service.js +11 -7
  250. package/cjs/picker/picker-service.js.map +1 -1
  251. package/cjs/plugins/builtin-plugin/flex-layout-plugin.js +9 -5
  252. package/cjs/plugins/builtin-plugin/flex-layout-plugin.js.map +1 -1
  253. package/cjs/plugins/builtin-plugin/html-attribute-plugin.js +1 -1
  254. package/cjs/plugins/builtin-plugin/html-attribute-plugin.js.map +1 -1
  255. package/cjs/plugins/plugin-modules.js +1 -2
  256. package/cjs/plugins/plugin-modules.js.map +1 -1
  257. package/cjs/render/contributions/render/arc-render.js +2 -1
  258. package/cjs/render/contributions/render/arc-render.js.map +1 -1
  259. package/cjs/render/contributions/render/area-render.d.ts +1 -0
  260. package/cjs/render/contributions/render/area-render.js +44 -6
  261. package/cjs/render/contributions/render/area-render.js.map +1 -1
  262. package/cjs/render/contributions/render/base-render.d.ts +1 -1
  263. package/cjs/render/contributions/render/base-render.js +15 -18
  264. package/cjs/render/contributions/render/base-render.js.map +1 -1
  265. package/cjs/render/contributions/render/circle-render.js +2 -1
  266. package/cjs/render/contributions/render/circle-render.js.map +1 -1
  267. package/cjs/render/contributions/render/contributions/arc-contribution-render.d.ts +3 -7
  268. package/cjs/render/contributions/render/contributions/arc-contribution-render.js +7 -30
  269. package/cjs/render/contributions/render/contributions/arc-contribution-render.js.map +1 -1
  270. package/cjs/render/contributions/render/contributions/area-contribution-render.d.ts +3 -4
  271. package/cjs/render/contributions/render/contributions/area-contribution-render.js +7 -21
  272. package/cjs/render/contributions/render/contributions/area-contribution-render.js.map +1 -1
  273. package/cjs/render/contributions/render/contributions/base-contribution-render.d.ts +4 -0
  274. package/cjs/render/contributions/render/contributions/base-contribution-render.js +24 -15
  275. package/cjs/render/contributions/render/contributions/base-contribution-render.js.map +1 -1
  276. package/cjs/render/contributions/render/contributions/circle-contribution-render.d.ts +3 -7
  277. package/cjs/render/contributions/render/contributions/circle-contribution-render.js +7 -30
  278. package/cjs/render/contributions/render/contributions/circle-contribution-render.js.map +1 -1
  279. package/cjs/render/contributions/render/contributions/constants.d.ts +1 -0
  280. package/cjs/render/contributions/render/contributions/constants.js +2 -2
  281. package/cjs/render/contributions/render/contributions/constants.js.map +1 -1
  282. package/cjs/render/contributions/render/contributions/group-contribution-render.d.ts +1 -0
  283. package/cjs/render/contributions/render/contributions/group-contribution-render.js +8 -14
  284. package/cjs/render/contributions/render/contributions/group-contribution-render.js.map +1 -1
  285. package/cjs/render/contributions/render/contributions/image-contribution-render.d.ts +1 -0
  286. package/cjs/render/contributions/render/contributions/image-contribution-render.js +8 -15
  287. package/cjs/render/contributions/render/contributions/image-contribution-render.js.map +1 -1
  288. package/cjs/render/contributions/render/contributions/path-contribution-render.d.ts +2 -9
  289. package/cjs/render/contributions/render/contributions/path-contribution-render.js +4 -25
  290. package/cjs/render/contributions/render/contributions/path-contribution-render.js.map +1 -1
  291. package/cjs/render/contributions/render/contributions/polygon-contribution-render.d.ts +2 -9
  292. package/cjs/render/contributions/render/contributions/polygon-contribution-render.js +4 -25
  293. package/cjs/render/contributions/render/contributions/polygon-contribution-render.js.map +1 -1
  294. package/cjs/render/contributions/render/contributions/rect-contribution-render.d.ts +5 -7
  295. package/cjs/render/contributions/render/contributions/rect-contribution-render.js +17 -37
  296. package/cjs/render/contributions/render/contributions/rect-contribution-render.js.map +1 -1
  297. package/cjs/render/contributions/render/contributions/symbol-contribution-render.d.ts +3 -7
  298. package/cjs/render/contributions/render/contributions/symbol-contribution-render.js +6 -27
  299. package/cjs/render/contributions/render/contributions/symbol-contribution-render.js.map +1 -1
  300. package/cjs/render/contributions/render/contributions/text-contribution-render.d.ts +8 -1
  301. package/cjs/render/contributions/render/contributions/text-contribution-render.js +25 -1
  302. package/cjs/render/contributions/render/contributions/text-contribution-render.js.map +1 -1
  303. package/cjs/render/contributions/render/draw-contribution.d.ts +7 -6
  304. package/cjs/render/contributions/render/draw-contribution.js +44 -26
  305. package/cjs/render/contributions/render/draw-contribution.js.map +1 -1
  306. package/cjs/render/contributions/render/draw-interceptor.d.ts +9 -1
  307. package/cjs/render/contributions/render/draw-interceptor.js +43 -28
  308. package/cjs/render/contributions/render/draw-interceptor.js.map +1 -1
  309. package/cjs/render/contributions/render/glyph-render.d.ts +1 -2
  310. package/cjs/render/contributions/render/glyph-render.js +13 -8
  311. package/cjs/render/contributions/render/glyph-render.js.map +1 -1
  312. package/cjs/render/contributions/render/group-render.js +3 -2
  313. package/cjs/render/contributions/render/group-render.js.map +1 -1
  314. package/cjs/render/contributions/render/image-render.js +4 -2
  315. package/cjs/render/contributions/render/image-render.js.map +1 -1
  316. package/cjs/render/contributions/render/incremental-draw-contribution.d.ts +2 -6
  317. package/cjs/render/contributions/render/incremental-draw-contribution.js +8 -11
  318. package/cjs/render/contributions/render/incremental-draw-contribution.js.map +1 -1
  319. package/cjs/render/contributions/render/line-render.d.ts +1 -0
  320. package/cjs/render/contributions/render/line-render.js +21 -6
  321. package/cjs/render/contributions/render/line-render.js.map +1 -1
  322. package/cjs/render/contributions/render/module.js +32 -87
  323. package/cjs/render/contributions/render/module.js.map +1 -1
  324. package/cjs/render/contributions/render/path-render.d.ts +2 -1
  325. package/cjs/render/contributions/render/path-render.js +8 -5
  326. package/cjs/render/contributions/render/path-render.js.map +1 -1
  327. package/cjs/render/contributions/render/polygon-render.js +2 -1
  328. package/cjs/render/contributions/render/polygon-render.js.map +1 -1
  329. package/cjs/render/contributions/render/rect-render.d.ts +2 -1
  330. package/cjs/render/contributions/render/rect-render.js +11 -5
  331. package/cjs/render/contributions/render/rect-render.js.map +1 -1
  332. package/cjs/render/contributions/render/render-slector.d.ts +1 -4
  333. package/cjs/render/contributions/render/render-slector.js +0 -20
  334. package/cjs/render/contributions/render/render-slector.js.map +1 -1
  335. package/cjs/render/contributions/render/richtext-render.d.ts +1 -0
  336. package/cjs/render/contributions/render/richtext-render.js +12 -7
  337. package/cjs/render/contributions/render/richtext-render.js.map +1 -1
  338. package/cjs/render/contributions/render/symbol-render.js +22 -5
  339. package/cjs/render/contributions/render/symbol-render.js.map +1 -1
  340. package/cjs/render/contributions/render/text-render.js +13 -10
  341. package/cjs/render/contributions/render/text-render.js.map +1 -1
  342. package/cjs/render/contributions/render/utils.js +2 -2
  343. package/cjs/render/contributions/render/utils.js.map +1 -1
  344. package/cjs/render/render-modules.js +1 -1
  345. package/cjs/render/render-modules.js.map +1 -1
  346. package/cjs/render/render-service.js +1 -1
  347. package/cjs/render/render-service.js.map +1 -1
  348. package/cjs/resource-loader/loader.js +1 -3
  349. package/cjs/resource-loader/loader.js.map +1 -1
  350. package/dist/index.js +6339 -6568
  351. package/dist/index.min.js +1 -1
  352. package/es/allocator/bounds-allocate.d.ts +13 -0
  353. package/es/allocator/bounds-allocate.js +32 -0
  354. package/es/allocator/bounds-allocate.js.map +1 -0
  355. package/es/allocator/canvas-allocate.d.ts +4 -0
  356. package/es/allocator/canvas-allocate.js +19 -6
  357. package/es/allocator/canvas-allocate.js.map +1 -1
  358. package/es/allocator/graphic-allocate.d.ts +56 -1
  359. package/es/allocator/graphic-allocate.js +155 -1
  360. package/es/allocator/graphic-allocate.js.map +1 -1
  361. package/es/animate/Ticker/default-ticker.js +4 -2
  362. package/es/animate/Ticker/default-ticker.js.map +1 -1
  363. package/es/animate/animate.js +3 -3
  364. package/es/animate/animate.js.map +1 -1
  365. package/es/animate/config.js +1 -2
  366. package/es/animate/custom-animate.d.ts +14 -3
  367. package/es/animate/custom-animate.js +103 -5
  368. package/es/animate/custom-animate.js.map +1 -1
  369. package/es/animate/default-ticker.js +2 -1
  370. package/es/canvas/contributions/base-canvas.js +4 -2
  371. package/es/canvas/contributions/base-canvas.js.map +1 -1
  372. package/es/common/Reflect-metadata.js +349 -359
  373. package/es/common/Reflect-metadata.js.map +1 -1
  374. package/es/common/bounds-context.js +2 -1
  375. package/es/common/inversify/annotation/inject.d.ts +1 -0
  376. package/es/common/inversify/annotation/inject.js +6 -0
  377. package/es/common/inversify/annotation/inject.js.map +1 -0
  378. package/es/common/inversify/annotation/inject_base.d.ts +14 -0
  379. package/es/common/inversify/annotation/inject_base.js +29 -0
  380. package/es/common/inversify/annotation/inject_base.js.map +1 -0
  381. package/es/common/inversify/annotation/injectable.d.ts +1 -0
  382. package/es/common/inversify/annotation/injectable.js +10 -0
  383. package/es/common/inversify/annotation/injectable.js.map +1 -0
  384. package/es/common/inversify/annotation/multi_inject.d.ts +1 -0
  385. package/es/common/inversify/annotation/multi_inject.js +6 -0
  386. package/es/common/inversify/annotation/multi_inject.js.map +1 -0
  387. package/es/common/inversify/annotation/named.d.ts +1 -0
  388. package/es/common/inversify/annotation/named.js +10 -0
  389. package/es/common/inversify/annotation/named.js.map +1 -0
  390. package/es/common/inversify/binding.d.ts +18 -0
  391. package/es/common/inversify/binding.js +22 -0
  392. package/es/common/inversify/binding.js.map +1 -0
  393. package/es/common/inversify/container.d.ts +28 -0
  394. package/es/common/inversify/container.js +155 -0
  395. package/es/common/inversify/container.js.map +1 -0
  396. package/es/common/inversify/cotainer-module.d.ts +6 -0
  397. package/es/common/inversify/cotainer-module.js +8 -0
  398. package/es/common/inversify/cotainer-module.js.map +1 -0
  399. package/es/common/inversify/index.d.ts +7 -0
  400. package/es/common/inversify/index.js +14 -0
  401. package/es/common/inversify/index.js.map +1 -0
  402. package/es/common/inversify/interfaces.d.ts +218 -0
  403. package/es/common/inversify/interfaces.js +2 -0
  404. package/es/common/inversify/interfaces.js.map +1 -0
  405. package/es/common/inversify/literal_types.d.ts +5 -0
  406. package/es/common/inversify/literal_types.js +20 -0
  407. package/es/common/inversify/literal_types.js.map +1 -0
  408. package/es/common/inversify/meta-data.d.ts +6 -0
  409. package/es/common/inversify/meta-data.js +11 -0
  410. package/es/common/inversify/meta-data.js.map +1 -0
  411. package/es/common/inversify/metadata_keys.d.ts +12 -0
  412. package/es/common/inversify/metadata_keys.js +28 -0
  413. package/es/common/inversify/metadata_keys.js.map +1 -0
  414. package/es/common/inversify/metadata_reader.d.ts +6 -0
  415. package/es/common/inversify/metadata_reader.js +18 -0
  416. package/es/common/inversify/metadata_reader.js.map +1 -0
  417. package/es/common/inversify/syntax/binding_in_syntax.d.ts +10 -0
  418. package/es/common/inversify/syntax/binding_in_syntax.js +24 -0
  419. package/es/common/inversify/syntax/binding_in_syntax.js.map +1 -0
  420. package/es/common/inversify/syntax/binding_to_syntax.d.ts +12 -0
  421. package/es/common/inversify/syntax/binding_to_syntax.js +36 -0
  422. package/es/common/inversify/syntax/binding_to_syntax.js.map +1 -0
  423. package/es/common/inversify/syntax/constraint_helpers.d.ts +2 -0
  424. package/es/common/inversify/syntax/constraint_helpers.js +18 -0
  425. package/es/common/inversify/syntax/constraint_helpers.js.map +1 -0
  426. package/es/common/inversify-lite/container/container.js +2 -4
  427. package/es/common/inversify-lite/container/container.js.map +1 -1
  428. package/es/common/inversify-lite/index.d.ts +1 -8
  429. package/es/common/inversify-lite/index.js +1 -15
  430. package/es/common/inversify-lite/index.js.map +1 -1
  431. package/es/common/inversify-lite/interfaces/interfaces.d.ts +0 -2
  432. package/es/common/inversify-lite/interfaces/interfaces.js.map +1 -1
  433. package/es/common/inversify-lite/planning/queryable_string.d.ts +0 -2
  434. package/es/common/inversify-lite/planning/queryable_string.js +0 -10
  435. package/es/common/inversify-lite/planning/queryable_string.js.map +1 -1
  436. package/es/common/inversify-lite/resolution/resolver.js.map +1 -1
  437. package/es/common/segment/monotone.js +2 -2
  438. package/es/common/segment/monotone.js.map +1 -1
  439. package/es/common/shape/rect.js +2 -1
  440. package/es/common/shape/rect.js.map +1 -1
  441. package/es/common/sort.js +1 -2
  442. package/es/common/store.js +2 -1
  443. package/es/common/utils.d.ts +1 -0
  444. package/es/common/utils.js +8 -1
  445. package/es/common/utils.js.map +1 -1
  446. package/es/common/xml/OrderedObjParser.js +2 -2
  447. package/es/common/xml/OrderedObjParser.js.map +1 -1
  448. package/es/core/contributions/layerHandler/canvas2d-contribution.d.ts +2 -2
  449. package/es/core/contributions/layerHandler/canvas2d-contribution.js +5 -9
  450. package/es/core/contributions/layerHandler/canvas2d-contribution.js.map +1 -1
  451. package/es/core/contributions/layerHandler/empty-contribution.d.ts +2 -2
  452. package/es/core/contributions/layerHandler/empty-contribution.js +5 -9
  453. package/es/core/contributions/layerHandler/empty-contribution.js.map +1 -1
  454. package/es/core/contributions/layerHandler/offscreen2d-contribution.d.ts +2 -2
  455. package/es/core/contributions/layerHandler/offscreen2d-contribution.js +5 -9
  456. package/es/core/contributions/layerHandler/offscreen2d-contribution.js.map +1 -1
  457. package/es/core/contributions/textMeasure/AtextMeasure.d.ts +14 -2
  458. package/es/core/contributions/textMeasure/AtextMeasure.js +99 -13
  459. package/es/core/contributions/textMeasure/AtextMeasure.js.map +1 -1
  460. package/es/core/contributions/textMeasure/layout.d.ts +2 -2
  461. package/es/core/contributions/textMeasure/layout.js +4 -4
  462. package/es/core/contributions/textMeasure/layout.js.map +1 -1
  463. package/es/core/contributions/textMeasure/modules.js +1 -1
  464. package/es/core/contributions/textMeasure/modules.js.map +1 -1
  465. package/es/core/core-modules.js +4 -6
  466. package/es/core/core-modules.js.map +1 -1
  467. package/es/core/global-module.js +2 -0
  468. package/es/core/global.d.ts +9 -0
  469. package/es/core/global.js +23 -4
  470. package/es/core/global.js.map +1 -1
  471. package/es/core/graphic-utils.d.ts +7 -4
  472. package/es/core/graphic-utils.js +20 -15
  473. package/es/core/graphic-utils.js.map +1 -1
  474. package/es/core/layer-service.d.ts +5 -2
  475. package/es/core/layer-service.js +18 -15
  476. package/es/core/layer-service.js.map +1 -1
  477. package/es/core/stage.d.ts +8 -4
  478. package/es/core/stage.js +47 -30
  479. package/es/core/stage.js.map +1 -1
  480. package/es/core/window.d.ts +2 -2
  481. package/es/core/window.js +8 -12
  482. package/es/core/window.js.map +1 -1
  483. package/es/env-check.d.ts +3 -0
  484. package/es/env-check.js +12 -0
  485. package/es/env-check.js.map +1 -0
  486. package/es/event/event-manager.d.ts +5 -1
  487. package/es/event/event-manager.js +32 -26
  488. package/es/event/event-manager.js.map +1 -1
  489. package/es/event/event-system.js +8 -6
  490. package/es/event/event-system.js.map +1 -1
  491. package/es/event/federated-event/base-event.d.ts +5 -6
  492. package/es/event/federated-event/base-event.js +15 -5
  493. package/es/event/federated-event/base-event.js.map +1 -1
  494. package/es/event/federated-event/mouse-event.d.ts +6 -6
  495. package/es/event/federated-event/mouse-event.js +16 -4
  496. package/es/event/federated-event/mouse-event.js.map +1 -1
  497. package/es/graphic/area.js +1 -0
  498. package/es/graphic/area.js.map +1 -1
  499. package/es/graphic/builtin-symbol/index.d.ts +1 -0
  500. package/es/graphic/builtin-symbol/index.js +7 -0
  501. package/es/graphic/builtin-symbol/index.js.map +1 -1
  502. package/es/graphic/builtin-symbol/rect.d.ts +2 -1
  503. package/es/graphic/builtin-symbol/rect.js +9 -4
  504. package/es/graphic/builtin-symbol/rect.js.map +1 -1
  505. package/es/graphic/config.js +12 -4
  506. package/es/graphic/config.js.map +1 -1
  507. package/es/graphic/graphic-service/arc-contribution.d.ts +1 -5
  508. package/es/graphic/graphic-service/arc-contribution.js +0 -15
  509. package/es/graphic/graphic-service/arc-contribution.js.map +1 -1
  510. package/es/graphic/graphic-service/area-contribution.d.ts +1 -1
  511. package/es/graphic/graphic-service/area-contribution.js +2 -1
  512. package/es/graphic/graphic-service/area-contribution.js.map +1 -1
  513. package/es/graphic/graphic-service/circle-contribution.d.ts +1 -5
  514. package/es/graphic/graphic-service/circle-contribution.js +0 -15
  515. package/es/graphic/graphic-service/circle-contribution.js.map +1 -1
  516. package/es/graphic/graphic-service/common-contribution.js +2 -14
  517. package/es/graphic/graphic-service/common-contribution.js.map +1 -1
  518. package/es/graphic/graphic-service/graphic-module.js +1 -23
  519. package/es/graphic/graphic-service/graphic-module.js.map +1 -1
  520. package/es/graphic/graphic-service/graphic-service.d.ts +5 -9
  521. package/es/graphic/graphic-service/graphic-service.js +44 -34
  522. package/es/graphic/graphic-service/graphic-service.js.map +1 -1
  523. package/es/graphic/graphic-service/path-contribution.d.ts +1 -5
  524. package/es/graphic/graphic-service/path-contribution.js +0 -15
  525. package/es/graphic/graphic-service/path-contribution.js.map +1 -1
  526. package/es/graphic/graphic-service/rect-contribution.d.ts +1 -5
  527. package/es/graphic/graphic-service/rect-contribution.js +0 -15
  528. package/es/graphic/graphic-service/rect-contribution.js.map +1 -1
  529. package/es/graphic/graphic-service/symbol-contribution.d.ts +0 -1
  530. package/es/graphic/graphic-service/symbol-contribution.js +2 -16
  531. package/es/graphic/graphic-service/symbol-contribution.js.map +1 -1
  532. package/es/graphic/graphic.js +8 -6
  533. package/es/graphic/graphic.js.map +1 -1
  534. package/es/graphic/group.d.ts +1 -0
  535. package/es/graphic/group.js +8 -1
  536. package/es/graphic/group.js.map +1 -1
  537. package/es/graphic/line.js +1 -0
  538. package/es/graphic/line.js.map +1 -1
  539. package/es/graphic/node-tree.js +2 -2
  540. package/es/graphic/node-tree.js.map +1 -1
  541. package/es/graphic/rect.d.ts +2 -3
  542. package/es/graphic/rect.js +3 -7
  543. package/es/graphic/rect.js.map +1 -1
  544. package/es/graphic/richtext/line.d.ts +1 -0
  545. package/es/graphic/richtext/line.js +6 -4
  546. package/es/graphic/richtext/line.js.map +1 -1
  547. package/es/graphic/richtext/paragraph.js +5 -2
  548. package/es/graphic/richtext/paragraph.js.map +1 -1
  549. package/es/graphic/richtext/utils.js +2 -1
  550. package/es/graphic/richtext/utils.js.map +1 -1
  551. package/es/graphic/richtext.d.ts +3 -3
  552. package/es/graphic/richtext.js +12 -3
  553. package/es/graphic/richtext.js.map +1 -1
  554. package/es/graphic/symbol.js +11 -10
  555. package/es/graphic/symbol.js.map +1 -1
  556. package/es/graphic/text.d.ts +1 -0
  557. package/es/graphic/text.js +94 -13
  558. package/es/graphic/text.js.map +1 -1
  559. package/es/graphic/theme.d.ts +4 -4
  560. package/es/graphic/theme.js +27 -28
  561. package/es/graphic/theme.js.map +1 -1
  562. package/es/graphic/tools.js +1 -1
  563. package/es/graphic/tools.js.map +1 -1
  564. package/es/graphic/wrap-text.js +6 -4
  565. package/es/graphic/wrap-text.js.map +1 -1
  566. package/es/index.d.ts +3 -0
  567. package/es/index.js +6 -0
  568. package/es/index.js.map +1 -1
  569. package/es/interface/allocator.d.ts +1 -0
  570. package/es/interface/allocator.js.map +1 -1
  571. package/es/interface/event.d.ts +15 -44
  572. package/es/interface/event.js.map +1 -1
  573. package/es/interface/global.d.ts +1 -0
  574. package/es/interface/global.js.map +1 -1
  575. package/es/interface/graphic/rect.d.ts +2 -0
  576. package/es/interface/graphic/rect.js.map +1 -1
  577. package/es/interface/graphic/richText.d.ts +1 -1
  578. package/es/interface/graphic/richText.js.map +1 -1
  579. package/es/interface/graphic/text.d.ts +5 -1
  580. package/es/interface/graphic/text.js.map +1 -1
  581. package/es/interface/graphic.d.ts +3 -2
  582. package/es/interface/graphic.js.map +1 -1
  583. package/es/interface/render.d.ts +2 -2
  584. package/es/interface/render.js.map +1 -1
  585. package/es/interface/stage.d.ts +8 -1
  586. package/es/interface/stage.js.map +1 -1
  587. package/es/interface/text.d.ts +2 -2
  588. package/es/interface/text.js.map +1 -1
  589. package/es/modules.d.ts +1 -2
  590. package/es/modules.js +0 -4
  591. package/es/modules.js.map +1 -1
  592. package/es/picker/global-picker-service.d.ts +2 -2
  593. package/es/picker/global-picker-service.js +5 -9
  594. package/es/picker/global-picker-service.js.map +1 -1
  595. package/es/picker/pick-interceptor.js +2 -1
  596. package/es/picker/pick-interceptor.js.map +1 -1
  597. package/es/picker/pick-modules.js +1 -4
  598. package/es/picker/pick-modules.js.map +1 -1
  599. package/es/picker/picker-service.d.ts +2 -2
  600. package/es/picker/picker-service.js +10 -6
  601. package/es/picker/picker-service.js.map +1 -1
  602. package/es/plugins/builtin-plugin/flex-layout-plugin.js +12 -6
  603. package/es/plugins/builtin-plugin/flex-layout-plugin.js.map +1 -1
  604. package/es/plugins/builtin-plugin/html-attribute-plugin.js +1 -1
  605. package/es/plugins/builtin-plugin/html-attribute-plugin.js.map +1 -1
  606. package/es/plugins/plugin-modules.js +1 -2
  607. package/es/plugins/plugin-modules.js.map +1 -1
  608. package/es/render/contributions/render/arc-render.js +3 -0
  609. package/es/render/contributions/render/arc-render.js.map +1 -1
  610. package/es/render/contributions/render/area-render.d.ts +1 -0
  611. package/es/render/contributions/render/area-render.js +45 -5
  612. package/es/render/contributions/render/area-render.js.map +1 -1
  613. package/es/render/contributions/render/base-render.d.ts +1 -1
  614. package/es/render/contributions/render/base-render.js +15 -22
  615. package/es/render/contributions/render/base-render.js.map +1 -1
  616. package/es/render/contributions/render/circle-render.js +3 -0
  617. package/es/render/contributions/render/circle-render.js.map +1 -1
  618. package/es/render/contributions/render/contributions/arc-contribution-render.d.ts +3 -7
  619. package/es/render/contributions/render/contributions/arc-contribution-render.js +6 -32
  620. package/es/render/contributions/render/contributions/arc-contribution-render.js.map +1 -1
  621. package/es/render/contributions/render/contributions/area-contribution-render.d.ts +3 -4
  622. package/es/render/contributions/render/contributions/area-contribution-render.js +5 -23
  623. package/es/render/contributions/render/contributions/area-contribution-render.js.map +1 -1
  624. package/es/render/contributions/render/contributions/base-contribution-render.d.ts +4 -0
  625. package/es/render/contributions/render/contributions/base-contribution-render.js +21 -16
  626. package/es/render/contributions/render/contributions/base-contribution-render.js.map +1 -1
  627. package/es/render/contributions/render/contributions/circle-contribution-render.d.ts +3 -7
  628. package/es/render/contributions/render/contributions/circle-contribution-render.js +6 -32
  629. package/es/render/contributions/render/contributions/circle-contribution-render.js.map +1 -1
  630. package/es/render/contributions/render/contributions/constants.d.ts +1 -0
  631. package/es/render/contributions/render/contributions/constants.js +2 -0
  632. package/es/render/contributions/render/contributions/constants.js.map +1 -1
  633. package/es/render/contributions/render/contributions/group-contribution-render.d.ts +1 -0
  634. package/es/render/contributions/render/contributions/group-contribution-render.js +5 -15
  635. package/es/render/contributions/render/contributions/group-contribution-render.js.map +1 -1
  636. package/es/render/contributions/render/contributions/image-contribution-render.d.ts +1 -0
  637. package/es/render/contributions/render/contributions/image-contribution-render.js +6 -17
  638. package/es/render/contributions/render/contributions/image-contribution-render.js.map +1 -1
  639. package/es/render/contributions/render/contributions/path-contribution-render.d.ts +2 -9
  640. package/es/render/contributions/render/contributions/path-contribution-render.js +3 -29
  641. package/es/render/contributions/render/contributions/path-contribution-render.js.map +1 -1
  642. package/es/render/contributions/render/contributions/polygon-contribution-render.d.ts +2 -9
  643. package/es/render/contributions/render/contributions/polygon-contribution-render.js +3 -29
  644. package/es/render/contributions/render/contributions/polygon-contribution-render.js.map +1 -1
  645. package/es/render/contributions/render/contributions/rect-contribution-render.d.ts +5 -7
  646. package/es/render/contributions/render/contributions/rect-contribution-render.js +19 -46
  647. package/es/render/contributions/render/contributions/rect-contribution-render.js.map +1 -1
  648. package/es/render/contributions/render/contributions/symbol-contribution-render.d.ts +3 -7
  649. package/es/render/contributions/render/contributions/symbol-contribution-render.js +6 -24
  650. package/es/render/contributions/render/contributions/symbol-contribution-render.js.map +1 -1
  651. package/es/render/contributions/render/contributions/text-contribution-render.d.ts +8 -1
  652. package/es/render/contributions/render/contributions/text-contribution-render.js +24 -1
  653. package/es/render/contributions/render/contributions/text-contribution-render.js.map +1 -1
  654. package/es/render/contributions/render/draw-contribution.d.ts +7 -6
  655. package/es/render/contributions/render/draw-contribution.js +49 -29
  656. package/es/render/contributions/render/draw-contribution.js.map +1 -1
  657. package/es/render/contributions/render/draw-interceptor.d.ts +9 -1
  658. package/es/render/contributions/render/draw-interceptor.js +40 -36
  659. package/es/render/contributions/render/draw-interceptor.js.map +1 -1
  660. package/es/render/contributions/render/glyph-render.d.ts +1 -2
  661. package/es/render/contributions/render/glyph-render.js +12 -9
  662. package/es/render/contributions/render/glyph-render.js.map +1 -1
  663. package/es/render/contributions/render/group-render.js +4 -1
  664. package/es/render/contributions/render/group-render.js.map +1 -1
  665. package/es/render/contributions/render/image-render.js +5 -2
  666. package/es/render/contributions/render/image-render.js.map +1 -1
  667. package/es/render/contributions/render/incremental-draw-contribution.d.ts +2 -6
  668. package/es/render/contributions/render/incremental-draw-contribution.js +5 -11
  669. package/es/render/contributions/render/incremental-draw-contribution.js.map +1 -1
  670. package/es/render/contributions/render/line-render.d.ts +1 -0
  671. package/es/render/contributions/render/line-render.js +21 -6
  672. package/es/render/contributions/render/line-render.js.map +1 -1
  673. package/es/render/contributions/render/module.js +29 -83
  674. package/es/render/contributions/render/module.js.map +1 -1
  675. package/es/render/contributions/render/path-render.d.ts +2 -1
  676. package/es/render/contributions/render/path-render.js +8 -4
  677. package/es/render/contributions/render/path-render.js.map +1 -1
  678. package/es/render/contributions/render/polygon-render.js +3 -0
  679. package/es/render/contributions/render/polygon-render.js.map +1 -1
  680. package/es/render/contributions/render/rect-render.d.ts +2 -1
  681. package/es/render/contributions/render/rect-render.js +11 -3
  682. package/es/render/contributions/render/rect-render.js.map +1 -1
  683. package/es/render/contributions/render/render-slector.d.ts +1 -4
  684. package/es/render/contributions/render/render-slector.js +0 -15
  685. package/es/render/contributions/render/render-slector.js.map +1 -1
  686. package/es/render/contributions/render/richtext-render.d.ts +1 -0
  687. package/es/render/contributions/render/richtext-render.js +12 -6
  688. package/es/render/contributions/render/richtext-render.js.map +1 -1
  689. package/es/render/contributions/render/symbol-render.js +23 -4
  690. package/es/render/contributions/render/symbol-render.js.map +1 -1
  691. package/es/render/contributions/render/text-render.js +16 -10
  692. package/es/render/contributions/render/text-render.js.map +1 -1
  693. package/es/render/contributions/render/utils.js +2 -2
  694. package/es/render/contributions/render/utils.js.map +1 -1
  695. package/es/render/render-modules.js +1 -1
  696. package/es/render/render-modules.js.map +1 -1
  697. package/es/render/render-service.js +1 -1
  698. package/es/render/render-service.js.map +1 -1
  699. package/es/resource-loader/loader.js +1 -3
  700. package/es/resource-loader/loader.js.map +1 -1
  701. package/package.json +6 -4
  702. package/cjs/common/inversify-lite/annotation/post_construct.d.ts +0 -4
  703. package/cjs/common/inversify-lite/annotation/post_construct.js.map +0 -1
  704. package/es/common/inversify-lite/annotation/post_construct.d.ts +0 -4
  705. package/es/common/inversify-lite/annotation/post_construct.js +0 -10
  706. package/es/common/inversify-lite/annotation/post_construct.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/render/contributions/render/base-render.ts"],"names":[],"mappings":";;;;;;AACA,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAgB5D,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACnF,OAAO,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxF,OAAO,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AAG5D,IAAe,UAAU,GAAzB,MAAe,UAAU;IAU9B,IAAI,CAAC,aAAiF;QACpF,IAAI,aAAa,EAAE;YACjB,IAAI,CAAC,mBAAmB,GAAG,aAAa,CAAC;YACzC,IAAI,CAAC,oBAAoB,GAAG,aAAa,CAAC,gBAAgB,EAAE,CAAC;YAC7D,IAAI,IAAI,CAAC,oBAAoB,CAAC,MAAM,EAAE;gBACpC,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC;gBAC5D,IAAI,CAAC,0BAA0B,GAAG,IAAI,CAAC,oBAAoB,CAAC,MAAM,CAChE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,0BAA0B,CAAC,gBAAgB,CAC5D,CAAC;gBACF,IAAI,CAAC,yBAAyB,GAAG,IAAI,CAAC,oBAAoB,CAAC,MAAM,CAC/D,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,0BAA0B,CAAC,eAAe,CAC3D,CAAC;aACH;SACF;IACH,CAAC;IAED,gBAAgB,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I,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;SACxC;QACD,OAAO,CAAC,WAAW,GAAG,eAAe,CAAC;QAEtC,OAAO,CAAC,sBAAsB,EAAE,CAAC;IACnC,CAAC;CAsHF,CAAA;AAtdqB,UAAU;IAD/B,UAAU,EAAE;GACS,UAAU,CAsd/B;SAtdqB,UAAU","file":"base-render.js","sourcesContent":["import type { IPointLike } from '@visactor/vutils';\nimport { injectable } from '../../../common/inversify-lite';\nimport type {\n IGraphicAttribute,\n ICamera,\n IContext2d,\n IGraphic,\n mat4,\n IRenderService,\n IDrawContext,\n IGraphicRenderDrawParams,\n IMarkAttribute,\n IThemeAttribute,\n IContributionProvider,\n ICircleRenderContribution,\n IBaseRenderContribution\n} from '../../../interface';\nimport { getModelMatrix, multiplyMat4Mat4, shouldUseMat4 } from '../../../graphic';\nimport { mat4Allocate } from '../../../allocator/matrix-allocate';\nimport { drawPathProxy, fillVisible, runFill, runStroke, strokeVisible } from './utils';\nimport { BaseRenderContributionTime } from '../../../common/enums';\n\n@injectable()\nexport abstract class BaseRender<T extends IGraphic> {\n camera: ICamera;\n declare z: number;\n\n declare renderContribitions: IContributionProvider<IBaseRenderContribution<T, T['attribute']>> | null;\n\n protected _beforeRenderContribitions: IBaseRenderContribution<T, T['attribute']>[];\n protected _afterRenderContribitions: IBaseRenderContribution<T, T['attribute']>[];\n protected _renderContribitions: IBaseRenderContribution<T, T['attribute']>[];\n\n init(contributions?: IContributionProvider<IBaseRenderContribution<T, T['attribute']>>) {\n if (contributions) {\n this.renderContribitions = contributions;\n this._renderContribitions = contributions.getContributions();\n if (this._renderContribitions.length) {\n this._renderContribitions.sort((a, b) => b.order - a.order);\n this._beforeRenderContribitions = this._renderContribitions.filter(\n c => c.time === BaseRenderContributionTime.beforeFillStroke\n );\n this._afterRenderContribitions = this._renderContribitions.filter(\n c => c.time === BaseRenderContributionTime.afterFillStroke\n );\n }\n }\n }\n\n beforeRenderStep(\n graphic: T,\n context: IContext2d,\n x: number,\n y: number,\n doFill: boolean,\n doStroke: boolean,\n fVisible: boolean,\n sVisible: boolean,\n graphicAttribute: Required<T['attribute']>,\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 params?: any\n ) {\n this._beforeRenderContribitions &&\n this._beforeRenderContribitions.forEach(c => {\n c.drawShape(\n graphic,\n context,\n x,\n y,\n doFill,\n doStroke,\n fVisible,\n sVisible,\n graphicAttribute,\n drawContext,\n fillCb,\n strokeCb,\n params\n );\n });\n }\n\n afterRenderStep(\n graphic: T,\n context: IContext2d,\n x: number,\n y: number,\n doFill: boolean,\n doStroke: boolean,\n fVisible: boolean,\n sVisible: boolean,\n graphicAttribute: Required<T['attribute']>,\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 params?: any\n ) {\n this._afterRenderContribitions &&\n this._afterRenderContribitions.forEach(c => {\n c.drawShape(\n graphic,\n context,\n x,\n y,\n doFill,\n doStroke,\n fVisible,\n sVisible,\n graphicAttribute,\n drawContext,\n fillCb,\n strokeCb,\n params\n );\n });\n }\n\n valid(graphic: IGraphic, defaultAttribute: IGraphicAttribute, fillCb?: any, strokeCb?: any) {\n const {\n fill = defaultAttribute.fill,\n background,\n stroke = defaultAttribute.stroke,\n opacity = defaultAttribute.opacity,\n fillOpacity = defaultAttribute.fillOpacity,\n lineWidth = defaultAttribute.lineWidth,\n strokeOpacity = defaultAttribute.strokeOpacity,\n visible = defaultAttribute.visible\n } = graphic.attribute;\n const fVisible = fillVisible(opacity, fillOpacity, fill);\n const sVisible = strokeVisible(opacity, strokeOpacity);\n const doFill = runFill(fill, background);\n const doStroke = runStroke(stroke, lineWidth);\n\n if (!(graphic.valid && visible)) {\n return false;\n }\n\n if (!(doFill || doStroke)) {\n return false;\n }\n\n // 如果存在fillCb和strokeCb,以及background那就不直接跳过\n if (!(fVisible || sVisible || fillCb || strokeCb || background)) {\n return false;\n }\n return {\n fVisible,\n sVisible,\n doFill,\n doStroke\n };\n }\n\n /**\n * 进行2d或3d变换\n * @param graphic\n * @param graphicAttribute\n * @param context\n * @param use3dMatrixIn3dMode 是否在3d模式使用3d矩阵\n * @returns\n */\n transform(\n graphic: IGraphic,\n graphicAttribute: IGraphicAttribute,\n context: IContext2d,\n use3dMatrixIn3dMode: boolean = false\n ): IPointLike & { z: number; lastModelMatrix: mat4 } {\n const transMatrix = graphic.transMatrix;\n const {\n x = graphicAttribute.x,\n y = graphicAttribute.y,\n z = graphicAttribute.z,\n scaleX = graphicAttribute.scaleX,\n scaleY = graphicAttribute.scaleY,\n angle = graphicAttribute.angle,\n postMatrix\n } = graphic.attribute;\n const onlyTranslate = transMatrix.onlyTranslate() && !postMatrix;\n\n // 存在3d变换的时候,需要计算3d矩阵\n const lastModelMatrix = context.modelMatrix;\n const camera = context.camera;\n const result: IPointLike & { z: number; lastModelMatrix: mat4 } = { x, y, z, lastModelMatrix };\n // 是否应该进行3d变换\n const shouldTransform3d = camera && (use3dMatrixIn3dMode || shouldUseMat4(graphic));\n if (shouldTransform3d) {\n const nextModelMatrix = mat4Allocate.allocate();\n // 计算模型矩阵\n const modelMatrix = mat4Allocate.allocate();\n getModelMatrix(modelMatrix, graphic, graphicAttribute);\n // 合并模型矩阵\n if (lastModelMatrix) {\n multiplyMat4Mat4(nextModelMatrix, lastModelMatrix, modelMatrix);\n } else {\n multiplyMat4Mat4(nextModelMatrix, nextModelMatrix, modelMatrix);\n }\n result.x = 0;\n result.y = 0;\n result.z = 0;\n context.modelMatrix = nextModelMatrix;\n context.setTransform(1, 0, 0, 1, 0, 0, true);\n mat4Allocate.free(modelMatrix);\n // 有旋转的情况下需要手动计算模型矩阵\n // TODO: 这里暂时都使用模型矩阵,因为视角旋转的时候如果当不固定角度那也需要用到模型矩阵\n }\n\n // 如果只有位移,且没计算3d变换矩阵,那么不设置context的2d矩阵\n if (onlyTranslate && !lastModelMatrix) {\n const point = graphic.getOffsetXY(graphicAttribute);\n result.x += point.x;\n result.y += point.y;\n result.z = z;\n // 当前context有rotate/scale,重置matrix\n context.setTransformForCurrent();\n } else if (shouldTransform3d) {\n // 如果计算了3d矩阵,那么就不需要2d矩阵计算了\n result.x = 0;\n result.y = 0;\n result.z = 0;\n context.setTransform(1, 0, 0, 1, 0, 0, true);\n } else {\n if (camera && context.project) {\n const point = graphic.getOffsetXY(graphicAttribute);\n result.x += point.x;\n result.y += point.y;\n // result.x = 0;\n // result.y = 0;\n // 位置直接通过project设置,而2d变换通过变换矩阵完成\n this.transformWithoutTranslate(context, result.x, result.y, result.z, scaleX, scaleY, angle);\n } else {\n // 如果是纯2d的情况,那么直接设置context的2d矩阵\n // 性能较差\n context.transformFromMatrix(graphic.transMatrix, true);\n result.x = 0;\n result.y = 0;\n result.z = 0;\n }\n }\n\n return result;\n }\n\n /**\n * 将3d的transform转成context2d的transform\n * @param graphic\n * @param graphicAttribute\n * @param z\n * @param context\n */\n transformUseContext2d(graphic: IGraphic, graphicAttribute: IGraphicAttribute, z: number, context: IContext2d) {\n const camera = context.camera;\n this.camera = camera;\n if (camera) {\n const bounds = graphic.AABBBounds;\n const width = bounds.x2 - bounds.x1;\n const height = bounds.y2 - bounds.y1;\n const p1 = context.project(0, 0, z);\n const p2 = context.project(width, 0, z);\n const p3 = context.project(width, height, z);\n const _p1 = { x: 0, y: 0 };\n const _p2 = { x: width, y: 0 };\n const _p3 = { x: width, y: height };\n\n context.camera = null;\n\n // 生成3维矩阵\n /* Adapted from phoria.js by ecomfe\n * https://github.com/kevinroast/phoria.js\n * Licensed under the BSD-3-Clause\n\n * url: https://github.com/kevinroast/phoria.js/blob/736c6b854a679df180f8a6e689aeb218efa6dc01/scripts/phoria-renderer.js\n * License: https://github.com/kevinroast/phoria.js/blob/master/LICENSE\n * @license\n */\n const denom = 1.0 / (_p1.x * (_p3.y - _p2.y) - _p2.x * _p3.y + _p3.x * _p2.y + (_p2.x - _p3.x) * _p1.y);\n // calculate context transformation matrix\n const m11 = -(_p1.y * (p3.x - p2.x) - _p2.y * p3.x + _p3.y * p2.x + (_p2.y - _p3.y) * p1.x) * denom;\n const m12 = (_p2.y * p3.y + _p1.y * (p2.y - p3.y) - _p3.y * p2.y + (_p3.y - _p2.y) * p1.y) * denom;\n const m21 = (_p1.x * (p3.x - p2.x) - _p2.x * p3.x + _p3.x * p2.x + (_p2.x - _p3.x) * p1.x) * denom;\n const m22 = -(_p2.x * p3.y + _p1.x * (p2.y - p3.y) - _p3.x * p2.y + (_p3.x - _p2.x) * p1.y) * denom;\n const dx =\n (_p1.x * (_p3.y * p2.x - _p2.y * p3.x) +\n _p1.y * (_p2.x * p3.x - _p3.x * p2.x) +\n (_p3.x * _p2.y - _p2.x * _p3.y) * p1.x) *\n denom;\n const dy =\n (_p1.x * (_p3.y * p2.y - _p2.y * p3.y) +\n _p1.y * (_p2.x * p3.y - _p3.x * p2.y) +\n (_p3.x * _p2.y - _p2.x * _p3.y) * p1.y) *\n denom;\n\n context.setTransform(m11, m12, m21, m22, dx, dy, true);\n }\n }\n\n /**\n * transformUseContext2d的后处理\n * @param graphic\n * @param graphicAttribute\n * @param z\n * @param context\n */\n restoreTransformUseContext2d(graphic: IGraphic, graphicAttribute: IGraphicAttribute, z: number, context: IContext2d) {\n if (this.camera) {\n context.camera = this.camera;\n }\n }\n\n protected transformWithoutTranslate(\n context: IContext2d,\n x: number,\n y: number,\n z: number,\n scaleX: number,\n scaleY: number,\n angle: number\n ) {\n const p = context.project(x, y, z);\n context.translate(p.x, p.y, false);\n context.scale(scaleX, scaleY, false);\n context.rotate(angle, false);\n context.translate(-p.x, -p.y, false);\n context.setTransformForCurrent();\n }\n\n _draw(\n graphic: T,\n defaultAttr: IGraphicAttribute,\n computed3dMatrix: boolean,\n drawContext: IDrawContext,\n params?: IGraphicRenderDrawParams\n ) {\n const { context } = drawContext;\n if (!context) {\n return;\n }\n\n context.highPerformanceSave();\n\n const data = this.transform(graphic, defaultAttr, context, computed3dMatrix);\n const { x, y, z, lastModelMatrix } = data;\n\n this.z = z;\n if (drawPathProxy(graphic, context, x, y, drawContext, params)) {\n context.highPerformanceRestore();\n return;\n }\n\n this.drawShape(graphic, context, x, y, drawContext, params);\n this.z = 0;\n\n if (context.modelMatrix !== lastModelMatrix) {\n mat4Allocate.free(context.modelMatrix);\n }\n context.modelMatrix = lastModelMatrix;\n\n context.highPerformanceRestore();\n }\n\n drawShape?(\n path: T,\n context: IContext2d,\n x: number,\n y: number,\n drawContext: IDrawContext,\n params?: IGraphicRenderDrawParams,\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 ): void;\n\n // abstract drawShape(\n // graphic: T,\n // context: IContext2d,\n // x: number,\n // y: number,\n // drawContext: IDrawContext,\n // params?: IGraphicRenderDrawParams,\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 // ): void;\n\n // drawPathProxy(\n // graphic: T,\n // context: IContext2d,\n // x: number,\n // y: number,\n // drawContext: IDrawContext,\n // params?: IGraphicRenderDrawParams,\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 // if (!graphic.pathProxy) {\n // return false;\n // }\n\n // const themeAttributes = getTheme(graphic)[graphic.type];\n\n // const {\n // fill = themeAttributes.fill == null ? !!graphic.attribute.fillColor : themeAttributes.fill,\n // stroke = themeAttributes.stroke == null ? !!graphic.attribute.strokeColor : themeAttributes.stroke,\n // opacity = themeAttributes.opacity,\n // fillOpacity = themeAttributes.fillOpacity,\n // lineWidth = themeAttributes.lineWidth,\n // strokeOpacity = themeAttributes.strokeOpacity,\n // visible = themeAttributes.visible\n // } = graphic.attribute;\n // // 不绘制或者透明\n // const fVisible = fillVisible(opacity, fillOpacity);\n // const sVisible = strokeVisible(opacity, strokeOpacity);\n // const doFill = runFill(fill);\n // const doStroke = runStroke(stroke, lineWidth);\n\n // if (!visible) {\n // return true;\n // }\n\n // if (!(doFill || doStroke)) {\n // return true;\n // }\n\n // // 如果存在fillCb和strokeCb,那就不直接跳过\n // if (!(fVisible || sVisible || fillCb || strokeCb)) {\n // return true;\n // }\n\n // context.beginPath();\n\n // const path = typeof graphic.pathProxy === 'function' ? graphic.pathProxy(graphic.attribute) : graphic.pathProxy;\n // renderCommandList(path.commandList, context, x, y);\n\n // // shadow\n // context.setShadowBlendStyle && context.setShadowBlendStyle(graphic, graphic.attribute, themeAttributes);\n\n // if (doStroke) {\n // if (strokeCb) {\n // strokeCb(context, graphic.attribute, themeAttributes);\n // } else if (sVisible) {\n // context.setStrokeStyle(graphic, graphic.attribute, 0, 0, themeAttributes);\n // context.stroke();\n // }\n // }\n // if (doFill) {\n // if (fillCb) {\n // fillCb(context, graphic.attribute, themeAttributes);\n // } else if (fVisible) {\n // context.setCommonStyle(graphic, graphic.attribute, 0, 0, themeAttributes);\n // context.fill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IAAI,aAAa,CAAC,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,WAAW,EAAE,MAAM,CAAC,EAAE;YAC9D,OAAO,CAAC,sBAAsB,EAAE,CAAC;YACjC,OAAO;SACR;QAED,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,WAAW,EAAE,MAAM,CAAC,CAAC;QAC5D,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;QAEX,IAAI,OAAO,CAAC,WAAW,KAAK,eAAe,EAAE;YAC3C,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;SACxC;QACD,OAAO,CAAC,WAAW,GAAG,eAAe,CAAC;QAEtC,OAAO,CAAC,sBAAsB,EAAE,CAAC;IACnC,CAAC;CAsHF","file":"base-render.js","sourcesContent":["import type { IPointLike } from '@visactor/vutils';\nimport { injectable } from '../../../common/inversify-lite';\nimport type {\n IGraphicAttribute,\n ICamera,\n IContext2d,\n IGraphic,\n mat4,\n IRenderService,\n IDrawContext,\n IGraphicRenderDrawParams,\n IMarkAttribute,\n IThemeAttribute,\n IContributionProvider,\n ICircleRenderContribution,\n IBaseRenderContribution\n} from '../../../interface';\nimport { getModelMatrix, multiplyMat4Mat4, shouldUseMat4 } from '../../../graphic';\nimport { mat4Allocate } from '../../../allocator/matrix-allocate';\nimport { drawPathProxy, fillVisible, runFill, runStroke, strokeVisible } from './utils';\nimport { BaseRenderContributionTime } from '../../../common/enums';\n\nconst result: IPointLike & { z: number; lastModelMatrix: mat4 } = { x: 0, y: 0, z: 0, lastModelMatrix: null };\n\nexport abstract class BaseRender<T extends IGraphic> {\n camera: ICamera;\n declare z: number;\n\n builtinContributions: IBaseRenderContribution<T, T['attribute']>[];\n\n // declare renderContribitions: IContributionProvider<IBaseRenderContribution<T, T['attribute']>> | null;\n\n protected _beforeRenderContribitions: IBaseRenderContribution<T, T['attribute']>[];\n protected _afterRenderContribitions: IBaseRenderContribution<T, T['attribute']>[];\n protected _renderContribitions: IBaseRenderContribution<T, T['attribute']>[];\n\n init(contributions?: IContributionProvider<IBaseRenderContribution<T, T['attribute']>>) {\n if (contributions) {\n // this.renderContribitions = contributions;\n this._renderContribitions = contributions.getContributions();\n }\n if (!this._renderContribitions) {\n this._renderContribitions = [];\n }\n this.builtinContributions && this.builtinContributions.forEach(item => this._renderContribitions.push(item));\n if (this._renderContribitions.length) {\n this._renderContribitions.sort((a, b) => b.order - a.order);\n this._beforeRenderContribitions = this._renderContribitions.filter(\n c => c.time === BaseRenderContributionTime.beforeFillStroke\n );\n this._afterRenderContribitions = this._renderContribitions.filter(\n c => c.time === BaseRenderContributionTime.afterFillStroke\n );\n }\n }\n\n beforeRenderStep(\n graphic: T,\n context: IContext2d,\n x: number,\n y: number,\n doFill: boolean,\n doStroke: boolean,\n fVisible: boolean,\n sVisible: boolean,\n graphicAttribute: Required<T['attribute']>,\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 params?: any\n ) {\n this._beforeRenderContribitions &&\n this._beforeRenderContribitions.forEach(c => {\n c.drawShape(\n graphic,\n context,\n x,\n y,\n doFill,\n doStroke,\n fVisible,\n sVisible,\n graphicAttribute,\n drawContext,\n fillCb,\n strokeCb,\n params\n );\n });\n }\n\n afterRenderStep(\n graphic: T,\n context: IContext2d,\n x: number,\n y: number,\n doFill: boolean,\n doStroke: boolean,\n fVisible: boolean,\n sVisible: boolean,\n graphicAttribute: Required<T['attribute']>,\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 params?: any\n ) {\n this._afterRenderContribitions &&\n this._afterRenderContribitions.forEach(c => {\n c.drawShape(\n graphic,\n context,\n x,\n y,\n doFill,\n doStroke,\n fVisible,\n sVisible,\n graphicAttribute,\n drawContext,\n fillCb,\n strokeCb,\n params\n );\n });\n }\n\n valid(graphic: IGraphic, defaultAttribute: IGraphicAttribute, fillCb?: any, strokeCb?: any) {\n const {\n fill = defaultAttribute.fill,\n background,\n stroke = defaultAttribute.stroke,\n opacity = defaultAttribute.opacity,\n fillOpacity = defaultAttribute.fillOpacity,\n lineWidth = defaultAttribute.lineWidth,\n strokeOpacity = defaultAttribute.strokeOpacity,\n visible = defaultAttribute.visible\n } = graphic.attribute;\n const fVisible = fillVisible(opacity, fillOpacity, fill);\n const sVisible = strokeVisible(opacity, strokeOpacity);\n const doFill = runFill(fill, background);\n const doStroke = runStroke(stroke, lineWidth);\n\n if (!(graphic.valid && visible)) {\n return false;\n }\n\n if (!(doFill || doStroke)) {\n return false;\n }\n\n // 如果存在fillCb和strokeCb,以及background那就不直接跳过\n if (!(fVisible || sVisible || fillCb || strokeCb || background)) {\n return false;\n }\n return {\n fVisible,\n sVisible,\n doFill,\n doStroke\n };\n }\n\n /**\n * 进行2d或3d变换\n * @param graphic\n * @param graphicAttribute\n * @param context\n * @param use3dMatrixIn3dMode 是否在3d模式使用3d矩阵\n * @returns\n */\n transform(\n graphic: IGraphic,\n graphicAttribute: IGraphicAttribute,\n context: IContext2d,\n use3dMatrixIn3dMode: boolean = false\n ): IPointLike & { z: number; lastModelMatrix: mat4 } {\n // const transMatrix = graphic.transMatrix;\n const {\n x = graphicAttribute.x,\n y = graphicAttribute.y,\n z = graphicAttribute.z,\n scaleX = graphicAttribute.scaleX,\n scaleY = graphicAttribute.scaleY,\n angle = graphicAttribute.angle,\n postMatrix\n } = graphic.attribute;\n // const onlyTranslate = transMatrix.onlyTranslate() && !postMatrix;\n\n // 存在3d变换的时候,需要计算3d矩阵\n const lastModelMatrix = context.modelMatrix;\n const camera = context.camera;\n // const result: IPointLike & { z: number; lastModelMatrix: mat4 } = { x, y, z, lastModelMatrix };\n result.x = x;\n result.y = y;\n result.z = z;\n result.lastModelMatrix = lastModelMatrix;\n\n // 是否应该进行3d变换\n const shouldTransform3d = camera && (use3dMatrixIn3dMode || shouldUseMat4(graphic));\n\n // 是否仅有translate\n const onlyTranslate = shouldTransform3d\n ? graphic.transMatrix.onlyTranslate() && !postMatrix\n : scaleX === 1 && scaleY === 1 && angle === 0 && !postMatrix;\n\n if (shouldTransform3d) {\n const nextModelMatrix = mat4Allocate.allocate();\n // 计算模型矩阵\n const modelMatrix = mat4Allocate.allocate();\n getModelMatrix(modelMatrix, graphic, graphicAttribute);\n // 合并模型矩阵\n if (lastModelMatrix) {\n multiplyMat4Mat4(nextModelMatrix, lastModelMatrix, modelMatrix);\n } else {\n multiplyMat4Mat4(nextModelMatrix, nextModelMatrix, modelMatrix);\n }\n result.x = 0;\n result.y = 0;\n result.z = 0;\n context.modelMatrix = nextModelMatrix;\n context.setTransform(1, 0, 0, 1, 0, 0, true);\n mat4Allocate.free(modelMatrix);\n // 有旋转的情况下需要手动计算模型矩阵\n // TODO: 这里暂时都使用模型矩阵,因为视角旋转的时候如果当不固定角度那也需要用到模型矩阵\n }\n\n // 如果只有位移,且没计算3d变换矩阵,那么不设置context的2d矩阵\n if (onlyTranslate && !lastModelMatrix) {\n const point = graphic.getOffsetXY(graphicAttribute);\n result.x += point.x;\n result.y += point.y;\n result.z = z;\n // 当前context有rotate/scale,重置matrix\n context.setTransformForCurrent();\n } else if (shouldTransform3d) {\n // 如果计算了3d矩阵,那么就不需要2d矩阵计算了\n result.x = 0;\n result.y = 0;\n result.z = 0;\n context.setTransform(1, 0, 0, 1, 0, 0, true);\n } else {\n if (camera && context.project) {\n const point = graphic.getOffsetXY(graphicAttribute);\n result.x += point.x;\n result.y += point.y;\n // result.x = 0;\n // result.y = 0;\n // 位置直接通过project设置,而2d变换通过变换矩阵完成\n this.transformWithoutTranslate(context, result.x, result.y, result.z, scaleX, scaleY, angle);\n } else {\n // 如果是纯2d的情况,那么直接设置context的2d矩阵\n // 性能较差\n context.transformFromMatrix(graphic.transMatrix, true);\n result.x = 0;\n result.y = 0;\n result.z = 0;\n }\n }\n\n return result;\n }\n\n /**\n * 将3d的transform转成context2d的transform\n * @param graphic\n * @param graphicAttribute\n * @param z\n * @param context\n */\n transformUseContext2d(graphic: IGraphic, graphicAttribute: IGraphicAttribute, z: number, context: IContext2d) {\n const camera = context.camera;\n this.camera = camera;\n if (camera) {\n const bounds = graphic.AABBBounds;\n const width = bounds.x2 - bounds.x1;\n const height = bounds.y2 - bounds.y1;\n const p1 = context.project(0, 0, z);\n const p2 = context.project(width, 0, z);\n const p3 = context.project(width, height, z);\n const _p1 = { x: 0, y: 0 };\n const _p2 = { x: width, y: 0 };\n const _p3 = { x: width, y: height };\n\n context.camera = null;\n\n // 生成3维矩阵\n /* Adapted from phoria.js by ecomfe\n * https://github.com/kevinroast/phoria.js\n * Licensed under the BSD-3-Clause\n\n * url: https://github.com/kevinroast/phoria.js/blob/736c6b854a679df180f8a6e689aeb218efa6dc01/scripts/phoria-renderer.js\n * License: https://github.com/kevinroast/phoria.js/blob/master/LICENSE\n * @license\n */\n const denom = 1.0 / (_p1.x * (_p3.y - _p2.y) - _p2.x * _p3.y + _p3.x * _p2.y + (_p2.x - _p3.x) * _p1.y);\n // calculate context transformation matrix\n const m11 = -(_p1.y * (p3.x - p2.x) - _p2.y * p3.x + _p3.y * p2.x + (_p2.y - _p3.y) * p1.x) * denom;\n const m12 = (_p2.y * p3.y + _p1.y * (p2.y - p3.y) - _p3.y * p2.y + (_p3.y - _p2.y) * p1.y) * denom;\n const m21 = (_p1.x * (p3.x - p2.x) - _p2.x * p3.x + _p3.x * p2.x + (_p2.x - _p3.x) * p1.x) * denom;\n const m22 = -(_p2.x * p3.y + _p1.x * (p2.y - p3.y) - _p3.x * p2.y + (_p3.x - _p2.x) * p1.y) * denom;\n const dx =\n (_p1.x * (_p3.y * p2.x - _p2.y * p3.x) +\n _p1.y * (_p2.x * p3.x - _p3.x * p2.x) +\n (_p3.x * _p2.y - _p2.x * _p3.y) * p1.x) *\n denom;\n const dy =\n (_p1.x * (_p3.y * p2.y - _p2.y * p3.y) +\n _p1.y * (_p2.x * p3.y - _p3.x * p2.y) +\n (_p3.x * _p2.y - _p2.x * _p3.y) * p1.y) *\n denom;\n\n context.setTransform(m11, m12, m21, m22, dx, dy, true);\n }\n }\n\n /**\n * transformUseContext2d的后处理\n * @param graphic\n * @param graphicAttribute\n * @param z\n * @param context\n */\n restoreTransformUseContext2d(graphic: IGraphic, graphicAttribute: IGraphicAttribute, z: number, context: IContext2d) {\n if (this.camera) {\n context.camera = this.camera;\n }\n }\n\n protected transformWithoutTranslate(\n context: IContext2d,\n x: number,\n y: number,\n z: number,\n scaleX: number,\n scaleY: number,\n angle: number\n ) {\n const p = context.project(x, y, z);\n context.translate(p.x, p.y, false);\n context.scale(scaleX, scaleY, false);\n context.rotate(angle, false);\n context.translate(-p.x, -p.y, false);\n context.setTransformForCurrent();\n }\n\n _draw(\n graphic: T,\n defaultAttr: IGraphicAttribute,\n computed3dMatrix: boolean,\n drawContext: IDrawContext,\n params?: IGraphicRenderDrawParams\n ) {\n const { context } = drawContext;\n if (!context) {\n return;\n }\n\n context.highPerformanceSave();\n\n const data = this.transform(graphic, defaultAttr, context, computed3dMatrix);\n const { x, y, z, lastModelMatrix } = data;\n\n this.z = z;\n if (drawPathProxy(graphic, context, x, y, drawContext, params)) {\n context.highPerformanceRestore();\n return;\n }\n\n this.drawShape(graphic, context, x, y, drawContext, params);\n this.z = 0;\n\n if (context.modelMatrix !== lastModelMatrix) {\n mat4Allocate.free(context.modelMatrix);\n }\n context.modelMatrix = lastModelMatrix;\n\n context.highPerformanceRestore();\n }\n\n drawShape?(\n path: T,\n context: IContext2d,\n x: number,\n y: number,\n drawContext: IDrawContext,\n params?: IGraphicRenderDrawParams,\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 ): void;\n\n // abstract drawShape(\n // graphic: T,\n // context: IContext2d,\n // x: number,\n // y: number,\n // drawContext: IDrawContext,\n // params?: IGraphicRenderDrawParams,\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 // ): void;\n\n // drawPathProxy(\n // graphic: T,\n // context: IContext2d,\n // x: number,\n // y: number,\n // drawContext: IDrawContext,\n // params?: IGraphicRenderDrawParams,\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 // if (!graphic.pathProxy) {\n // return false;\n // }\n\n // const themeAttributes = getTheme(graphic)[graphic.type];\n\n // const {\n // fill = themeAttributes.fill == null ? !!graphic.attribute.fillColor : themeAttributes.fill,\n // stroke = themeAttributes.stroke == null ? !!graphic.attribute.strokeColor : themeAttributes.stroke,\n // opacity = themeAttributes.opacity,\n // fillOpacity = themeAttributes.fillOpacity,\n // lineWidth = themeAttributes.lineWidth,\n // strokeOpacity = themeAttributes.strokeOpacity,\n // visible = themeAttributes.visible\n // } = graphic.attribute;\n // // 不绘制或者透明\n // const fVisible = fillVisible(opacity, fillOpacity);\n // const sVisible = strokeVisible(opacity, strokeOpacity);\n // const doFill = runFill(fill);\n // const doStroke = runStroke(stroke, lineWidth);\n\n // if (!visible) {\n // return true;\n // }\n\n // if (!(doFill || doStroke)) {\n // return true;\n // }\n\n // // 如果存在fillCb和strokeCb,那就不直接跳过\n // if (!(fVisible || sVisible || fillCb || strokeCb)) {\n // return true;\n // }\n\n // context.beginPath();\n\n // const path = typeof graphic.pathProxy === 'function' ? graphic.pathProxy(graphic.attribute) : graphic.pathProxy;\n // renderCommandList(path.commandList, context, x, y);\n\n // // shadow\n // context.setShadowBlendStyle && context.setShadowBlendStyle(graphic, graphic.attribute, themeAttributes);\n\n // if (doStroke) {\n // if (strokeCb) {\n // strokeCb(context, graphic.attribute, themeAttributes);\n // } else if (sVisible) {\n // context.setStrokeStyle(graphic, graphic.attribute, 0, 0, themeAttributes);\n // context.stroke();\n // }\n // }\n // if (doFill) {\n // if (fillCb) {\n // fillCb(context, graphic.attribute, themeAttributes);\n // } else if (fVisible) {\n // context.setCommonStyle(graphic, graphic.attribute, 0, 0, themeAttributes);\n // context.fill();\n // }\n // }\n // return true;\n // }\n}\n"]}
@@ -22,9 +22,12 @@ import { ContributionProvider } from "../../../common/contribution-provider";
22
22
 
23
23
  import { BaseRender } from "./base-render";
24
24
 
25
+ import { defaultCircleBackgroundRenderContribution, defaultCircleRenderContribution, defaultCircleTextureRenderContribution } from "./contributions";
26
+
25
27
  let DefaultCanvasCircleRender = class extends BaseRender {
26
28
  constructor(circleRenderContribitions) {
27
29
  super(), this.circleRenderContribitions = circleRenderContribitions, this.numberType = CIRCLE_NUMBER_TYPE,
30
+ this.builtinContributions = [ defaultCircleRenderContribution, defaultCircleBackgroundRenderContribution, defaultCircleTextureRenderContribution ],
28
31
  this.init(circleRenderContribitions);
29
32
  }
30
33
  drawShape(circle, context, x, y, drawContext, params, fillCb, strokeCb) {
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/render/contributions/render/circle-render.ts"],"names":[],"mappings":";;;;;;;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AAM,EACN,OAAO,EACP,CAAC,EACD,CAAC,EACD,MAAM,EACN,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,eAAe,EACf,WAAW,EACX,MAAM,EACN,QAAQ,CACT,CAAC;IACJ,CAAC;IAED,IAAI,CAAC,MAAe,EAAE,aAA6B,EAAE,WAAyB,EAAE,MAAiC;QAC/G,MAAM,eAAe,GAAG,QAAQ,CAAC,MAAM,EAAE,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,KAAK,CAAC,CAAC,MAAM,CAAC;QAC/D,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,eAAe,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,CAAC,CAAC;IAClE,CAAC;CACF,CAAA;AA3GY,yBAAyB;IADrC,UAAU,EAAE;IAMR,WAAA,MAAM,CAAC,oBAAoB,CAAC,CAAA;IAC5B,WAAA,KAAK,CAAC,wBAAwB,CAAC,CAAA;;GANvB,yBAAyB,CA2GrC;SA3GY,yBAAyB","file":"circle-render.js","sourcesContent":["import { inject, injectable, named } from '../../../common/inversify-lite';\nimport type {\n IGraphicAttribute,\n ICircle,\n IContext2d,\n IMarkAttribute,\n IThemeAttribute,\n ICircleRenderContribution,\n IDrawContext,\n IRenderService,\n IGraphicRender,\n IGraphicRenderDrawParams,\n IContributionProvider\n} from '../../../interface';\nimport { getTheme } from '../../../graphic/theme';\nimport { CIRCLE_NUMBER_TYPE } from '../../../graphic/constants';\nimport { CircleRenderContribution } from './contributions/constants';\n// eslint-disable-next-line @typescript-eslint/consistent-type-imports\nimport { ContributionProvider } from '../../../common/contribution-provider';\nimport { drawPathProxy, fillVisible, runFill, runStroke, strokeVisible } from './utils';\nimport { BaseRenderContributionTime } from '../../../common/enums';\nimport { BaseRender } from './base-render';\n\n@injectable()\nexport class DefaultCanvasCircleRender extends BaseRender<ICircle> implements IGraphicRender {\n type: 'circle';\n numberType: number = CIRCLE_NUMBER_TYPE;\n\n constructor(\n @inject(ContributionProvider)\n @named(CircleRenderContribution)\n protected readonly circleRenderContribitions: IContributionProvider<ICircleRenderContribution>\n ) {\n super();\n this.init(circleRenderContribitions);\n }\n\n drawShape(\n circle: ICircle,\n context: IContext2d,\n x: number,\n y: number,\n drawContext: IDrawContext,\n params?: IGraphicRenderDrawParams,\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 circleAttribute = graphicService.themeService.getCurrentTheme().circleAttribute;\n const circleAttribute = getTheme(circle, params?.theme).circle;\n const {\n radius = circleAttribute.radius,\n startAngle = circleAttribute.startAngle,\n endAngle = circleAttribute.endAngle,\n x: originX = circleAttribute.x,\n y: originY = circleAttribute.y\n } = circle.attribute;\n\n const data = this.valid(circle, circleAttribute, fillCb, strokeCb);\n if (!data) {\n return;\n }\n const { fVisible, sVisible, doFill, doStroke } = data;\n\n context.beginPath();\n context.arc(x, y, radius, startAngle, endAngle);\n context.closePath();\n\n // shadow\n context.setShadowBlendStyle && context.setShadowBlendStyle(circle, circle.attribute, circleAttribute);\n\n this.beforeRenderStep(\n circle,\n context,\n x,\n y,\n doFill,\n doStroke,\n fVisible,\n sVisible,\n circleAttribute,\n drawContext,\n fillCb,\n strokeCb\n );\n\n if (doFill) {\n if (fillCb) {\n fillCb(context, circle.attribute, circleAttribute);\n } else if (fVisible) {\n context.setCommonStyle(circle, circle.attribute, originX - x, originY - y, circleAttribute);\n context.fill();\n }\n }\n\n if (doStroke) {\n if (strokeCb) {\n strokeCb(context, circle.attribute, circleAttribute);\n } else if (sVisible) {\n context.setStrokeStyle(circle, circle.attribute, originX - x, originY - y, circleAttribute);\n context.stroke();\n }\n }\n\n this.afterRenderStep(\n circle,\n context,\n x,\n y,\n doFill,\n doStroke,\n fVisible,\n sVisible,\n circleAttribute,\n drawContext,\n fillCb,\n strokeCb\n );\n }\n\n draw(circle: ICircle, renderService: IRenderService, drawContext: IDrawContext, params?: IGraphicRenderDrawParams) {\n const circleAttribute = getTheme(circle, params?.theme).circle;\n this._draw(circle, circleAttribute, false, drawContext, params);\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/render/contributions/render/circle-render.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,gCAAgC,CAAC;AAc3E,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AAErE,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAC7E,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EACL,yCAAyC,EACzC,+BAA+B,EAC/B,sCAAsC,EACvC,MAAM,iBAAiB,CAAC;AAGlB,IAAM,yBAAyB,GAA/B,MAAM,yBAA0B,SAAQ,UAAmB;IAIhE,YAGqB,yBAA2E;QAE9F,KAAK,EAAE,CAAC;QAFW,8BAAyB,GAAzB,yBAAyB,CAAkD;QALhG,eAAU,GAAW,kBAAkB,CAAC;QAQtC,IAAI,CAAC,oBAAoB,GAAG;YAC1B,+BAA+B;YAC/B,yCAAyC;YACzC,sCAAsC;SACvC,CAAC;QACF,IAAI,CAAC,IAAI,CAAC,yBAAyB,CAAC,CAAC;IACvC,CAAC;IAED,SAAS,CACP,MAAe,EACf,OAAmB,EACnB,CAAS,EACT,CAAS,EACT,WAAyB,EACzB,MAAiC,EACjC,MAIY,EACZ,QAIY;QAGZ,MAAM,eAAe,GAAG,QAAQ,CAAC,MAAM,EAAE,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,KAAK,CAAC,CAAC,MAAM,CAAC;QAC/D,MAAM,EACJ,MA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,CAAC,IAAI,EAAE,CAAC;aAChB;SACF;QAED,IAAI,QAAQ,EAAE;YACZ,IAAI,QAAQ,EAAE;gBACZ,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC,SAAS,EAAE,eAAe,CAAC,CAAC;aACtD;iBAAM,IAAI,QAAQ,EAAE;gBACnB,OAAO,CAAC,cAAc,CAAC,MAAM,EAAE,MAAM,CAAC,SAAS,EAAE,OAAO,GAAG,CAAC,EAAE,OAAO,GAAG,CAAC,EAAE,eAAe,CAAC,CAAC;gBAC5F,OAAO,CAAC,MAAM,EAAE,CAAC;aAClB;SACF;QAED,IAAI,CAAC,eAAe,CAClB,MAAM,EACN,OAAO,EACP,CAAC,EACD,CAAC,EACD,MAAM,EACN,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,eAAe,EACf,WAAW,EACX,MAAM,EACN,QAAQ,CACT,CAAC;IACJ,CAAC;IAED,IAAI,CAAC,MAAe,EAAE,aAA6B,EAAE,WAAyB,EAAE,MAAiC;QAC/G,MAAM,eAAe,GAAG,QAAQ,CAAC,MAAM,EAAE,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,KAAK,CAAC,CAAC,MAAM,CAAC;QAC/D,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,eAAe,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,CAAC,CAAC;IAClE,CAAC;CACF,CAAA;AAhHY,yBAAyB;IADrC,UAAU,EAAE;IAMR,WAAA,MAAM,CAAC,oBAAoB,CAAC,CAAA;IAC5B,WAAA,KAAK,CAAC,wBAAwB,CAAC,CAAA;;GANvB,yBAAyB,CAgHrC;SAhHY,yBAAyB","file":"circle-render.js","sourcesContent":["import { inject, injectable, named } from '../../../common/inversify-lite';\nimport type {\n IGraphicAttribute,\n ICircle,\n IContext2d,\n IMarkAttribute,\n IThemeAttribute,\n ICircleRenderContribution,\n IDrawContext,\n IRenderService,\n IGraphicRender,\n IGraphicRenderDrawParams,\n IContributionProvider\n} from '../../../interface';\nimport { getTheme } from '../../../graphic/theme';\nimport { CIRCLE_NUMBER_TYPE } from '../../../graphic/constants';\nimport { CircleRenderContribution } from './contributions/constants';\n// eslint-disable-next-line @typescript-eslint/consistent-type-imports\nimport { ContributionProvider } from '../../../common/contribution-provider';\nimport { BaseRender } from './base-render';\nimport {\n defaultCircleBackgroundRenderContribution,\n defaultCircleRenderContribution,\n defaultCircleTextureRenderContribution\n} from './contributions';\n\n@injectable()\nexport class DefaultCanvasCircleRender extends BaseRender<ICircle> implements IGraphicRender {\n type: 'circle';\n numberType: number = CIRCLE_NUMBER_TYPE;\n\n constructor(\n @inject(ContributionProvider)\n @named(CircleRenderContribution)\n protected readonly circleRenderContribitions: IContributionProvider<ICircleRenderContribution>\n ) {\n super();\n this.builtinContributions = [\n defaultCircleRenderContribution,\n defaultCircleBackgroundRenderContribution,\n defaultCircleTextureRenderContribution\n ];\n this.init(circleRenderContribitions);\n }\n\n drawShape(\n circle: ICircle,\n context: IContext2d,\n x: number,\n y: number,\n drawContext: IDrawContext,\n params?: IGraphicRenderDrawParams,\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 circleAttribute = graphicService.themeService.getCurrentTheme().circleAttribute;\n const circleAttribute = getTheme(circle, params?.theme).circle;\n const {\n radius = circleAttribute.radius,\n startAngle = circleAttribute.startAngle,\n endAngle = circleAttribute.endAngle,\n x: originX = circleAttribute.x,\n y: originY = circleAttribute.y\n } = circle.attribute;\n\n const data = this.valid(circle, circleAttribute, fillCb, strokeCb);\n if (!data) {\n return;\n }\n const { fVisible, sVisible, doFill, doStroke } = data;\n\n context.beginPath();\n context.arc(x, y, radius, startAngle, endAngle);\n context.closePath();\n\n // shadow\n context.setShadowBlendStyle && context.setShadowBlendStyle(circle, circle.attribute, circleAttribute);\n\n this.beforeRenderStep(\n circle,\n context,\n x,\n y,\n doFill,\n doStroke,\n fVisible,\n sVisible,\n circleAttribute,\n drawContext,\n fillCb,\n strokeCb\n );\n\n if (doFill) {\n if (fillCb) {\n fillCb(context, circle.attribute, circleAttribute);\n } else if (fVisible) {\n context.setCommonStyle(circle, circle.attribute, originX - x, originY - y, circleAttribute);\n context.fill();\n }\n }\n\n if (doStroke) {\n if (strokeCb) {\n strokeCb(context, circle.attribute, circleAttribute);\n } else if (sVisible) {\n context.setStrokeStyle(circle, circle.attribute, originX - x, originY - y, circleAttribute);\n context.stroke();\n }\n }\n\n this.afterRenderStep(\n circle,\n context,\n x,\n y,\n doFill,\n doStroke,\n fVisible,\n sVisible,\n circleAttribute,\n drawContext,\n fillCb,\n strokeCb\n );\n }\n\n draw(circle: ICircle, renderService: IRenderService, drawContext: IDrawContext, params?: IGraphicRenderDrawParams) {\n const circleAttribute = getTheme(circle, params?.theme).circle;\n this._draw(circle, circleAttribute, false, drawContext, params);\n }\n}\n"]}
@@ -1,5 +1,4 @@
1
1
  import type { IGraphicAttribute, IContext2d, IMarkAttribute, IArc, IArcGraphicAttribute, IThemeAttribute, IArcRenderContribution, IDrawContext } from '../../../../interface';
2
- import { DefaultBaseBackgroundRenderContribution, DefaultBaseTextureRenderContribution } from './base-contribution-render';
3
2
  import { BaseRenderContributionTime } from '../../../../common/enums';
4
3
  export declare class DefaultArcRenderContribution implements IArcRenderContribution {
5
4
  time: BaseRenderContributionTime;
@@ -7,9 +6,6 @@ export declare class DefaultArcRenderContribution implements IArcRenderContribut
7
6
  order: number;
8
7
  drawShape(arc: IArc, context: IContext2d, x: number, y: number, doFill: boolean, doStroke: boolean, fVisible: boolean, sVisible: boolean, arcAttribute: Required<IArcGraphicAttribute>, drawContext: IDrawContext, fillCb?: (ctx: IContext2d, markAttribute: Partial<IMarkAttribute & IGraphicAttribute>, themeAttribute: IThemeAttribute) => boolean, strokeCb?: (ctx: IContext2d, markAttribute: Partial<IMarkAttribute & IGraphicAttribute>, themeAttribute: IThemeAttribute) => boolean): void;
9
8
  }
10
- export declare class DefaultArcBackgroundRenderContribution extends DefaultBaseBackgroundRenderContribution implements IArcRenderContribution {
11
- time: BaseRenderContributionTime;
12
- }
13
- export declare class DefaultArcTextureRenderContribution extends DefaultBaseTextureRenderContribution implements IArcRenderContribution {
14
- time: BaseRenderContributionTime;
15
- }
9
+ export declare const defaultArcRenderContribution: DefaultArcRenderContribution;
10
+ export declare const defaultArcTextureRenderContribution: import("./base-contribution-render").DefaultBaseTextureRenderContribution;
11
+ export declare const defaultArcBackgroundRenderContribution: import("./base-contribution-render").DefaultBaseBackgroundRenderContribution;
@@ -1,20 +1,12 @@
1
- var __decorate = this && this.__decorate || function(decorators, target, key, desc) {
2
- var d, c = arguments.length, r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
3
- if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
4
- return c > 3 && r && Object.defineProperty(target, key, r), r;
5
- };
6
-
7
- import { injectable } from "../../../../common/inversify-lite";
8
-
9
1
  import { getScaledStroke } from "../../../../common/canvas-utils";
10
2
 
11
- import { DefaultBaseBackgroundRenderContribution, DefaultBaseTextureRenderContribution } from "./base-contribution-render";
3
+ import { defaultBaseBackgroundRenderContribution, defaultBaseTextureRenderContribution } from "./base-contribution-render";
12
4
 
13
5
  import { drawArcPath } from "../utils";
14
6
 
15
7
  import { BaseRenderContributionTime } from "../../../../common/enums";
16
8
 
17
- let DefaultArcRenderContribution = class {
9
+ export class DefaultArcRenderContribution {
18
10
  constructor() {
19
11
  this.time = BaseRenderContributionTime.afterFillStroke, this.useStyle = !0, this.order = 0;
20
12
  }
@@ -59,29 +51,11 @@ let DefaultArcRenderContribution = class {
59
51
  endAngle: endAngle
60
52
  });
61
53
  }
62
- };
63
-
64
- DefaultArcRenderContribution = __decorate([ injectable() ], DefaultArcRenderContribution);
54
+ }
65
55
 
66
- export { DefaultArcRenderContribution };
67
-
68
- let DefaultArcBackgroundRenderContribution = class extends DefaultBaseBackgroundRenderContribution {
69
- constructor() {
70
- super(...arguments), this.time = BaseRenderContributionTime.beforeFillStroke;
71
- }
72
- };
73
-
74
- DefaultArcBackgroundRenderContribution = __decorate([ injectable() ], DefaultArcBackgroundRenderContribution);
75
-
76
- export { DefaultArcBackgroundRenderContribution };
77
-
78
- let DefaultArcTextureRenderContribution = class extends DefaultBaseTextureRenderContribution {
79
- constructor() {
80
- super(...arguments), this.time = BaseRenderContributionTime.afterFillStroke;
81
- }
82
- };
56
+ export const defaultArcRenderContribution = new DefaultArcRenderContribution;
83
57
 
84
- DefaultArcTextureRenderContribution = __decorate([ injectable() ], DefaultArcTextureRenderContribution);
58
+ export const defaultArcTextureRenderContribution = defaultBaseTextureRenderContribution;
85
59
 
86
- export { DefaultArcTextureRenderContribution };
60
+ export const defaultArcBackgroundRenderContribution = defaultBaseBackgroundRenderContribution;
87
61
  //# sourceMappingURL=arc-contribution-render.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/render/contributions/render/contributions/arc-contribution-render.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAC;AAW/D,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAClE,OAAO,EACL,uCAAuC,EACvC,oCAAoC,EACrC,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,EAAE,0BAA0B,EAAE,MAAM,0BAA0B,CAAC;AAG/D,IAAM,4BAA4B,GAAlC,MAAM,4BAA4B;IAAlC;QACL,SAAI,GAA+B,0BAA0B,CAAC,eAAe,CAAC;QAC9E,aAAQ,GAAY,IAAI,CAAC;QACzB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,CAAC;IACzG,CAAC;CACF,CAAA;AApHY,4BAA4B;IADxC,UAAU,EAAE;GACA,4BAA4B,CAoHxC;SApHY,4BAA4B;AAuHlC,IAAM,sCAAsC,GAA5C,MAAM,sCACX,SAAQ,uCAAuC;IAD1C;;QAIL,SAAI,GAA+B,0BAA0B,CAAC,gBAAgB,CAAC;IACjF,CAAC;CAAA,CAAA;AALY,sCAAsC;IADlD,UAAU,EAAE;GACA,sCAAsC,CAKlD;SALY,sCAAsC;AAQ5C,IAAM,mCAAmC,GAAzC,MAAM,mCACX,SAAQ,oCAAoC;IADvC;;QAIL,SAAI,GAA+B,0BAA0B,CAAC,eAAe,CAAC;IAChF,CAAC;CAAA,CAAA;AALY,mCAAmC;IAD/C,UAAU,EAAE;GACA,mCAAmC,CAK/C;SALY,mCAAmC","file":"arc-contribution-render.js","sourcesContent":["import { injectable } from '../../../../common/inversify-lite';\nimport type {\n IGraphicAttribute,\n IContext2d,\n IMarkAttribute,\n IArc,\n IArcGraphicAttribute,\n IThemeAttribute,\n IArcRenderContribution,\n IDrawContext\n} from '../../../../interface';\nimport { getScaledStroke } from '../../../../common/canvas-utils';\nimport {\n DefaultBaseBackgroundRenderContribution,\n DefaultBaseTextureRenderContribution\n} from './base-contribution-render';\nimport { drawArcPath } from '../utils';\nimport { BaseRenderContributionTime } from '../../../../common/enums';\n\n@injectable()\nexport class DefaultArcRenderContribution implements IArcRenderContribution {\n time: BaseRenderContributionTime = BaseRenderContributionTime.afterFillStroke;\n useStyle: boolean = true;\n order: number = 0;\n drawShape(\n arc: IArc,\n context: IContext2d,\n x: number,\n y: number,\n doFill: boolean,\n doStroke: boolean,\n fVisible: boolean,\n sVisible: boolean,\n arcAttribute: Required<IArcGraphicAttribute>,\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 } = arc.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 innerRadius = arcAttribute.innerRadius,\n outerRadius = arcAttribute.outerRadius,\n startAngle = arcAttribute.startAngle,\n endAngle = arcAttribute.endAngle,\n opacity = arcAttribute.opacity,\n x: originX = arcAttribute.x,\n y: originY = arcAttribute.y,\n scaleX = arcAttribute.scaleX,\n scaleY = arcAttribute.scaleY\n } = arc.attribute;\n const doStrokeOuter = !!(outerBorder && outerBorder.stroke);\n const doStrokeInner = !!(innerBorder && innerBorder.stroke);\n\n if (doOuterBorder) {\n const { distance = arcAttribute.outerBorder.distance } = outerBorder;\n const d = getScaledStroke(context, distance as number, context.dpr);\n const deltaAngle = (distance as number) / outerRadius;\n arc.setAttributes({\n outerRadius: outerRadius + d,\n innerRadius: innerRadius - d,\n startAngle: startAngle - deltaAngle,\n endAngle: endAngle + deltaAngle\n } as any);\n context.beginPath();\n drawArcPath(arc, context, x, y, outerRadius + d, innerRadius - d);\n // shadow\n context.setShadowBlendStyle && context.setShadowBlendStyle(arc, arc.attribute, arcAttribute);\n\n if (strokeCb) {\n strokeCb(context, outerBorder, arcAttribute.outerBorder);\n } else if (doStrokeOuter) {\n // 存在stroke\n const lastOpacity = (arcAttribute.outerBorder as any).opacity;\n (arcAttribute.outerBorder as any).opacity = opacity;\n context.setStrokeStyle(\n arc,\n outerBorder,\n (originX - x) / scaleX,\n (originY - y) / scaleY,\n arcAttribute.outerBorder as any\n );\n (arcAttribute.outerBorder as any).opacity = lastOpacity;\n context.stroke();\n }\n }\n\n if (doInnerBorder) {\n const { distance = arcAttribute.innerBorder.distance } = innerBorder;\n const d = getScaledStroke(context, distance as number, context.dpr);\n const deltaAngle = (distance as number) / outerRadius;\n arc.setAttributes({\n outerRadius: outerRadius - d,\n innerRadius: innerRadius + d,\n startAngle: startAngle + deltaAngle,\n endAngle: endAngle - deltaAngle\n } as any);\n context.beginPath();\n drawArcPath(arc, context, x, y, outerRadius - d, innerRadius + d);\n // arc.setAttributes({ outerRadius: outerRadius, innerRadius: innerRadius });\n\n // shadow\n context.setShadowBlendStyle && context.setShadowBlendStyle(arc, arc.attribute, arcAttribute);\n\n if (strokeCb) {\n strokeCb(context, innerBorder, arcAttribute.innerBorder);\n } else if (doStrokeInner) {\n // 存在stroke\n const lastOpacity = (arcAttribute.innerBorder as any).opacity;\n (arcAttribute.innerBorder as any).opacity = opacity;\n context.setStrokeStyle(\n arc,\n innerBorder,\n (originX - x) / scaleX,\n (originY - y) / scaleY,\n arcAttribute.innerBorder as any\n );\n (arcAttribute.innerBorder as any).opacity = lastOpacity;\n context.stroke();\n }\n }\n\n arc.setAttributes({ outerRadius: outerRadius, innerRadius: innerRadius, startAngle, endAngle } as any);\n }\n}\n\n@injectable()\nexport class DefaultArcBackgroundRenderContribution\n extends DefaultBaseBackgroundRenderContribution\n implements IArcRenderContribution\n{\n time: BaseRenderContributionTime = BaseRenderContributionTime.beforeFillStroke;\n}\n\n@injectable()\nexport class DefaultArcTextureRenderContribution\n extends DefaultBaseTextureRenderContribution\n implements IArcRenderContribution\n{\n time: BaseRenderContributionTime = BaseRenderContributionTime.afterFillStroke;\n}\n"]}
1
+ {"version":3,"sources":["../src/render/contributions/render/contributions/arc-contribution-render.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAClE,OAAO,EACL,uCAAuC,EACvC,oCAAoC,EACrC,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,EAAE,0BAA0B,EAAE,MAAM,0BAA0B,CAAC;AAEtE,MAAM,OAAO,4BAA4B;IAAzC;QACE,SAAI,GAA+B,0BAA0B,CAAC,eAAe,CAAC;QAC9E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,UAAU,EAAE,QAAQ,EAAS,CAAC,CAAC;IACzG,CAAC;CACF;AAED,MAAM,CAAC,MAAM,4BAA4B,GAAG,IAAI,4BAA4B,EAAE,CAAC;AAC/E,MAAM,CAAC,MAAM,mCAAmC,GAAG,oCAAoC,CAAC;AACxF,MAAM,CAAC,MAAM,sCAAsC,GAAG,uCAAuC,CAAC","file":"arc-contribution-render.js","sourcesContent":["import { injectable } from '../../../../common/inversify-lite';\nimport type {\n IGraphicAttribute,\n IContext2d,\n IMarkAttribute,\n IArc,\n IArcGraphicAttribute,\n IThemeAttribute,\n IArcRenderContribution,\n IDrawContext\n} from '../../../../interface';\nimport { getScaledStroke } from '../../../../common/canvas-utils';\nimport {\n defaultBaseBackgroundRenderContribution,\n defaultBaseTextureRenderContribution\n} from './base-contribution-render';\nimport { drawArcPath } from '../utils';\nimport { BaseRenderContributionTime } from '../../../../common/enums';\n\nexport class DefaultArcRenderContribution implements IArcRenderContribution {\n time: BaseRenderContributionTime = BaseRenderContributionTime.afterFillStroke;\n useStyle: boolean = true;\n order: number = 0;\n drawShape(\n arc: IArc,\n context: IContext2d,\n x: number,\n y: number,\n doFill: boolean,\n doStroke: boolean,\n fVisible: boolean,\n sVisible: boolean,\n arcAttribute: Required<IArcGraphicAttribute>,\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 } = arc.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 innerRadius = arcAttribute.innerRadius,\n outerRadius = arcAttribute.outerRadius,\n startAngle = arcAttribute.startAngle,\n endAngle = arcAttribute.endAngle,\n opacity = arcAttribute.opacity,\n x: originX = arcAttribute.x,\n y: originY = arcAttribute.y,\n scaleX = arcAttribute.scaleX,\n scaleY = arcAttribute.scaleY\n } = arc.attribute;\n const doStrokeOuter = !!(outerBorder && outerBorder.stroke);\n const doStrokeInner = !!(innerBorder && innerBorder.stroke);\n\n if (doOuterBorder) {\n const { distance = arcAttribute.outerBorder.distance } = outerBorder;\n const d = getScaledStroke(context, distance as number, context.dpr);\n const deltaAngle = (distance as number) / outerRadius;\n arc.setAttributes({\n outerRadius: outerRadius + d,\n innerRadius: innerRadius - d,\n startAngle: startAngle - deltaAngle,\n endAngle: endAngle + deltaAngle\n } as any);\n context.beginPath();\n drawArcPath(arc, context, x, y, outerRadius + d, innerRadius - d);\n // shadow\n context.setShadowBlendStyle && context.setShadowBlendStyle(arc, arc.attribute, arcAttribute);\n\n if (strokeCb) {\n strokeCb(context, outerBorder, arcAttribute.outerBorder);\n } else if (doStrokeOuter) {\n // 存在stroke\n const lastOpacity = (arcAttribute.outerBorder as any).opacity;\n (arcAttribute.outerBorder as any).opacity = opacity;\n context.setStrokeStyle(\n arc,\n outerBorder,\n (originX - x) / scaleX,\n (originY - y) / scaleY,\n arcAttribute.outerBorder as any\n );\n (arcAttribute.outerBorder as any).opacity = lastOpacity;\n context.stroke();\n }\n }\n\n if (doInnerBorder) {\n const { distance = arcAttribute.innerBorder.distance } = innerBorder;\n const d = getScaledStroke(context, distance as number, context.dpr);\n const deltaAngle = (distance as number) / outerRadius;\n arc.setAttributes({\n outerRadius: outerRadius - d,\n innerRadius: innerRadius + d,\n startAngle: startAngle + deltaAngle,\n endAngle: endAngle - deltaAngle\n } as any);\n context.beginPath();\n drawArcPath(arc, context, x, y, outerRadius - d, innerRadius + d);\n // arc.setAttributes({ outerRadius: outerRadius, innerRadius: innerRadius });\n\n // shadow\n context.setShadowBlendStyle && context.setShadowBlendStyle(arc, arc.attribute, arcAttribute);\n\n if (strokeCb) {\n strokeCb(context, innerBorder, arcAttribute.innerBorder);\n } else if (doStrokeInner) {\n // 存在stroke\n const lastOpacity = (arcAttribute.innerBorder as any).opacity;\n (arcAttribute.innerBorder as any).opacity = opacity;\n context.setStrokeStyle(\n arc,\n innerBorder,\n (originX - x) / scaleX,\n (originY - y) / scaleY,\n arcAttribute.innerBorder as any\n );\n (arcAttribute.innerBorder as any).opacity = lastOpacity;\n context.stroke();\n }\n }\n\n arc.setAttributes({ outerRadius: outerRadius, innerRadius: innerRadius, startAngle, endAngle } as any);\n }\n}\n\nexport const defaultArcRenderContribution = new DefaultArcRenderContribution();\nexport const defaultArcTextureRenderContribution = defaultBaseTextureRenderContribution;\nexport const defaultArcBackgroundRenderContribution = defaultBaseBackgroundRenderContribution;\n"]}
@@ -1,12 +1,11 @@
1
1
  import type { IGraphicAttribute, IContext2d, IThemeAttribute, IArea, IAreaGraphicAttribute, IAreaRenderContribution, IDrawContext } from '../../../../interface';
2
- import { DefaultBaseBackgroundRenderContribution, DefaultBaseTextureRenderContribution } from './base-contribution-render';
2
+ import { DefaultBaseTextureRenderContribution } from './base-contribution-render';
3
3
  import { BaseRenderContributionTime } from '../../../../common/enums';
4
- export declare class DefaultAreaBackgroundRenderContribution extends DefaultBaseBackgroundRenderContribution implements IAreaRenderContribution {
5
- time: BaseRenderContributionTime;
6
- }
7
4
  export declare class DefaultAreaTextureRenderContribution extends DefaultBaseTextureRenderContribution implements IAreaRenderContribution {
8
5
  time: BaseRenderContributionTime;
9
6
  drawShape(graphic: IArea, context: IContext2d, x: number, y: number, doFill: boolean, doStroke: boolean, fVisible: boolean, sVisible: boolean, graphicAttribute: Required<IGraphicAttribute>, drawContext: IDrawContext, fillCb?: (ctx: IContext2d, markAttribute: Partial<IGraphicAttribute>, themeAttribute: IThemeAttribute) => boolean, strokeCb?: (ctx: IContext2d, markAttribute: Partial<IGraphicAttribute>, themeAttribute: IThemeAttribute) => boolean, options?: {
10
7
  attribute?: Partial<IAreaGraphicAttribute>;
11
8
  }): void;
12
9
  }
10
+ export declare const defaultAreaTextureRenderContribution: DefaultAreaTextureRenderContribution;
11
+ export declare const defaultAreaBackgroundRenderContribution: import("./base-contribution-render").DefaultBaseBackgroundRenderContribution;
@@ -1,28 +1,10 @@
1
- var __decorate = this && this.__decorate || function(decorators, target, key, desc) {
2
- var d, c = arguments.length, r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
3
- if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
4
- return c > 3 && r && Object.defineProperty(target, key, r), r;
5
- };
6
-
7
- import { injectable } from "../../../../common/inversify-lite";
8
-
9
- import { DefaultBaseBackgroundRenderContribution, DefaultBaseTextureRenderContribution } from "./base-contribution-render";
1
+ import { DefaultBaseTextureRenderContribution, defaultBaseBackgroundRenderContribution } from "./base-contribution-render";
10
2
 
11
3
  import { getAttributeFromDefaultAttrList } from "../../../../common/utils";
12
4
 
13
5
  import { BaseRenderContributionTime } from "../../../../common/enums";
14
6
 
15
- let DefaultAreaBackgroundRenderContribution = class extends DefaultBaseBackgroundRenderContribution {
16
- constructor() {
17
- super(...arguments), this.time = BaseRenderContributionTime.beforeFillStroke;
18
- }
19
- };
20
-
21
- DefaultAreaBackgroundRenderContribution = __decorate([ injectable() ], DefaultAreaBackgroundRenderContribution);
22
-
23
- export { DefaultAreaBackgroundRenderContribution };
24
-
25
- let DefaultAreaTextureRenderContribution = class extends DefaultBaseTextureRenderContribution {
7
+ export class DefaultAreaTextureRenderContribution extends DefaultBaseTextureRenderContribution {
26
8
  constructor() {
27
9
  super(...arguments), this.time = BaseRenderContributionTime.afterFillStroke;
28
10
  }
@@ -67,9 +49,9 @@ let DefaultAreaTextureRenderContribution = class extends DefaultBaseTextureRende
67
49
  pattern && (context.highPerformanceSave(), context.setCommonStyle(graphic, graphic.attribute, x, y, graphicAttribute),
68
50
  context.fillStyle = pattern, context.fill(), context.highPerformanceRestore());
69
51
  }
70
- };
52
+ }
71
53
 
72
- DefaultAreaTextureRenderContribution = __decorate([ injectable() ], DefaultAreaTextureRenderContribution);
54
+ export const defaultAreaTextureRenderContribution = new DefaultAreaTextureRenderContribution;
73
55
 
74
- export { DefaultAreaTextureRenderContribution };
56
+ export const defaultAreaBackgroundRenderContribution = defaultBaseBackgroundRenderContribution;
75
57
  //# sourceMappingURL=area-contribution-render.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/render/contributions/render/contributions/area-contribution-render.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAC;AAW/D,OAAO,EACL,uCAAuC,EACvC,oCAAoC,EACrC,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,+BAA+B,EAAE,MAAM,0BAA0B,CAAC;AAC3E,OAAO,EAAE,0BAA0B,EAAE,MAAM,0BAA0B,CAAC;AAG/D,IAAM,uCAAuC,GAA7C,MAAM,uCACX,SAAQ,uCAAuC;IAD1C;;QAIL,SAAI,GAA+B,0BAA0B,CAAC,gBAAgB,CAAC;IACjF,CAAC;CAAA,CAAA;AALY,uCAAuC;IADnD,UAAU,EAAE;GACA,uCAAuC,CAKnD;SALY,uCAAuC;AAQ7C,IAAM,oCAAoC,GAA1C,MAAM,oCACX,SAAQ,oCAAoC;IADvC;;QAIL,SAAI,GAA+B,0BAA0B,CAAC,eAAe,CAAC;IA0EhF,CAAC;IAxEC,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,EACnH,OAEC;;QAED,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE;YACpB,IAAI,CAAC,cAAc,CAAC,OAAO,EAAE,OAAO,CAAC,KAAK,CAAC,CA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AC;oBAC7F,MAAM;gBACR,KAAK,iBAAiB;oBACpB,OAAO,GAAG,IAAI,CAAC,2BAA2B,CAAC,WAAW,EAAE,cAAc,EAAE,YAAY,EAAE,OAAO,CAAC,CAAC;oBAC/F,MAAM;gBACR,KAAK,SAAS;oBACZ,OAAO,GAAG,IAAI,CAAC,uBAAuB,CAAC,WAAW,EAAE,cAAc,EAAE,YAAY,EAAE,OAAO,CAAC,CAAC;oBAC3F,MAAM;gBACR,KAAK,SAAS;oBACZ,OAAO,GAAG,IAAI,CAAC,uBAAuB,CAAC,WAAW,EAAE,cAAc,EAAE,YAAY,EAAE,OAAO,CAAC,CAAC;oBAC3F,MAAM;gBACR,KAAK,MAAM;oBACT,OAAO,GAAG,IAAI,CAAC,iBAAiB,CAAC,WAAW,EAAE,cAAc,EAAE,YAAY,EAAE,OAAO,CAAC,CAAC;oBACrF,MAAM;aACT;SACF;QAED,IAAI,OAAO,EAAE;YACX,OAAO,CAAC,mBAAmB,EAAE,CAAC;YAC9B,OAAO,CAAC,cAAc,CAAC,OAAO,EAAE,OAAO,CAAC,SAAS,EAAE,CAAC,EAAE,CAAC,EAAE,gBAAgB,CAAC,CAAC;YAC3E,OAAO,CAAC,SAAS,GAAG,OAAO,CAAC;YAC5B,OAAO,CAAC,IAAI,EAAE,CAAC;YACf,OAAO,CAAC,sBAAsB,EAAE,CAAC;SAClC;IACH,CAAC;CACF,CAAA;AA9EY,oCAAoC;IADhD,UAAU,EAAE;GACA,oCAAoC,CA8EhD;SA9EY,oCAAoC","file":"area-contribution-render.js","sourcesContent":["import { injectable } from '../../../../common/inversify-lite';\nimport type {\n IGraphicAttribute,\n IContext2d,\n IMarkAttribute,\n IThemeAttribute,\n IArea,\n IAreaGraphicAttribute,\n IAreaRenderContribution,\n IDrawContext\n} from '../../../../interface';\nimport {\n DefaultBaseBackgroundRenderContribution,\n DefaultBaseTextureRenderContribution\n} from './base-contribution-render';\nimport { getAttributeFromDefaultAttrList } from '../../../../common/utils';\nimport { BaseRenderContributionTime } from '../../../../common/enums';\n\n@injectable()\nexport class DefaultAreaBackgroundRenderContribution\n extends DefaultBaseBackgroundRenderContribution\n implements IAreaRenderContribution\n{\n time: BaseRenderContributionTime = BaseRenderContributionTime.beforeFillStroke;\n}\n\n@injectable()\nexport class DefaultAreaTextureRenderContribution\n extends DefaultBaseTextureRenderContribution\n implements IAreaRenderContribution\n{\n time: BaseRenderContributionTime = BaseRenderContributionTime.afterFillStroke;\n\n drawShape(\n graphic: IArea,\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 options?: {\n attribute?: Partial<IAreaGraphicAttribute>;\n }\n ) {\n if (!this.textureMap) {\n this.initTextureMap(context, graphic.stage);\n }\n\n const { attribute = graphic.attribute } = options || {};\n\n const {\n texture = graphic.attribute.texture ?? getAttributeFromDefaultAttrList(graphicAttribute, 'texture'),\n textureColor = graphic.attribute.textureColor ??\n getAttributeFromDefaultAttrList(graphicAttribute, 'textureColor'),\n textureSize = graphic.attribute.textureSize ?? getAttributeFromDefaultAttrList(graphicAttribute, 'textureSize'),\n texturePadding = graphic.attribute.texturePadding ??\n getAttributeFromDefaultAttrList(graphicAttribute, 'texturePadding')\n } = attribute;\n if (!texture) {\n return;\n }\n let pattern: CanvasPattern = this.textureMap.get(texture);\n if (!pattern) {\n switch (texture) {\n case 'circle':\n pattern = this.createCirclePattern(textureSize, texturePadding, textureColor, context);\n break;\n case 'diamond':\n pattern = this.createDiamondPattern(textureSize, texturePadding, textureColor, context);\n break;\n case 'rect':\n pattern = this.createRectPattern(textureSize, texturePadding, textureColor, context);\n break;\n case 'vertical-line':\n pattern = this.createVerticalLinePattern(textureSize, texturePadding, textureColor, context);\n break;\n case 'horizontal-line':\n pattern = this.createHorizontalLinePattern(textureSize, texturePadding, textureColor, context);\n break;\n case 'bias-lr':\n pattern = this.createBiasLRLinePattern(textureSize, texturePadding, textureColor, context);\n break;\n case 'bias-rl':\n pattern = this.createBiasRLLinePattern(textureSize, texturePadding, textureColor, context);\n break;\n case 'grid':\n pattern = this.createGridPattern(textureSize, texturePadding, textureColor, context);\n break;\n }\n }\n\n if (pattern) {\n context.highPerformanceSave();\n context.setCommonStyle(graphic, graphic.attribute, x, y, graphicAttribute);\n context.fillStyle = pattern;\n context.fill();\n context.highPerformanceRestore();\n }\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/render/contributions/render/contributions/area-contribution-render.ts"],"names":[],"mappings":"AAWA,OAAO,EACL,oCAAoC,EACpC,uCAAuC,EACxC,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,+BAA+B,EAAE,MAAM,0BAA0B,CAAC;AAC3E,OAAO,EAAE,0BAA0B,EAAE,MAAM,0BAA0B,CAAC;AAEtE,MAAM,OAAO,oCACX,SAAQ,oCAAoC;IAD9C;;QAIE,SAAI,GAA+B,0BAA0B,CAAC,eAAe,CAAC;IA0EhF,CAAC;IAxEC,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,EACnH,OAEC;;QAED,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE;YACpB,IAAI,CAAC,cAAc,CAAC,OAAO,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;SAC7C;QAED,MAAM,EAAE,SAAS,GAAG,OAAO,CAAC,SAAS,EAAE,GAAG,OAAO,IAAI,EAAE,CAAC;QAExD,MAAM,EACJ,OAAO,GAAG,MAAA,OAAO,CAAC,SAAS,CAAC,OAAO,mCAAI,+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S;oBACZ,OAAO,GAAG,IAAI,CAAC,uBAAuB,CAAC,WAAW,EAAE,cAAc,EAAE,YAAY,EAAE,OAAO,CAAC,CAAC;oBAC3F,MAAM;gBACR,KAAK,SAAS;oBACZ,OAAO,GAAG,IAAI,CAAC,uBAAuB,CAAC,WAAW,EAAE,cAAc,EAAE,YAAY,EAAE,OAAO,CAAC,CAAC;oBAC3F,MAAM;gBACR,KAAK,MAAM;oBACT,OAAO,GAAG,IAAI,CAAC,iBAAiB,CAAC,WAAW,EAAE,cAAc,EAAE,YAAY,EAAE,OAAO,CAAC,CAAC;oBACrF,MAAM;aACT;SACF;QAED,IAAI,OAAO,EAAE;YACX,OAAO,CAAC,mBAAmB,EAAE,CAAC;YAC9B,OAAO,CAAC,cAAc,CAAC,OAAO,EAAE,OAAO,CAAC,SAAS,EAAE,CAAC,EAAE,CAAC,EAAE,gBAAgB,CAAC,CAAC;YAC3E,OAAO,CAAC,SAAS,GAAG,OAAO,CAAC;YAC5B,OAAO,CAAC,IAAI,EAAE,CAAC;YACf,OAAO,CAAC,sBAAsB,EAAE,CAAC;SAClC;IACH,CAAC;CACF;AAED,MAAM,CAAC,MAAM,oCAAoC,GAAG,IAAI,oCAAoC,EAAE,CAAC;AAC/F,MAAM,CAAC,MAAM,uCAAuC,GAAG,uCAAuC,CAAC","file":"area-contribution-render.js","sourcesContent":["import { injectable } from '../../../../common/inversify-lite';\nimport type {\n IGraphicAttribute,\n IContext2d,\n IMarkAttribute,\n IThemeAttribute,\n IArea,\n IAreaGraphicAttribute,\n IAreaRenderContribution,\n IDrawContext\n} from '../../../../interface';\nimport {\n DefaultBaseTextureRenderContribution,\n defaultBaseBackgroundRenderContribution\n} from './base-contribution-render';\nimport { getAttributeFromDefaultAttrList } from '../../../../common/utils';\nimport { BaseRenderContributionTime } from '../../../../common/enums';\n\nexport class DefaultAreaTextureRenderContribution\n extends DefaultBaseTextureRenderContribution\n implements IAreaRenderContribution\n{\n time: BaseRenderContributionTime = BaseRenderContributionTime.afterFillStroke;\n\n drawShape(\n graphic: IArea,\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 options?: {\n attribute?: Partial<IAreaGraphicAttribute>;\n }\n ) {\n if (!this.textureMap) {\n this.initTextureMap(context, graphic.stage);\n }\n\n const { attribute = graphic.attribute } = options || {};\n\n const {\n texture = graphic.attribute.texture ?? getAttributeFromDefaultAttrList(graphicAttribute, 'texture'),\n textureColor = graphic.attribute.textureColor ??\n getAttributeFromDefaultAttrList(graphicAttribute, 'textureColor'),\n textureSize = graphic.attribute.textureSize ?? getAttributeFromDefaultAttrList(graphicAttribute, 'textureSize'),\n texturePadding = graphic.attribute.texturePadding ??\n getAttributeFromDefaultAttrList(graphicAttribute, 'texturePadding')\n } = attribute;\n if (!texture) {\n return;\n }\n let pattern: CanvasPattern = this.textureMap.get(texture);\n if (!pattern) {\n switch (texture) {\n case 'circle':\n pattern = this.createCirclePattern(textureSize, texturePadding, textureColor, context);\n break;\n case 'diamond':\n pattern = this.createDiamondPattern(textureSize, texturePadding, textureColor, context);\n break;\n case 'rect':\n pattern = this.createRectPattern(textureSize, texturePadding, textureColor, context);\n break;\n case 'vertical-line':\n pattern = this.createVerticalLinePattern(textureSize, texturePadding, textureColor, context);\n break;\n case 'horizontal-line':\n pattern = this.createHorizontalLinePattern(textureSize, texturePadding, textureColor, context);\n break;\n case 'bias-lr':\n pattern = this.createBiasLRLinePattern(textureSize, texturePadding, textureColor, context);\n break;\n case 'bias-rl':\n pattern = this.createBiasRLLinePattern(textureSize, texturePadding, textureColor, context);\n break;\n case 'grid':\n pattern = this.createGridPattern(textureSize, texturePadding, textureColor, context);\n break;\n }\n }\n\n if (pattern) {\n context.highPerformanceSave();\n context.setCommonStyle(graphic, graphic.attribute, x, y, graphicAttribute);\n context.fillStyle = pattern;\n context.fill();\n context.highPerformanceRestore();\n }\n }\n}\n\nexport const defaultAreaTextureRenderContribution = new DefaultAreaTextureRenderContribution();\nexport const defaultAreaBackgroundRenderContribution = defaultBaseBackgroundRenderContribution;\n"]}
@@ -1,11 +1,14 @@
1
1
  import type { IGraphicAttribute, IContext2d, IGraphic, IStage, IThemeAttribute, IBaseRenderContribution, IContributionProvider, IDrawContext } from '../../../../interface';
2
+ import type { IBounds } from '@visactor/vutils';
2
3
  import { BaseRenderContributionTime } from '../../../../common/enums';
3
4
  export declare class DefaultBaseBackgroundRenderContribution implements IBaseRenderContribution<IGraphic, IGraphicAttribute> {
4
5
  time: BaseRenderContributionTime;
5
6
  useStyle: boolean;
6
7
  order: number;
7
8
  drawShape(graphic: IGraphic, context: IContext2d, x: number, y: number, doFill: boolean, doStroke: boolean, fVisible: boolean, sVisible: boolean, graphicAttribute: Required<IGraphicAttribute>, drawContext: IDrawContext, fillCb?: (ctx: IContext2d, markAttribute: Partial<IGraphicAttribute>, themeAttribute: IThemeAttribute) => boolean, strokeCb?: (ctx: IContext2d, markAttribute: Partial<IGraphicAttribute>, themeAttribute: IThemeAttribute) => boolean, options?: any): void;
9
+ protected doDrawImage(context: IContext2d, data: any, b: IBounds, backgroundMode: 'repeat' | 'repeat-x' | 'repeat-y' | 'no-repeat'): void;
8
10
  }
11
+ export declare const defaultBaseBackgroundRenderContribution: DefaultBaseBackgroundRenderContribution;
9
12
  export interface IInteractiveSubRenderContribution {
10
13
  render: (graphic: IGraphic, context: IContext2d, x: number, y: number, doFill: boolean, doStroke: boolean, fVisible: boolean, sVisible: boolean, graphicAttribute: Required<IGraphicAttribute>, drawContext: IDrawContext, fillCb?: (ctx: IContext2d, markAttribute: Partial<IGraphicAttribute>, themeAttribute: IThemeAttribute) => boolean, strokeCb?: (ctx: IContext2d, markAttribute: Partial<IGraphicAttribute>, themeAttribute: IThemeAttribute) => boolean, options?: any) => void;
11
14
  }
@@ -35,3 +38,4 @@ export declare class DefaultBaseTextureRenderContribution implements IBaseRender
35
38
  initTextureMap(ctx: IContext2d, stage: IStage): void;
36
39
  drawShape(graphic: IGraphic, context: IContext2d, x: number, y: number, doFill: boolean, doStroke: boolean, fVisible: boolean, sVisible: boolean, graphicAttribute: Required<IGraphicAttribute>, drawContext: IDrawContext, fillCb?: (ctx: IContext2d, markAttribute: Partial<IGraphicAttribute>, themeAttribute: IThemeAttribute) => boolean, strokeCb?: (ctx: IContext2d, markAttribute: Partial<IGraphicAttribute>, themeAttribute: IThemeAttribute) => boolean, options?: any): void;
37
40
  }
41
+ export declare const defaultBaseTextureRenderContribution: DefaultBaseTextureRenderContribution;
@@ -24,12 +24,12 @@ import { ContributionProvider } from "../../../../common/contribution-provider";
24
24
 
25
25
  import { InteractiveSubRenderContribution } from "./constants";
26
26
 
27
- let DefaultBaseBackgroundRenderContribution = class {
27
+ export class DefaultBaseBackgroundRenderContribution {
28
28
  constructor() {
29
29
  this.time = BaseRenderContributionTime.beforeFillStroke, this.useStyle = !0, this.order = 0;
30
30
  }
31
31
  drawShape(graphic, context, x, y, doFill, doStroke, fVisible, sVisible, graphicAttribute, drawContext, fillCb, strokeCb, options) {
32
- const {background: background} = graphic.attribute;
32
+ const {background: background, backgroundMode: backgroundMode = graphicAttribute.backgroundMode} = graphic.attribute;
33
33
  if (background) if (graphic.backgroundImg && graphic.resources) {
34
34
  const res = graphic.resources.get(background);
35
35
  if ("success" !== res.state || !res.data) return;
@@ -39,16 +39,21 @@ let DefaultBaseBackgroundRenderContribution = class {
39
39
  }
40
40
  context.clip();
41
41
  const b = graphic.AABBBounds;
42
- context.setCommonStyle(graphic, graphic.attribute, x, y, graphicAttribute), context.drawImage(res.data, b.x1, b.y1, b.width(), b.height()),
42
+ context.setCommonStyle(graphic, graphic.attribute, x, y, graphicAttribute), this.doDrawImage(context, res.data, b, backgroundMode),
43
43
  context.restore(), graphic.transMatrix.onlyTranslate() || context.setTransformForCurrent();
44
44
  } else context.highPerformanceSave(), context.setCommonStyle(graphic, graphic.attribute, x, y, graphicAttribute),
45
45
  context.fillStyle = background, context.fill(), context.highPerformanceRestore();
46
46
  }
47
- };
48
-
49
- DefaultBaseBackgroundRenderContribution = __decorate([ injectable() ], DefaultBaseBackgroundRenderContribution);
47
+ doDrawImage(context, data, b, backgroundMode) {
48
+ if ("no-repeat" === backgroundMode) context.drawImage(data, b.x1, b.y1, b.width(), b.height()); else {
49
+ const pattern = context.createPattern(data, backgroundMode);
50
+ context.fillStyle = pattern, context.translate(b.x1, b.y1), context.fillRect(0, 0, b.width(), b.height()),
51
+ context.translate(-b.x1, -b.y1);
52
+ }
53
+ }
54
+ }
50
55
 
51
- export { DefaultBaseBackgroundRenderContribution };
56
+ export const defaultBaseBackgroundRenderContribution = new DefaultBaseBackgroundRenderContribution;
52
57
 
53
58
  let DefaultBaseInteractiveRenderContribution = class {
54
59
  constructor(subRenderContribitions) {
@@ -67,20 +72,22 @@ DefaultBaseInteractiveRenderContribution = __decorate([ injectable(), __param(0,
67
72
 
68
73
  export { DefaultBaseInteractiveRenderContribution };
69
74
 
70
- let DefaultBaseTextureRenderContribution = class {
75
+ export class DefaultBaseTextureRenderContribution {
71
76
  constructor() {
72
77
  this.time = BaseRenderContributionTime.afterFillStroke, this.useStyle = !0, this.order = 10;
73
78
  }
74
79
  createCommonPattern(size, padding, color, targetContext, cb) {
75
- const r = (size - 2 * padding) / 2, canvas = canvasAllocate.allocate({
80
+ const r = (size - 2 * padding) / 2, dpr = targetContext.dpr, canvas = canvasAllocate.allocate({
76
81
  width: size,
77
82
  height: size,
78
- dpr: 1
83
+ dpr: dpr
79
84
  }), ctx = canvas.getContext("2d");
80
85
  if (!ctx) return null;
81
- ctx.clearRect(0, 0, size, size), cb(r, ctx);
86
+ ctx.inuse = !0, ctx.clearMatrix(), ctx.setTransformForCurrent(!0), ctx.clearRect(0, 0, size, size),
87
+ cb(r, ctx);
82
88
  const pattern = targetContext.createPattern(canvas.nativeCanvas, "repeat");
83
- return canvasAllocate.free(canvas), pattern;
89
+ return pattern.setTransform && pattern.setTransform(new DOMMatrix([ 1 / dpr, 0, 0, 1 / dpr, 0, 0 ])),
90
+ canvasAllocate.free(canvas), pattern;
84
91
  }
85
92
  createCirclePattern(size, padding, color, targetContext) {
86
93
  return this.createCommonPattern(size, padding, color, targetContext, ((r, ctx) => {
@@ -177,9 +184,7 @@ let DefaultBaseTextureRenderContribution = class {
177
184
  pattern && (context.highPerformanceSave(), context.setCommonStyle(graphic, graphic.attribute, x, y, graphicAttribute),
178
185
  context.fillStyle = pattern, context.fill(), context.highPerformanceRestore());
179
186
  }
180
- };
181
-
182
- DefaultBaseTextureRenderContribution = __decorate([ injectable() ], DefaultBaseTextureRenderContribution);
187
+ }
183
188
 
184
- export { DefaultBaseTextureRenderContribution };
189
+ export const defaultBaseTextureRenderContribution = new DefaultBaseTextureRenderContribution;
185
190
  //# sourceMappingURL=base-contribution-render.js.map