@visactor/vrender-core 0.16.20-alpha.4 → 0.16.20

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 (570) hide show
  1. package/cjs/allocator/canvas-allocate.d.ts +0 -4
  2. package/cjs/allocator/canvas-allocate.js +6 -19
  3. package/cjs/allocator/canvas-allocate.js.map +1 -1
  4. package/cjs/allocator/graphic-allocate.d.ts +1 -56
  5. package/cjs/allocator/graphic-allocate.js +1 -163
  6. package/cjs/allocator/graphic-allocate.js.map +1 -1
  7. package/cjs/animate/Ticker/default-ticker.js +1 -1
  8. package/cjs/animate/Ticker/default-ticker.js.map +1 -1
  9. package/cjs/animate/config.js +2 -1
  10. package/cjs/animate/custom-animate.js +1 -2
  11. package/cjs/canvas/contributions/base-canvas.js +2 -4
  12. package/cjs/canvas/contributions/base-canvas.js.map +1 -1
  13. package/cjs/common/Reflect-metadata.js +359 -349
  14. package/cjs/common/Reflect-metadata.js.map +1 -1
  15. package/cjs/common/bezier-utils.js +1 -2
  16. package/cjs/common/inversify-lite/annotation/post_construct.d.ts +4 -0
  17. package/cjs/common/{inversify/annotation/injectable.js → inversify-lite/annotation/post_construct.js} +5 -15
  18. package/cjs/common/inversify-lite/annotation/post_construct.js.map +1 -0
  19. package/cjs/common/inversify-lite/container/container.js +3 -1
  20. package/cjs/common/inversify-lite/container/container.js.map +1 -1
  21. package/cjs/common/inversify-lite/index.d.ts +8 -1
  22. package/cjs/common/inversify-lite/index.js +64 -1
  23. package/cjs/common/inversify-lite/index.js.map +1 -1
  24. package/cjs/common/inversify-lite/interfaces/interfaces.d.ts +2 -0
  25. package/cjs/common/inversify-lite/interfaces/interfaces.js.map +1 -1
  26. package/cjs/common/inversify-lite/planning/queryable_string.d.ts +2 -0
  27. package/cjs/common/inversify-lite/planning/queryable_string.js +10 -0
  28. package/cjs/common/inversify-lite/planning/queryable_string.js.map +1 -1
  29. package/cjs/common/inversify-lite/resolution/resolver.js.map +1 -1
  30. package/cjs/common/render-area.js +1 -0
  31. package/cjs/common/render-area.js.map +1 -1
  32. package/cjs/common/segment/monotone.js +18 -20
  33. package/cjs/common/segment/monotone.js.map +1 -1
  34. package/cjs/common/shape/rect.js +1 -2
  35. package/cjs/common/shape/rect.js.map +1 -1
  36. package/cjs/common/sort.js +2 -1
  37. package/cjs/common/split-path.js +1 -2
  38. package/cjs/core/contributions/layerHandler/canvas2d-contribution.d.ts +2 -2
  39. package/cjs/core/contributions/layerHandler/canvas2d-contribution.js +9 -4
  40. package/cjs/core/contributions/layerHandler/canvas2d-contribution.js.map +1 -1
  41. package/cjs/core/contributions/layerHandler/empty-contribution.d.ts +2 -2
  42. package/cjs/core/contributions/layerHandler/empty-contribution.js +9 -4
  43. package/cjs/core/contributions/layerHandler/empty-contribution.js.map +1 -1
  44. package/cjs/core/contributions/layerHandler/offscreen2d-contribution.d.ts +2 -2
  45. package/cjs/core/contributions/layerHandler/offscreen2d-contribution.js +9 -4
  46. package/cjs/core/contributions/layerHandler/offscreen2d-contribution.js.map +1 -1
  47. package/cjs/core/contributions/textMeasure/AtextMeasure.js +2 -3
  48. package/cjs/core/contributions/textMeasure/AtextMeasure.js.map +1 -1
  49. package/cjs/core/contributions/textMeasure/modules.js +2 -1
  50. package/cjs/core/contributions/textMeasure/modules.js.map +1 -1
  51. package/cjs/core/core-modules.js +6 -5
  52. package/cjs/core/core-modules.js.map +1 -1
  53. package/cjs/core/global.d.ts +0 -4
  54. package/cjs/core/global.js +5 -8
  55. package/cjs/core/global.js.map +1 -1
  56. package/cjs/core/graphic-utils.d.ts +4 -7
  57. package/cjs/core/graphic-utils.js +14 -18
  58. package/cjs/core/graphic-utils.js.map +1 -1
  59. package/cjs/core/layer-service.d.ts +2 -5
  60. package/cjs/core/layer-service.js +13 -13
  61. package/cjs/core/layer-service.js.map +1 -1
  62. package/cjs/core/stage.d.ts +4 -7
  63. package/cjs/core/stage.js +34 -38
  64. package/cjs/core/stage.js.map +1 -1
  65. package/cjs/core/window.d.ts +2 -2
  66. package/cjs/core/window.js +12 -7
  67. package/cjs/core/window.js.map +1 -1
  68. package/cjs/event/event-manager.js +2 -3
  69. package/cjs/event/event-manager.js.map +1 -1
  70. package/cjs/graphic/config.d.ts +2 -1
  71. package/cjs/graphic/config.js +5 -7
  72. package/cjs/graphic/config.js.map +1 -1
  73. package/cjs/graphic/graphic-service/arc-contribution.d.ts +5 -1
  74. package/cjs/graphic/graphic-service/arc-contribution.js +18 -0
  75. package/cjs/graphic/graphic-service/arc-contribution.js.map +1 -1
  76. package/cjs/graphic/graphic-service/area-contribution.d.ts +1 -1
  77. package/cjs/graphic/graphic-service/area-contribution.js +4 -1
  78. package/cjs/graphic/graphic-service/area-contribution.js.map +1 -1
  79. package/cjs/graphic/graphic-service/circle-contribution.d.ts +5 -1
  80. package/cjs/graphic/graphic-service/circle-contribution.js +18 -0
  81. package/cjs/graphic/graphic-service/circle-contribution.js.map +1 -1
  82. package/cjs/graphic/graphic-service/common-contribution.js +11 -2
  83. package/cjs/graphic/graphic-service/common-contribution.js.map +1 -1
  84. package/cjs/graphic/graphic-service/graphic-module.js +17 -2
  85. package/cjs/graphic/graphic-service/graphic-module.js.map +1 -1
  86. package/cjs/graphic/graphic-service/graphic-service.d.ts +7 -2
  87. package/cjs/graphic/graphic-service/graphic-service.js +30 -24
  88. package/cjs/graphic/graphic-service/graphic-service.js.map +1 -1
  89. package/cjs/graphic/graphic-service/path-contribution.d.ts +5 -1
  90. package/cjs/graphic/graphic-service/path-contribution.js +18 -0
  91. package/cjs/graphic/graphic-service/path-contribution.js.map +1 -1
  92. package/cjs/graphic/graphic-service/rect-contribution.d.ts +5 -1
  93. package/cjs/graphic/graphic-service/rect-contribution.js +18 -0
  94. package/cjs/graphic/graphic-service/rect-contribution.js.map +1 -1
  95. package/cjs/graphic/graphic-service/symbol-contribution.d.ts +1 -0
  96. package/cjs/graphic/graphic-service/symbol-contribution.js +13 -4
  97. package/cjs/graphic/graphic-service/symbol-contribution.js.map +1 -1
  98. package/cjs/graphic/graphic.js +2 -3
  99. package/cjs/graphic/graphic.js.map +1 -1
  100. package/cjs/graphic/group.d.ts +0 -1
  101. package/cjs/graphic/group.js +3 -7
  102. package/cjs/graphic/group.js.map +1 -1
  103. package/cjs/graphic/rect.d.ts +3 -2
  104. package/cjs/graphic/rect.js +5 -3
  105. package/cjs/graphic/rect.js.map +1 -1
  106. package/cjs/graphic/symbol.js +4 -7
  107. package/cjs/graphic/symbol.js.map +1 -1
  108. package/cjs/graphic/text.js +4 -4
  109. package/cjs/graphic/text.js.map +1 -1
  110. package/cjs/graphic/theme.d.ts +4 -4
  111. package/cjs/graphic/theme.js +26 -25
  112. package/cjs/graphic/theme.js.map +1 -1
  113. package/cjs/graphic/wrap-text.js +4 -4
  114. package/cjs/graphic/wrap-text.js.map +1 -1
  115. package/cjs/index.d.ts +0 -2
  116. package/cjs/index.js +0 -1
  117. package/cjs/index.js.map +1 -1
  118. package/cjs/interface/allocator.d.ts +0 -1
  119. package/cjs/interface/allocator.js.map +1 -1
  120. package/cjs/interface/global.d.ts +0 -1
  121. package/cjs/interface/global.js.map +1 -1
  122. package/cjs/interface/graphic/rect.d.ts +0 -2
  123. package/cjs/interface/graphic/rect.js.map +1 -1
  124. package/cjs/interface/graphic.d.ts +4 -1
  125. package/cjs/interface/graphic.js.map +1 -1
  126. package/cjs/interface/render.d.ts +2 -2
  127. package/cjs/interface/render.js.map +1 -1
  128. package/cjs/interface/stage.d.ts +1 -2
  129. package/cjs/interface/stage.js.map +1 -1
  130. package/cjs/modules.d.ts +2 -1
  131. package/cjs/modules.js +8 -8
  132. package/cjs/modules.js.map +1 -1
  133. package/cjs/picker/global-picker-service.d.ts +2 -2
  134. package/cjs/picker/global-picker-service.js +9 -4
  135. package/cjs/picker/global-picker-service.js.map +1 -1
  136. package/cjs/picker/pick-modules.js +4 -2
  137. package/cjs/picker/pick-modules.js.map +1 -1
  138. package/cjs/picker/picker-service.d.ts +2 -2
  139. package/cjs/picker/picker-service.js +6 -6
  140. package/cjs/picker/picker-service.js.map +1 -1
  141. package/cjs/plugins/plugin-modules.js +2 -1
  142. package/cjs/plugins/plugin-modules.js.map +1 -1
  143. package/cjs/render/contributions/render/arc-render.js +1 -2
  144. package/cjs/render/contributions/render/arc-render.js.map +1 -1
  145. package/cjs/render/contributions/render/area-render.d.ts +0 -1
  146. package/cjs/render/contributions/render/area-render.js +6 -44
  147. package/cjs/render/contributions/render/area-render.js.map +1 -1
  148. package/cjs/render/contributions/render/base-render.d.ts +1 -1
  149. package/cjs/render/contributions/render/base-render.js +18 -15
  150. package/cjs/render/contributions/render/base-render.js.map +1 -1
  151. package/cjs/render/contributions/render/circle-render.js +1 -2
  152. package/cjs/render/contributions/render/circle-render.js.map +1 -1
  153. package/cjs/render/contributions/render/contributions/arc-contribution-render.d.ts +7 -3
  154. package/cjs/render/contributions/render/contributions/arc-contribution-render.js +30 -7
  155. package/cjs/render/contributions/render/contributions/arc-contribution-render.js.map +1 -1
  156. package/cjs/render/contributions/render/contributions/area-contribution-render.d.ts +4 -3
  157. package/cjs/render/contributions/render/contributions/area-contribution-render.js +21 -7
  158. package/cjs/render/contributions/render/contributions/area-contribution-render.js.map +1 -1
  159. package/cjs/render/contributions/render/contributions/base-contribution-render.d.ts +0 -2
  160. package/cjs/render/contributions/render/contributions/base-contribution-render.js +9 -9
  161. package/cjs/render/contributions/render/contributions/base-contribution-render.js.map +1 -1
  162. package/cjs/render/contributions/render/contributions/circle-contribution-render.d.ts +7 -3
  163. package/cjs/render/contributions/render/contributions/circle-contribution-render.js +30 -7
  164. package/cjs/render/contributions/render/contributions/circle-contribution-render.js.map +1 -1
  165. package/cjs/render/contributions/render/contributions/constants.d.ts +0 -1
  166. package/cjs/render/contributions/render/contributions/constants.js +2 -2
  167. package/cjs/render/contributions/render/contributions/constants.js.map +1 -1
  168. package/cjs/render/contributions/render/contributions/group-contribution-render.d.ts +0 -1
  169. package/cjs/render/contributions/render/contributions/group-contribution-render.js +12 -6
  170. package/cjs/render/contributions/render/contributions/group-contribution-render.js.map +1 -1
  171. package/cjs/render/contributions/render/contributions/image-contribution-render.d.ts +0 -1
  172. package/cjs/render/contributions/render/contributions/image-contribution-render.js +12 -6
  173. package/cjs/render/contributions/render/contributions/image-contribution-render.js.map +1 -1
  174. package/cjs/render/contributions/render/contributions/path-contribution-render.d.ts +9 -2
  175. package/cjs/render/contributions/render/contributions/path-contribution-render.js +25 -4
  176. package/cjs/render/contributions/render/contributions/path-contribution-render.js.map +1 -1
  177. package/cjs/render/contributions/render/contributions/polygon-contribution-render.d.ts +9 -2
  178. package/cjs/render/contributions/render/contributions/polygon-contribution-render.js +25 -4
  179. package/cjs/render/contributions/render/contributions/polygon-contribution-render.js.map +1 -1
  180. package/cjs/render/contributions/render/contributions/rect-contribution-render.d.ts +7 -5
  181. package/cjs/render/contributions/render/contributions/rect-contribution-render.js +37 -17
  182. package/cjs/render/contributions/render/contributions/rect-contribution-render.js.map +1 -1
  183. package/cjs/render/contributions/render/contributions/symbol-contribution-render.d.ts +7 -3
  184. package/cjs/render/contributions/render/contributions/symbol-contribution-render.js +27 -6
  185. package/cjs/render/contributions/render/contributions/symbol-contribution-render.js.map +1 -1
  186. package/cjs/render/contributions/render/contributions/text-contribution-render.d.ts +1 -8
  187. package/cjs/render/contributions/render/contributions/text-contribution-render.js +1 -25
  188. package/cjs/render/contributions/render/contributions/text-contribution-render.js.map +1 -1
  189. package/cjs/render/contributions/render/draw-contribution.d.ts +6 -7
  190. package/cjs/render/contributions/render/draw-contribution.js +22 -31
  191. package/cjs/render/contributions/render/draw-contribution.js.map +1 -1
  192. package/cjs/render/contributions/render/draw-interceptor.d.ts +1 -9
  193. package/cjs/render/contributions/render/draw-interceptor.js +27 -41
  194. package/cjs/render/contributions/render/draw-interceptor.js.map +1 -1
  195. package/cjs/render/contributions/render/group-render.js +2 -3
  196. package/cjs/render/contributions/render/group-render.js.map +1 -1
  197. package/cjs/render/contributions/render/image-render.js +1 -2
  198. package/cjs/render/contributions/render/image-render.js.map +1 -1
  199. package/cjs/render/contributions/render/incremental-draw-contribution.d.ts +6 -2
  200. package/cjs/render/contributions/render/incremental-draw-contribution.js +11 -8
  201. package/cjs/render/contributions/render/incremental-draw-contribution.js.map +1 -1
  202. package/cjs/render/contributions/render/line-render.d.ts +0 -1
  203. package/cjs/render/contributions/render/line-render.js +6 -21
  204. package/cjs/render/contributions/render/line-render.js.map +1 -1
  205. package/cjs/render/contributions/render/module.js +87 -32
  206. package/cjs/render/contributions/render/module.js.map +1 -1
  207. package/cjs/render/contributions/render/path-render.d.ts +1 -2
  208. package/cjs/render/contributions/render/path-render.js +5 -8
  209. package/cjs/render/contributions/render/path-render.js.map +1 -1
  210. package/cjs/render/contributions/render/polygon-render.js +1 -2
  211. package/cjs/render/contributions/render/polygon-render.js.map +1 -1
  212. package/cjs/render/contributions/render/rect-render.d.ts +1 -2
  213. package/cjs/render/contributions/render/rect-render.js +5 -11
  214. package/cjs/render/contributions/render/rect-render.js.map +1 -1
  215. package/cjs/render/contributions/render/render-slector.d.ts +4 -1
  216. package/cjs/render/contributions/render/render-slector.js +20 -0
  217. package/cjs/render/contributions/render/render-slector.js.map +1 -1
  218. package/cjs/render/contributions/render/richtext-render.d.ts +0 -1
  219. package/cjs/render/contributions/render/richtext-render.js +7 -12
  220. package/cjs/render/contributions/render/richtext-render.js.map +1 -1
  221. package/cjs/render/contributions/render/symbol-render.js +1 -2
  222. package/cjs/render/contributions/render/symbol-render.js.map +1 -1
  223. package/cjs/render/contributions/render/text-render.js +9 -12
  224. package/cjs/render/contributions/render/text-render.js.map +1 -1
  225. package/cjs/render/contributions/render/utils.js +2 -2
  226. package/cjs/render/contributions/render/utils.js.map +1 -1
  227. package/cjs/render/render-modules.js +1 -1
  228. package/cjs/render/render-modules.js.map +1 -1
  229. package/cjs/render/render-service.js +1 -1
  230. package/cjs/render/render-service.js.map +1 -1
  231. package/dist/index.js +6240 -5326
  232. package/dist/index.min.js +1 -1
  233. package/es/allocator/canvas-allocate.d.ts +0 -4
  234. package/es/allocator/canvas-allocate.js +6 -19
  235. package/es/allocator/canvas-allocate.js.map +1 -1
  236. package/es/allocator/graphic-allocate.d.ts +1 -56
  237. package/es/allocator/graphic-allocate.js +1 -155
  238. package/es/allocator/graphic-allocate.js.map +1 -1
  239. package/es/animate/Ticker/default-ticker.js +1 -1
  240. package/es/animate/Ticker/default-ticker.js.map +1 -1
  241. package/es/animate/config.js +2 -1
  242. package/es/animate/custom-animate.js +1 -2
  243. package/es/canvas/contributions/base-canvas.js +2 -4
  244. package/es/canvas/contributions/base-canvas.js.map +1 -1
  245. package/es/common/Reflect-metadata.js +359 -349
  246. package/es/common/Reflect-metadata.js.map +1 -1
  247. package/es/common/bezier-utils.js +1 -2
  248. package/es/common/inversify-lite/annotation/post_construct.d.ts +4 -0
  249. package/es/common/inversify-lite/annotation/post_construct.js +10 -0
  250. package/es/common/inversify-lite/annotation/post_construct.js.map +1 -0
  251. package/es/common/inversify-lite/container/container.js +4 -2
  252. package/es/common/inversify-lite/container/container.js.map +1 -1
  253. package/es/common/inversify-lite/index.d.ts +8 -1
  254. package/es/common/inversify-lite/index.js +15 -1
  255. package/es/common/inversify-lite/index.js.map +1 -1
  256. package/es/common/inversify-lite/interfaces/interfaces.d.ts +2 -0
  257. package/es/common/inversify-lite/interfaces/interfaces.js.map +1 -1
  258. package/es/common/inversify-lite/planning/queryable_string.d.ts +2 -0
  259. package/es/common/inversify-lite/planning/queryable_string.js +10 -0
  260. package/es/common/inversify-lite/planning/queryable_string.js.map +1 -1
  261. package/es/common/inversify-lite/resolution/resolver.js.map +1 -1
  262. package/es/common/render-area.js +1 -0
  263. package/es/common/render-area.js.map +1 -1
  264. package/es/common/segment/monotone.js +18 -20
  265. package/es/common/segment/monotone.js.map +1 -1
  266. package/es/common/shape/rect.js +1 -2
  267. package/es/common/shape/rect.js.map +1 -1
  268. package/es/common/sort.js +2 -1
  269. package/es/common/split-path.js +1 -2
  270. package/es/core/contributions/layerHandler/canvas2d-contribution.d.ts +2 -2
  271. package/es/core/contributions/layerHandler/canvas2d-contribution.js +9 -5
  272. package/es/core/contributions/layerHandler/canvas2d-contribution.js.map +1 -1
  273. package/es/core/contributions/layerHandler/empty-contribution.d.ts +2 -2
  274. package/es/core/contributions/layerHandler/empty-contribution.js +9 -5
  275. package/es/core/contributions/layerHandler/empty-contribution.js.map +1 -1
  276. package/es/core/contributions/layerHandler/offscreen2d-contribution.d.ts +2 -2
  277. package/es/core/contributions/layerHandler/offscreen2d-contribution.js +9 -5
  278. package/es/core/contributions/layerHandler/offscreen2d-contribution.js.map +1 -1
  279. package/es/core/contributions/textMeasure/AtextMeasure.js +2 -3
  280. package/es/core/contributions/textMeasure/AtextMeasure.js.map +1 -1
  281. package/es/core/contributions/textMeasure/modules.js +1 -1
  282. package/es/core/contributions/textMeasure/modules.js.map +1 -1
  283. package/es/core/core-modules.js +6 -4
  284. package/es/core/core-modules.js.map +1 -1
  285. package/es/core/global.d.ts +0 -4
  286. package/es/core/global.js +4 -8
  287. package/es/core/global.js.map +1 -1
  288. package/es/core/graphic-utils.d.ts +4 -7
  289. package/es/core/graphic-utils.js +15 -20
  290. package/es/core/graphic-utils.js.map +1 -1
  291. package/es/core/layer-service.d.ts +2 -5
  292. package/es/core/layer-service.js +13 -14
  293. package/es/core/layer-service.js.map +1 -1
  294. package/es/core/stage.d.ts +4 -7
  295. package/es/core/stage.js +36 -42
  296. package/es/core/stage.js.map +1 -1
  297. package/es/core/window.d.ts +2 -2
  298. package/es/core/window.js +12 -8
  299. package/es/core/window.js.map +1 -1
  300. package/es/event/event-manager.js +2 -3
  301. package/es/event/event-manager.js.map +1 -1
  302. package/es/graphic/config.d.ts +2 -1
  303. package/es/graphic/config.js +6 -6
  304. package/es/graphic/config.js.map +1 -1
  305. package/es/graphic/graphic-service/arc-contribution.d.ts +5 -1
  306. package/es/graphic/graphic-service/arc-contribution.js +15 -0
  307. package/es/graphic/graphic-service/arc-contribution.js.map +1 -1
  308. package/es/graphic/graphic-service/area-contribution.d.ts +1 -1
  309. package/es/graphic/graphic-service/area-contribution.js +1 -2
  310. package/es/graphic/graphic-service/area-contribution.js.map +1 -1
  311. package/es/graphic/graphic-service/circle-contribution.d.ts +5 -1
  312. package/es/graphic/graphic-service/circle-contribution.js +15 -0
  313. package/es/graphic/graphic-service/circle-contribution.js.map +1 -1
  314. package/es/graphic/graphic-service/common-contribution.js +14 -2
  315. package/es/graphic/graphic-service/common-contribution.js.map +1 -1
  316. package/es/graphic/graphic-service/graphic-module.js +23 -1
  317. package/es/graphic/graphic-service/graphic-module.js.map +1 -1
  318. package/es/graphic/graphic-service/graphic-service.d.ts +7 -2
  319. package/es/graphic/graphic-service/graphic-service.js +32 -25
  320. package/es/graphic/graphic-service/graphic-service.js.map +1 -1
  321. package/es/graphic/graphic-service/path-contribution.d.ts +5 -1
  322. package/es/graphic/graphic-service/path-contribution.js +15 -0
  323. package/es/graphic/graphic-service/path-contribution.js.map +1 -1
  324. package/es/graphic/graphic-service/rect-contribution.d.ts +5 -1
  325. package/es/graphic/graphic-service/rect-contribution.js +15 -0
  326. package/es/graphic/graphic-service/rect-contribution.js.map +1 -1
  327. package/es/graphic/graphic-service/symbol-contribution.d.ts +1 -0
  328. package/es/graphic/graphic-service/symbol-contribution.js +16 -2
  329. package/es/graphic/graphic-service/symbol-contribution.js.map +1 -1
  330. package/es/graphic/graphic.js +2 -3
  331. package/es/graphic/graphic.js.map +1 -1
  332. package/es/graphic/group.d.ts +0 -1
  333. package/es/graphic/group.js +1 -8
  334. package/es/graphic/group.js.map +1 -1
  335. package/es/graphic/rect.d.ts +3 -2
  336. package/es/graphic/rect.js +7 -3
  337. package/es/graphic/rect.js.map +1 -1
  338. package/es/graphic/symbol.js +4 -6
  339. package/es/graphic/symbol.js.map +1 -1
  340. package/es/graphic/text.js +4 -4
  341. package/es/graphic/text.js.map +1 -1
  342. package/es/graphic/theme.d.ts +4 -4
  343. package/es/graphic/theme.js +27 -26
  344. package/es/graphic/theme.js.map +1 -1
  345. package/es/graphic/wrap-text.js +4 -4
  346. package/es/graphic/wrap-text.js.map +1 -1
  347. package/es/index.d.ts +0 -2
  348. package/es/index.js +0 -4
  349. package/es/index.js.map +1 -1
  350. package/es/interface/allocator.d.ts +0 -1
  351. package/es/interface/allocator.js.map +1 -1
  352. package/es/interface/global.d.ts +0 -1
  353. package/es/interface/global.js.map +1 -1
  354. package/es/interface/graphic/rect.d.ts +0 -2
  355. package/es/interface/graphic/rect.js.map +1 -1
  356. package/es/interface/graphic.d.ts +4 -1
  357. package/es/interface/graphic.js.map +1 -1
  358. package/es/interface/render.d.ts +2 -2
  359. package/es/interface/render.js.map +1 -1
  360. package/es/interface/stage.d.ts +1 -2
  361. package/es/interface/stage.js.map +1 -1
  362. package/es/modules.d.ts +2 -1
  363. package/es/modules.js +4 -0
  364. package/es/modules.js.map +1 -1
  365. package/es/picker/global-picker-service.d.ts +2 -2
  366. package/es/picker/global-picker-service.js +9 -5
  367. package/es/picker/global-picker-service.js.map +1 -1
  368. package/es/picker/pick-modules.js +4 -1
  369. package/es/picker/pick-modules.js.map +1 -1
  370. package/es/picker/picker-service.d.ts +2 -2
  371. package/es/picker/picker-service.js +5 -5
  372. package/es/picker/picker-service.js.map +1 -1
  373. package/es/plugins/plugin-modules.js +2 -1
  374. package/es/plugins/plugin-modules.js.map +1 -1
  375. package/es/render/contributions/render/arc-render.js +0 -3
  376. package/es/render/contributions/render/arc-render.js.map +1 -1
  377. package/es/render/contributions/render/area-render.d.ts +0 -1
  378. package/es/render/contributions/render/area-render.js +5 -45
  379. package/es/render/contributions/render/area-render.js.map +1 -1
  380. package/es/render/contributions/render/base-render.d.ts +1 -1
  381. package/es/render/contributions/render/base-render.js +22 -15
  382. package/es/render/contributions/render/base-render.js.map +1 -1
  383. package/es/render/contributions/render/circle-render.js +0 -3
  384. package/es/render/contributions/render/circle-render.js.map +1 -1
  385. package/es/render/contributions/render/contributions/arc-contribution-render.d.ts +7 -3
  386. package/es/render/contributions/render/contributions/arc-contribution-render.js +32 -6
  387. package/es/render/contributions/render/contributions/arc-contribution-render.js.map +1 -1
  388. package/es/render/contributions/render/contributions/area-contribution-render.d.ts +4 -3
  389. package/es/render/contributions/render/contributions/area-contribution-render.js +23 -5
  390. package/es/render/contributions/render/contributions/area-contribution-render.js.map +1 -1
  391. package/es/render/contributions/render/contributions/base-contribution-render.d.ts +0 -2
  392. package/es/render/contributions/render/contributions/base-contribution-render.js +10 -6
  393. package/es/render/contributions/render/contributions/base-contribution-render.js.map +1 -1
  394. package/es/render/contributions/render/contributions/circle-contribution-render.d.ts +7 -3
  395. package/es/render/contributions/render/contributions/circle-contribution-render.js +32 -6
  396. package/es/render/contributions/render/contributions/circle-contribution-render.js.map +1 -1
  397. package/es/render/contributions/render/contributions/constants.d.ts +0 -1
  398. package/es/render/contributions/render/contributions/constants.js +0 -2
  399. package/es/render/contributions/render/contributions/constants.js.map +1 -1
  400. package/es/render/contributions/render/contributions/group-contribution-render.d.ts +0 -1
  401. package/es/render/contributions/render/contributions/group-contribution-render.js +13 -3
  402. package/es/render/contributions/render/contributions/group-contribution-render.js.map +1 -1
  403. package/es/render/contributions/render/contributions/image-contribution-render.d.ts +0 -1
  404. package/es/render/contributions/render/contributions/image-contribution-render.js +14 -4
  405. package/es/render/contributions/render/contributions/image-contribution-render.js.map +1 -1
  406. package/es/render/contributions/render/contributions/path-contribution-render.d.ts +9 -2
  407. package/es/render/contributions/render/contributions/path-contribution-render.js +29 -3
  408. package/es/render/contributions/render/contributions/path-contribution-render.js.map +1 -1
  409. package/es/render/contributions/render/contributions/polygon-contribution-render.d.ts +9 -2
  410. package/es/render/contributions/render/contributions/polygon-contribution-render.js +29 -3
  411. package/es/render/contributions/render/contributions/polygon-contribution-render.js.map +1 -1
  412. package/es/render/contributions/render/contributions/rect-contribution-render.d.ts +7 -5
  413. package/es/render/contributions/render/contributions/rect-contribution-render.js +46 -19
  414. package/es/render/contributions/render/contributions/rect-contribution-render.js.map +1 -1
  415. package/es/render/contributions/render/contributions/symbol-contribution-render.d.ts +7 -3
  416. package/es/render/contributions/render/contributions/symbol-contribution-render.js +24 -6
  417. package/es/render/contributions/render/contributions/symbol-contribution-render.js.map +1 -1
  418. package/es/render/contributions/render/contributions/text-contribution-render.d.ts +1 -8
  419. package/es/render/contributions/render/contributions/text-contribution-render.js +1 -24
  420. package/es/render/contributions/render/contributions/text-contribution-render.js.map +1 -1
  421. package/es/render/contributions/render/draw-contribution.d.ts +6 -7
  422. package/es/render/contributions/render/draw-contribution.js +24 -35
  423. package/es/render/contributions/render/draw-contribution.js.map +1 -1
  424. package/es/render/contributions/render/draw-interceptor.d.ts +1 -9
  425. package/es/render/contributions/render/draw-interceptor.js +35 -38
  426. package/es/render/contributions/render/draw-interceptor.js.map +1 -1
  427. package/es/render/contributions/render/group-render.js +1 -4
  428. package/es/render/contributions/render/group-render.js.map +1 -1
  429. package/es/render/contributions/render/image-render.js +1 -3
  430. package/es/render/contributions/render/image-render.js.map +1 -1
  431. package/es/render/contributions/render/incremental-draw-contribution.d.ts +6 -2
  432. package/es/render/contributions/render/incremental-draw-contribution.js +11 -5
  433. package/es/render/contributions/render/incremental-draw-contribution.js.map +1 -1
  434. package/es/render/contributions/render/line-render.d.ts +0 -1
  435. package/es/render/contributions/render/line-render.js +6 -21
  436. package/es/render/contributions/render/line-render.js.map +1 -1
  437. package/es/render/contributions/render/module.js +83 -29
  438. package/es/render/contributions/render/module.js.map +1 -1
  439. package/es/render/contributions/render/path-render.d.ts +1 -2
  440. package/es/render/contributions/render/path-render.js +4 -8
  441. package/es/render/contributions/render/path-render.js.map +1 -1
  442. package/es/render/contributions/render/polygon-render.js +0 -3
  443. package/es/render/contributions/render/polygon-render.js.map +1 -1
  444. package/es/render/contributions/render/rect-render.d.ts +1 -2
  445. package/es/render/contributions/render/rect-render.js +3 -11
  446. package/es/render/contributions/render/rect-render.js.map +1 -1
  447. package/es/render/contributions/render/render-slector.d.ts +4 -1
  448. package/es/render/contributions/render/render-slector.js +15 -0
  449. package/es/render/contributions/render/render-slector.js.map +1 -1
  450. package/es/render/contributions/render/richtext-render.d.ts +0 -1
  451. package/es/render/contributions/render/richtext-render.js +6 -12
  452. package/es/render/contributions/render/richtext-render.js.map +1 -1
  453. package/es/render/contributions/render/symbol-render.js +0 -3
  454. package/es/render/contributions/render/symbol-render.js.map +1 -1
  455. package/es/render/contributions/render/text-render.js +9 -13
  456. package/es/render/contributions/render/text-render.js.map +1 -1
  457. package/es/render/contributions/render/utils.js +2 -2
  458. package/es/render/contributions/render/utils.js.map +1 -1
  459. package/es/render/render-modules.js +1 -1
  460. package/es/render/render-modules.js.map +1 -1
  461. package/es/render/render-service.js +1 -1
  462. package/es/render/render-service.js.map +1 -1
  463. package/package.json +3 -5
  464. package/cjs/allocator/bounds-allocate.d.ts +0 -13
  465. package/cjs/allocator/bounds-allocate.js +0 -38
  466. package/cjs/allocator/bounds-allocate.js.map +0 -1
  467. package/cjs/common/inversify/annotation/inject.d.ts +0 -1
  468. package/cjs/common/inversify/annotation/inject.js +0 -10
  469. package/cjs/common/inversify/annotation/inject.js.map +0 -1
  470. package/cjs/common/inversify/annotation/inject_base.d.ts +0 -14
  471. package/cjs/common/inversify/annotation/inject_base.js +0 -39
  472. package/cjs/common/inversify/annotation/inject_base.js.map +0 -1
  473. package/cjs/common/inversify/annotation/injectable.d.ts +0 -1
  474. package/cjs/common/inversify/annotation/injectable.js.map +0 -1
  475. package/cjs/common/inversify/annotation/multi_inject.d.ts +0 -1
  476. package/cjs/common/inversify/annotation/multi_inject.js +0 -10
  477. package/cjs/common/inversify/annotation/multi_inject.js.map +0 -1
  478. package/cjs/common/inversify/annotation/named.d.ts +0 -1
  479. package/cjs/common/inversify/annotation/named.js +0 -14
  480. package/cjs/common/inversify/annotation/named.js.map +0 -1
  481. package/cjs/common/inversify/binding.d.ts +0 -18
  482. package/cjs/common/inversify/binding.js +0 -26
  483. package/cjs/common/inversify/binding.js.map +0 -1
  484. package/cjs/common/inversify/container.d.ts +0 -28
  485. package/cjs/common/inversify/container.js +0 -155
  486. package/cjs/common/inversify/container.js.map +0 -1
  487. package/cjs/common/inversify/cotainer-module.d.ts +0 -6
  488. package/cjs/common/inversify/cotainer-module.js +0 -16
  489. package/cjs/common/inversify/cotainer-module.js.map +0 -1
  490. package/cjs/common/inversify/index.d.ts +0 -7
  491. package/cjs/common/inversify/index.js +0 -75
  492. package/cjs/common/inversify/index.js.map +0 -1
  493. package/cjs/common/inversify/interfaces.d.ts +0 -218
  494. package/cjs/common/inversify/interfaces.js +0 -6
  495. package/cjs/common/inversify/interfaces.js.map +0 -1
  496. package/cjs/common/inversify/literal_types.d.ts +0 -5
  497. package/cjs/common/inversify/literal_types.js +0 -34
  498. package/cjs/common/inversify/literal_types.js.map +0 -1
  499. package/cjs/common/inversify/meta-data.d.ts +0 -6
  500. package/cjs/common/inversify/meta-data.js +0 -19
  501. package/cjs/common/inversify/meta-data.js.map +0 -1
  502. package/cjs/common/inversify/metadata_keys.d.ts +0 -12
  503. package/cjs/common/inversify/metadata_keys.js +0 -15
  504. package/cjs/common/inversify/metadata_keys.js.map +0 -1
  505. package/cjs/common/inversify/metadata_reader.d.ts +0 -6
  506. package/cjs/common/inversify/metadata_reader.js +0 -28
  507. package/cjs/common/inversify/metadata_reader.js.map +0 -1
  508. package/cjs/common/inversify/syntax/binding_in_syntax.d.ts +0 -10
  509. package/cjs/common/inversify/syntax/binding_in_syntax.js +0 -29
  510. package/cjs/common/inversify/syntax/binding_in_syntax.js.map +0 -1
  511. package/cjs/common/inversify/syntax/binding_to_syntax.d.ts +0 -12
  512. package/cjs/common/inversify/syntax/binding_to_syntax.js +0 -40
  513. package/cjs/common/inversify/syntax/binding_to_syntax.js.map +0 -1
  514. package/cjs/common/inversify/syntax/constraint_helpers.d.ts +0 -2
  515. package/cjs/common/inversify/syntax/constraint_helpers.js +0 -20
  516. package/cjs/common/inversify/syntax/constraint_helpers.js.map +0 -1
  517. package/es/allocator/bounds-allocate.d.ts +0 -13
  518. package/es/allocator/bounds-allocate.js +0 -32
  519. package/es/allocator/bounds-allocate.js.map +0 -1
  520. package/es/common/inversify/annotation/inject.d.ts +0 -1
  521. package/es/common/inversify/annotation/inject.js +0 -6
  522. package/es/common/inversify/annotation/inject.js.map +0 -1
  523. package/es/common/inversify/annotation/inject_base.d.ts +0 -14
  524. package/es/common/inversify/annotation/inject_base.js +0 -29
  525. package/es/common/inversify/annotation/inject_base.js.map +0 -1
  526. package/es/common/inversify/annotation/injectable.d.ts +0 -1
  527. package/es/common/inversify/annotation/injectable.js +0 -10
  528. package/es/common/inversify/annotation/injectable.js.map +0 -1
  529. package/es/common/inversify/annotation/multi_inject.d.ts +0 -1
  530. package/es/common/inversify/annotation/multi_inject.js +0 -6
  531. package/es/common/inversify/annotation/multi_inject.js.map +0 -1
  532. package/es/common/inversify/annotation/named.d.ts +0 -1
  533. package/es/common/inversify/annotation/named.js +0 -10
  534. package/es/common/inversify/annotation/named.js.map +0 -1
  535. package/es/common/inversify/binding.d.ts +0 -18
  536. package/es/common/inversify/binding.js +0 -22
  537. package/es/common/inversify/binding.js.map +0 -1
  538. package/es/common/inversify/container.d.ts +0 -28
  539. package/es/common/inversify/container.js +0 -155
  540. package/es/common/inversify/container.js.map +0 -1
  541. package/es/common/inversify/cotainer-module.d.ts +0 -6
  542. package/es/common/inversify/cotainer-module.js +0 -8
  543. package/es/common/inversify/cotainer-module.js.map +0 -1
  544. package/es/common/inversify/index.d.ts +0 -7
  545. package/es/common/inversify/index.js +0 -14
  546. package/es/common/inversify/index.js.map +0 -1
  547. package/es/common/inversify/interfaces.d.ts +0 -218
  548. package/es/common/inversify/interfaces.js +0 -2
  549. package/es/common/inversify/interfaces.js.map +0 -1
  550. package/es/common/inversify/literal_types.d.ts +0 -5
  551. package/es/common/inversify/literal_types.js +0 -20
  552. package/es/common/inversify/literal_types.js.map +0 -1
  553. package/es/common/inversify/meta-data.d.ts +0 -6
  554. package/es/common/inversify/meta-data.js +0 -11
  555. package/es/common/inversify/meta-data.js.map +0 -1
  556. package/es/common/inversify/metadata_keys.d.ts +0 -12
  557. package/es/common/inversify/metadata_keys.js +0 -28
  558. package/es/common/inversify/metadata_keys.js.map +0 -1
  559. package/es/common/inversify/metadata_reader.d.ts +0 -6
  560. package/es/common/inversify/metadata_reader.js +0 -18
  561. package/es/common/inversify/metadata_reader.js.map +0 -1
  562. package/es/common/inversify/syntax/binding_in_syntax.d.ts +0 -10
  563. package/es/common/inversify/syntax/binding_in_syntax.js +0 -24
  564. package/es/common/inversify/syntax/binding_in_syntax.js.map +0 -1
  565. package/es/common/inversify/syntax/binding_to_syntax.d.ts +0 -12
  566. package/es/common/inversify/syntax/binding_to_syntax.js +0 -36
  567. package/es/common/inversify/syntax/binding_to_syntax.js.map +0 -1
  568. package/es/common/inversify/syntax/constraint_helpers.d.ts +0 -2
  569. package/es/common/inversify/syntax/constraint_helpers.js +0 -18
  570. package/es/common/inversify/syntax/constraint_helpers.js.map +0 -1
@@ -1,10 +1,9 @@
1
- import type { IPath, IContext2d, IThemeAttribute, IGraphicAttribute, IMarkAttribute, IPathRenderContribution, IGraphicRender, IContributionProvider, IDrawContext, IGraphicRenderDrawParams, IRenderService, IPathGraphicAttribute } from '../../../interface';
1
+ import type { IPath, IContext2d, IThemeAttribute, IGraphicAttribute, IMarkAttribute, IPathRenderContribution, IGraphicRender, IContributionProvider, IDrawContext, IGraphicRenderDrawParams, IRenderService } from '../../../interface';
2
2
  import { BaseRender } from './base-render';
3
3
  export declare class DefaultCanvasPathRender extends BaseRender<IPath> implements IGraphicRender {
4
4
  protected readonly pathRenderContribitions: IContributionProvider<IPathRenderContribution>;
5
5
  type: 'path';
6
6
  numberType: number;
7
- tempTheme: Required<IPathGraphicAttribute>;
8
7
  constructor(pathRenderContribitions: IContributionProvider<IPathRenderContribution>);
9
8
  drawShape(path: IPath, context: IContext2d, x: number, y: number, drawContext: IDrawContext, params?: IGraphicRenderDrawParams, fillCb?: (ctx: IContext2d, markAttribute: Partial<IMarkAttribute & IGraphicAttribute>, themeAttribute: IThemeAttribute) => boolean, strokeCb?: (ctx: IContext2d, markAttribute: Partial<IMarkAttribute & IGraphicAttribute>, themeAttribute: IThemeAttribute) => boolean): void;
10
9
  draw(path: IPath, renderService: IRenderService, drawContext: IDrawContext, params?: IGraphicRenderDrawParams): void;
@@ -24,21 +24,18 @@ import { PathRenderContribution } from "./contributions/constants";
24
24
 
25
25
  import { BaseRender } from "./base-render";
26
26
 
27
- import { defaultPathBackgroundRenderContribution, defaultPathTextureRenderContribution } from "./contributions/path-contribution-render";
28
-
29
27
  let DefaultCanvasPathRender = class extends BaseRender {
30
28
  constructor(pathRenderContribitions) {
31
29
  super(), this.pathRenderContribitions = pathRenderContribitions, this.numberType = PATH_NUMBER_TYPE,
32
- this.builtinContributions = [ defaultPathBackgroundRenderContribution, defaultPathTextureRenderContribution ],
33
30
  this.init(pathRenderContribitions);
34
31
  }
35
32
  drawShape(path, context, x, y, drawContext, params, fillCb, strokeCb) {
36
- var _a, _b, _c;
37
- const pathAttribute = null !== (_a = this.tempTheme) && void 0 !== _a ? _a : getTheme(path, null == params ? void 0 : params.theme).path, {x: originX = pathAttribute.x, y: originY = pathAttribute.y} = path.attribute, z = null !== (_b = this.z) && void 0 !== _b ? _b : 0, data = this.valid(path, pathAttribute, fillCb, strokeCb);
33
+ var _a, _b;
34
+ const pathAttribute = getTheme(path, null == params ? void 0 : params.theme).path, {x: originX = pathAttribute.x, y: originY = pathAttribute.y} = path.attribute, z = null !== (_a = this.z) && void 0 !== _a ? _a : 0, data = this.valid(path, pathAttribute, fillCb, strokeCb);
38
35
  if (!data) return;
39
36
  const {fVisible: fVisible, sVisible: sVisible, doFill: doFill, doStroke: doStroke} = data;
40
37
  if (context.beginPath(), path.pathShape) renderCommandList(path.pathShape.commandList, context, x, y, 1, 1, z); else {
41
- const path2D = null !== (_c = path.attribute.path) && void 0 !== _c ? _c : pathAttribute.path;
38
+ const path2D = null !== (_b = path.attribute.path) && void 0 !== _b ? _b : pathAttribute.path;
42
39
  renderCommandList(path2D.commandList, context, x, y, 1, 1, z);
43
40
  }
44
41
  context.setShadowBlendStyle && context.setShadowBlendStyle(path, path.attribute, pathAttribute),
@@ -49,8 +46,7 @@ let DefaultCanvasPathRender = class extends BaseRender {
49
46
  }
50
47
  draw(path, renderService, drawContext, params) {
51
48
  const pathAttribute = getTheme(path, null == params ? void 0 : params.theme).path;
52
- this.tempTheme = pathAttribute, this._draw(path, pathAttribute, !1, drawContext, params),
53
- this.tempTheme = null;
49
+ this._draw(path, pathAttribute, !1, drawContext, params);
54
50
  }
55
51
  };
56
52
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/render/contributions/render/path-render.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,gCAAgC,CAAC;AAE3E,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAC7E,OAAO,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AAgBxE,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAE9D,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AAEnE,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,EACL,uCAAuC,EACvC,oCAAoC,EACrC,MAAM,0CAA0C,CAAC;AAG3C,IAAM,uBAAuB,GAA7B,MAAM,uBAAwB,SAAQ,UAAiB;IAK5D,YAGqB,uBAAuE;QAE1F,KAAK,EAAE,CAAC;QAFW,4BAAuB,GAAvB,uBAAuB,CAAgD;QAN5F,eAAU,GAAW,gBAAgB,CAAC;QASpC,IAAI,CAAC,oBAAoB,GAAG,CAAC,uCAAuC,EAAE,oCAAoC,CAAC,CAAC;QAC5G,IAAI,CAAC,IAAI,CAAC,uBAAuB,CAAC,CAAC;IACrC,CAAC;I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AI,CAAC;QACzD,IAAI,CAAC,SAAS,GAAG,aAAa,CAAC;QAC/B,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,aAAa,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,CAAC,CAAC;QAC5D,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;IACxB,CAAC;CACF,CAAA;AA9GY,uBAAuB;IADnC,UAAU,EAAE;IAOR,WAAA,MAAM,CAAC,oBAAoB,CAAC,CAAA;IAC5B,WAAA,KAAK,CAAC,sBAAsB,CAAC,CAAA;;GAPrB,uBAAuB,CA8GnC;SA9GY,uBAAuB","file":"path-render.js","sourcesContent":["import { inject, injectable, named } from '../../../common/inversify-lite';\n// eslint-disable-next-line @typescript-eslint/consistent-type-imports\nimport { ContributionProvider } from '../../../common/contribution-provider';\nimport { renderCommandList } from '../../../common/render-command-list';\nimport type {\n IPath,\n ICustomPath2D,\n IContext2d,\n IThemeAttribute,\n IGraphicAttribute,\n IMarkAttribute,\n IPathRenderContribution,\n IGraphicRender,\n IContributionProvider,\n IDrawContext,\n IGraphicRenderDrawParams,\n IRenderService,\n IPathGraphicAttribute\n} from '../../../interface';\nimport { getTheme } from '../../../graphic/theme';\nimport { PATH_NUMBER_TYPE } from '../../../graphic/constants';\nimport { drawPathProxy, fillVisible, runFill, runStroke, strokeVisible } from './utils';\nimport { PathRenderContribution } from './contributions/constants';\nimport { BaseRenderContributionTime } from '../../../common/enums';\nimport { BaseRender } from './base-render';\nimport { mat4Allocate } from '../../../allocator/matrix-allocate';\nimport {\n defaultPathBackgroundRenderContribution,\n defaultPathTextureRenderContribution\n} from './contributions/path-contribution-render';\n\n@injectable()\nexport class DefaultCanvasPathRender extends BaseRender<IPath> implements IGraphicRender {\n type: 'path';\n numberType: number = PATH_NUMBER_TYPE;\n tempTheme: Required<IPathGraphicAttribute>;\n\n constructor(\n @inject(ContributionProvider)\n @named(PathRenderContribution)\n protected readonly pathRenderContribitions: IContributionProvider<IPathRenderContribution>\n ) {\n super();\n this.builtinContributions = [defaultPathBackgroundRenderContribution, defaultPathTextureRenderContribution];\n this.init(pathRenderContribitions);\n }\n\n drawShape(\n path: IPath,\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 pathAttribute = graphicService.themeService.getCurrentTheme().pathAttribute;\n const pathAttribute = this.tempTheme ?? getTheme(path, params?.theme).path;\n const { x: originX = pathAttribute.x, y: originY = pathAttribute.y } = path.attribute;\n\n const z = this.z ?? 0;\n\n const data = this.valid(path, pathAttribute, fillCb, strokeCb);\n if (!data) {\n return;\n }\n const { fVisible, sVisible, doFill, doStroke } = data;\n\n context.beginPath();\n if (path.pathShape) {\n renderCommandList((path.pathShape as ICustomPath2D).commandList, context, x, y, 1, 1, z);\n } else {\n const path2D = path.attribute.path ?? pathAttribute.path;\n renderCommandList((path2D as ICustomPath2D).commandList, context, x, y, 1, 1, z);\n }\n\n // shadow\n context.setShadowBlendStyle && context.setShadowBlendStyle(path, path.attribute, pathAttribute);\n\n this.beforeRenderStep(\n path,\n context,\n x,\n y,\n doFill,\n doStroke,\n fVisible,\n sVisible,\n pathAttribute,\n drawContext,\n fillCb,\n strokeCb\n );\n\n if (doStroke) {\n if (strokeCb) {\n strokeCb(context, path.attribute, pathAttribute);\n } else if (sVisible) {\n context.setStrokeStyle(path, path.attribute, originX - x, originY - y, pathAttribute);\n context.stroke();\n }\n }\n if (doFill) {\n if (fillCb) {\n fillCb(context, path.attribute, pathAttribute);\n } else if (fVisible) {\n context.setCommonStyle(path, path.attribute, originX - x, originY - y, pathAttribute);\n context.fill();\n }\n }\n\n this.afterRenderStep(\n path,\n context,\n x,\n y,\n doFill,\n doStroke,\n fVisible,\n sVisible,\n pathAttribute,\n drawContext,\n fillCb,\n strokeCb\n );\n }\n\n draw(path: IPath, renderService: IRenderService, drawContext: IDrawContext, params?: IGraphicRenderDrawParams) {\n const pathAttribute = getTheme(path, params?.theme).path;\n this.tempTheme = pathAttribute;\n this._draw(path, pathAttribute, false, drawContext, params);\n this.tempTheme = null;\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/render/contributions/render/path-render.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,gCAAgC,CAAC;AAE3E,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAC7E,OAAO,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AAexE,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAE9D,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AAEnE,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAIpC,IAAM,uBAAuB,GAA7B,MAAM,uBAAwB,SAAQ,UAAiB;IAI5D,YAGqB,uBAAuE;QAE1F,KAAK,EAAE,CAAC;QAFW,4BAAuB,GAAvB,uBAAuB,CAAgD;QAL5F,eAAU,GAAW,gBAAgB,CAAC;QAQpC,IAAI,CAAC,IAAI,CAAC,uBAAuB,CAAC,CAAC;IACrC,CAAC;IAED,SAAS,CACP,IAAW,EACX,OAAmB,EACnB,CAAS,EACT,CAAS,EACT,WAAyB,EACzB,MAAiC,EACjC,MAIY,EACZ,QAIY;;QAGZ,MAAM,aAAa,GAAG,QAAQ,CAAC,IAAI,EAAE,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,KAAK,CAAC,CAAC,IAAI,CAAC;QACzD,MAAM,EAAE,CAAC,EAAE,OAAO,GAAG,aAAa,CAAC,CAAC,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inject, injectable, named } from '../../../common/inversify-lite';\n// eslint-disable-next-line @typescript-eslint/consistent-type-imports\nimport { ContributionProvider } from '../../../common/contribution-provider';\nimport { renderCommandList } from '../../../common/render-command-list';\nimport type {\n IPath,\n ICustomPath2D,\n IContext2d,\n IThemeAttribute,\n IGraphicAttribute,\n IMarkAttribute,\n IPathRenderContribution,\n IGraphicRender,\n IContributionProvider,\n IDrawContext,\n IGraphicRenderDrawParams,\n IRenderService\n} from '../../../interface';\nimport { getTheme } from '../../../graphic/theme';\nimport { PATH_NUMBER_TYPE } from '../../../graphic/constants';\nimport { drawPathProxy, fillVisible, runFill, runStroke, strokeVisible } from './utils';\nimport { PathRenderContribution } from './contributions/constants';\nimport { BaseRenderContributionTime } from '../../../common/enums';\nimport { BaseRender } from './base-render';\nimport { mat4Allocate } from '../../../allocator/matrix-allocate';\n\n@injectable()\nexport class DefaultCanvasPathRender extends BaseRender<IPath> implements IGraphicRender {\n type: 'path';\n numberType: number = PATH_NUMBER_TYPE;\n\n constructor(\n @inject(ContributionProvider)\n @named(PathRenderContribution)\n protected readonly pathRenderContribitions: IContributionProvider<IPathRenderContribution>\n ) {\n super();\n this.init(pathRenderContribitions);\n }\n\n drawShape(\n path: IPath,\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 pathAttribute = graphicService.themeService.getCurrentTheme().pathAttribute;\n const pathAttribute = getTheme(path, params?.theme).path;\n const { x: originX = pathAttribute.x, y: originY = pathAttribute.y } = path.attribute;\n\n const z = this.z ?? 0;\n\n const data = this.valid(path, pathAttribute, fillCb, strokeCb);\n if (!data) {\n return;\n }\n const { fVisible, sVisible, doFill, doStroke } = data;\n\n context.beginPath();\n if (path.pathShape) {\n renderCommandList((path.pathShape as ICustomPath2D).commandList, context, x, y, 1, 1, z);\n } else {\n const path2D = path.attribute.path ?? pathAttribute.path;\n renderCommandList((path2D as ICustomPath2D).commandList, context, x, y, 1, 1, z);\n }\n\n // shadow\n context.setShadowBlendStyle && context.setShadowBlendStyle(path, path.attribute, pathAttribute);\n\n this.beforeRenderStep(\n path,\n context,\n x,\n y,\n doFill,\n doStroke,\n fVisible,\n sVisible,\n pathAttribute,\n drawContext,\n fillCb,\n strokeCb\n );\n\n if (doStroke) {\n if (strokeCb) {\n strokeCb(context, path.attribute, pathAttribute);\n } else if (sVisible) {\n context.setStrokeStyle(path, path.attribute, originX - x, originY - y, pathAttribute);\n context.stroke();\n }\n }\n if (doFill) {\n if (fillCb) {\n fillCb(context, path.attribute, pathAttribute);\n } else if (fVisible) {\n context.setCommonStyle(path, path.attribute, originX - x, originY - y, pathAttribute);\n context.fill();\n }\n }\n\n this.afterRenderStep(\n path,\n context,\n x,\n y,\n doFill,\n doStroke,\n fVisible,\n sVisible,\n pathAttribute,\n drawContext,\n fillCb,\n strokeCb\n );\n }\n\n draw(path: IPath, renderService: IRenderService, drawContext: IDrawContext, params?: IGraphicRenderDrawParams) {\n const pathAttribute = getTheme(path, params?.theme).path;\n this._draw(path, pathAttribute, false, drawContext, params);\n }\n}\n"]}
@@ -26,12 +26,9 @@ import { ContributionProvider } from "../../../common/contribution-provider";
26
26
 
27
27
  import { BaseRender } from "./base-render";
28
28
 
29
- import { defaultPolygonBackgroundRenderContribution, defaultPolygonTextureRenderContribution } from "./contributions/polygon-contribution-render";
30
-
31
29
  let DefaultCanvasPolygonRender = class extends BaseRender {
32
30
  constructor(polygonRenderContribitions) {
33
31
  super(), this.polygonRenderContribitions = polygonRenderContribitions, this.numberType = POLYGON_NUMBER_TYPE,
34
- this.builtinContributions = [ defaultPolygonBackgroundRenderContribution, defaultPolygonTextureRenderContribution ],
35
32
  this.init(polygonRenderContribitions);
36
33
  }
37
34
  drawShape(polygon, context, x, y, drawContext, params, fillCb, strokeCb) {
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/render/contributions/render/polygon-render.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAcjE,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAE1E,OAAO,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AAEtE,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAE7E,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EACL,0CAA0C,EAC1C,uCAAuC,EACxC,MAAM,6CAA6C,CAAC;AAG9C,IAAM,0BAA0B,GAAhC,MAAM,0BAA2B,SAAQ,UAAoB;IAIlE,YAGqB,0BAA6E;QAEhG,KAAK,EAAE,CAAC;QAFW,+BAA0B,GAA1B,0BAA0B,CAAmD;QALlG,eAAU,GAAW,mBAAmB,CAAC;QAQvC,IAAI,CAAC,oBAAoB,GAAG,CAAC,0CAA0C,EAAE,uCAAuC,CAAC,CAAC;QAClH,IAAI,CAAC,IAAI,CAAC,0BAA0B,CAAC,CAAC;IACxC,CAAC;IAED,SAAS,CACP,OAAiB,EACjB,OAAmB,EACnB,CAAS,EACT,CAAS,EACT,WAAyB,EACzB,MAAiC,EACjC,MAIY,EACZ,QAIY;QAGZ,MAAM,gBAAgB,GAAG,QAAQ,CAAC,OAAO,EAAE,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,KAAK,CAAC,CAAC,OAAO,CAAC;QAClE,MAAM,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,gBAAgB,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,CAAC,CAAC;IACpE,CAAC;CACF,CAAA;AApHY,0BAA0B;IADtC,UAAU,EAAE;IAMR,WAAA,MAAM,CAAC,oBAAoB,CAAC,CAAA;IAC5B,WAAA,KAAK,CAAC,yBAAyB,CAAC,CAAA;;GANxB,0BAA0B,CAoHtC;SApHY,0BAA0B","file":"polygon-render.js","sourcesContent":["import { isArray } from '@visactor/vutils';\nimport { inject, injectable, named } from '../../../common/inversify-lite';\nimport { getTheme } from '../../../graphic/theme';\nimport { POLYGON_NUMBER_TYPE } from '../../../graphic/constants';\nimport type {\n IGraphicAttribute,\n IContext2d,\n IMarkAttribute,\n IPolygon,\n IThemeAttribute,\n IGraphicRender,\n IPolygonRenderContribution,\n IContributionProvider,\n IDrawContext,\n IGraphicRenderDrawParams,\n IRenderService\n} from '../../../interface';\nimport { drawPolygon, drawRoundedPolygon } from '../../../common/polygon';\nimport { drawPathProxy, fillVisible, runFill, runStroke, strokeVisible } from './utils';\nimport { PolygonRenderContribution } from './contributions/constants';\n// eslint-disable-next-line @typescript-eslint/consistent-type-imports\nimport { ContributionProvider } from '../../../common/contribution-provider';\nimport { BaseRenderContributionTime } from '../../../common/enums';\nimport { BaseRender } from './base-render';\nimport {\n defaultPolygonBackgroundRenderContribution,\n defaultPolygonTextureRenderContribution\n} from './contributions/polygon-contribution-render';\n\n@injectable()\nexport class DefaultCanvasPolygonRender extends BaseRender<IPolygon> implements IGraphicRender {\n type: 'polygon';\n numberType: number = POLYGON_NUMBER_TYPE;\n\n constructor(\n @inject(ContributionProvider)\n @named(PolygonRenderContribution)\n protected readonly polygonRenderContribitions: IContributionProvider<IPolygonRenderContribution>\n ) {\n super();\n this.builtinContributions = [defaultPolygonBackgroundRenderContribution, defaultPolygonTextureRenderContribution];\n this.init(polygonRenderContribitions);\n }\n\n drawShape(\n polygon: IPolygon,\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 polygonAttribute = graphicService.themeService.getCurrentTheme().polygonAttribute;\n const polygonAttribute = getTheme(polygon, params?.theme).polygon;\n const {\n points = polygonAttribute.points,\n cornerRadius = polygonAttribute.cornerRadius,\n x: originX = polygonAttribute.x,\n y: originY = polygonAttribute.y,\n closePath = polygonAttribute.closePath\n } = polygon.attribute;\n\n const data = this.valid(polygon, polygonAttribute, fillCb, strokeCb);\n if (!data) {\n return;\n }\n const { fVisible, sVisible, doFill, doStroke } = data;\n\n context.beginPath();\n\n if ((cornerRadius as number) <= 0 || (isArray(cornerRadius) && (<number[]>cornerRadius).every(num => num === 0))) {\n drawPolygon(context.camera ? context : context.nativeContext, points, x, y);\n } else {\n // FIXME: type\n drawRoundedPolygon(context.camera ? context : context.nativeContext, points, x, y, cornerRadius, closePath);\n }\n // polygon 默认闭合\n closePath && context.closePath();\n\n // shadow\n context.setShadowBlendStyle && context.setShadowBlendStyle(polygon, polygon.attribute, polygonAttribute);\n\n this.beforeRenderStep(\n polygon,\n context,\n x,\n y,\n doFill,\n doStroke,\n fVisible,\n sVisible,\n polygonAttribute,\n drawContext,\n fillCb,\n strokeCb\n );\n\n if (doFill) {\n if (fillCb) {\n fillCb(context, polygon.attribute, polygonAttribute);\n } else if (fVisible) {\n // 存在fill\n context.setCommonStyle(polygon, polygon.attribute, originX - x, originY - y, polygonAttribute);\n context.fill();\n }\n }\n if (doStroke) {\n if (strokeCb) {\n strokeCb(context, polygon.attribute, polygonAttribute);\n } else if (sVisible) {\n // 存在stroke\n context.setStrokeStyle(polygon, polygon.attribute, originX - x, originY - y, polygonAttribute);\n context.stroke();\n }\n }\n\n this.afterRenderStep(\n polygon,\n context,\n x,\n y,\n doFill,\n doStroke,\n fVisible,\n sVisible,\n polygonAttribute,\n drawContext,\n fillCb,\n strokeCb\n );\n }\n\n draw(polygon: IPolygon, renderService: IRenderService, drawContext: IDrawContext, params?: IGraphicRenderDrawParams) {\n const polygonAttribute = getTheme(polygon, params?.theme).polygon;\n this._draw(polygon, polygonAttribute, false, drawContext, params);\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/render/contributions/render/polygon-render.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAcjE,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAE1E,OAAO,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AAEtE,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAE7E,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAGpC,IAAM,0BAA0B,GAAhC,MAAM,0BAA2B,SAAQ,UAAoB;IAIlE,YAGqB,0BAA6E;QAEhG,KAAK,EAAE,CAAC;QAFW,+BAA0B,GAA1B,0BAA0B,CAAmD;QALlG,eAAU,GAAW,mBAAmB,CAAC;QAQvC,IAAI,CAAC,IAAI,CAAC,0BAA0B,CAAC,CAAC;IACxC,CAAC;IAED,SAAS,CACP,OAAiB,EACjB,OAAmB,EACnB,CAAS,EACT,CAAS,EACT,WAAyB,EACzB,MAAiC,EACjC,MAIY,EACZ,QAIY;QAGZ,MAAM,gBAAgB,GAAG,QAAQ,CAAC,OAAO,EAAE,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,KAAK,CAAC,CAAC,OAAO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K,CAAC,OAAO,EAAE,gBAAgB,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,CAAC,CAAC;IACpE,CAAC;CACF,CAAA;AAnHY,0BAA0B;IADtC,UAAU,EAAE;IAMR,WAAA,MAAM,CAAC,oBAAoB,CAAC,CAAA;IAC5B,WAAA,KAAK,CAAC,yBAAyB,CAAC,CAAA;;GANxB,0BAA0B,CAmHtC;SAnHY,0BAA0B","file":"polygon-render.js","sourcesContent":["import { isArray } from '@visactor/vutils';\nimport { inject, injectable, named } from '../../../common/inversify-lite';\nimport { getTheme } from '../../../graphic/theme';\nimport { POLYGON_NUMBER_TYPE } from '../../../graphic/constants';\nimport type {\n IGraphicAttribute,\n IContext2d,\n IMarkAttribute,\n IPolygon,\n IThemeAttribute,\n IGraphicRender,\n IPolygonRenderContribution,\n IContributionProvider,\n IDrawContext,\n IGraphicRenderDrawParams,\n IRenderService\n} from '../../../interface';\nimport { drawPolygon, drawRoundedPolygon } from '../../../common/polygon';\nimport { drawPathProxy, fillVisible, runFill, runStroke, strokeVisible } from './utils';\nimport { PolygonRenderContribution } from './contributions/constants';\n// eslint-disable-next-line @typescript-eslint/consistent-type-imports\nimport { ContributionProvider } from '../../../common/contribution-provider';\nimport { BaseRenderContributionTime } from '../../../common/enums';\nimport { BaseRender } from './base-render';\n\n@injectable()\nexport class DefaultCanvasPolygonRender extends BaseRender<IPolygon> implements IGraphicRender {\n type: 'polygon';\n numberType: number = POLYGON_NUMBER_TYPE;\n\n constructor(\n @inject(ContributionProvider)\n @named(PolygonRenderContribution)\n protected readonly polygonRenderContribitions: IContributionProvider<IPolygonRenderContribution>\n ) {\n super();\n this.init(polygonRenderContribitions);\n }\n\n drawShape(\n polygon: IPolygon,\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 polygonAttribute = graphicService.themeService.getCurrentTheme().polygonAttribute;\n const polygonAttribute = getTheme(polygon, params?.theme).polygon;\n const {\n points = polygonAttribute.points,\n cornerRadius = polygonAttribute.cornerRadius,\n x: originX = polygonAttribute.x,\n y: originY = polygonAttribute.y,\n closePath = polygonAttribute.closePath\n } = polygon.attribute;\n\n const data = this.valid(polygon, polygonAttribute, fillCb, strokeCb);\n if (!data) {\n return;\n }\n const { fVisible, sVisible, doFill, doStroke } = data;\n\n context.beginPath();\n\n if ((cornerRadius as number) <= 0 || (isArray(cornerRadius) && (<number[]>cornerRadius).every(num => num === 0))) {\n drawPolygon(context.camera ? context : context.nativeContext, points, x, y);\n } else {\n // FIXME: type\n drawRoundedPolygon(context.camera ? context : context.nativeContext, points, x, y, cornerRadius, closePath);\n }\n // polygon 默认闭合\n closePath && context.closePath();\n\n // shadow\n context.setShadowBlendStyle && context.setShadowBlendStyle(polygon, polygon.attribute, polygonAttribute);\n\n this.beforeRenderStep(\n polygon,\n context,\n x,\n y,\n doFill,\n doStroke,\n fVisible,\n sVisible,\n polygonAttribute,\n drawContext,\n fillCb,\n strokeCb\n );\n\n if (doFill) {\n if (fillCb) {\n fillCb(context, polygon.attribute, polygonAttribute);\n } else if (fVisible) {\n // 存在fill\n context.setCommonStyle(polygon, polygon.attribute, originX - x, originY - y, polygonAttribute);\n context.fill();\n }\n }\n if (doStroke) {\n if (strokeCb) {\n strokeCb(context, polygon.attribute, polygonAttribute);\n } else if (sVisible) {\n // 存在stroke\n context.setStrokeStyle(polygon, polygon.attribute, originX - x, originY - y, polygonAttribute);\n context.stroke();\n }\n }\n\n this.afterRenderStep(\n polygon,\n context,\n x,\n y,\n doFill,\n doStroke,\n fVisible,\n sVisible,\n polygonAttribute,\n drawContext,\n fillCb,\n strokeCb\n );\n }\n\n draw(polygon: IPolygon, renderService: IRenderService, drawContext: IDrawContext, params?: IGraphicRenderDrawParams) {\n const polygonAttribute = getTheme(polygon, params?.theme).polygon;\n this._draw(polygon, polygonAttribute, false, drawContext, params);\n }\n}\n"]}
@@ -1,10 +1,9 @@
1
- import type { IGraphicAttribute, IContext2d, IMarkAttribute, IRect, IThemeAttribute, IGraphicRender, IDrawContext, IGraphicRenderDrawParams, IRenderService, IRectRenderContribution, IContributionProvider, IRectGraphicAttribute } from '../../../interface';
1
+ import type { IGraphicAttribute, IContext2d, IMarkAttribute, IRect, IThemeAttribute, IGraphicRender, IDrawContext, IGraphicRenderDrawParams, IRenderService, IRectRenderContribution, IContributionProvider } from '../../../interface';
2
2
  import { BaseRender } from './base-render';
3
3
  export declare class DefaultCanvasRectRender extends BaseRender<IRect> implements IGraphicRender {
4
4
  protected readonly rectRenderContribitions: IContributionProvider<IRectRenderContribution>;
5
5
  type: string;
6
6
  numberType: number;
7
- tempTheme: Required<IRectGraphicAttribute>;
8
7
  constructor(rectRenderContribitions: IContributionProvider<IRectRenderContribution>);
9
8
  drawShape(rect: IRect, context: IContext2d, x: number, y: number, drawContext: IDrawContext, params?: IGraphicRenderDrawParams, fillCb?: (ctx: IContext2d, markAttribute: Partial<IMarkAttribute & IGraphicAttribute>, themeAttribute: IThemeAttribute) => boolean, strokeCb?: (ctx: IContext2d, markAttribute: Partial<IMarkAttribute & IGraphicAttribute>, themeAttribute: IThemeAttribute) => boolean): void;
10
9
  draw(rect: IRect, renderService: IRenderService, drawContext: IDrawContext, params?: IGraphicRenderDrawParams): void;
@@ -28,20 +28,13 @@ import { rectFillVisible, rectStrokeVisible, runFill, runStroke } from "./utils"
28
28
 
29
29
  import { BaseRender } from "./base-render";
30
30
 
31
- import { defaultRectBackgroundRenderContribution, defaultRectRenderContribution, defaultRectTextureRenderContribution, splitRectAfterRenderContribution, splitRectBeforeRenderContribution } from "./contributions";
32
-
33
31
  let DefaultCanvasRectRender = class extends BaseRender {
34
32
  constructor(rectRenderContribitions) {
35
33
  super(), this.rectRenderContribitions = rectRenderContribitions, this.type = "rect",
36
- this.numberType = RECT_NUMBER_TYPE, this.builtinContributions = [ defaultRectRenderContribution, defaultRectBackgroundRenderContribution, defaultRectTextureRenderContribution, splitRectAfterRenderContribution, splitRectBeforeRenderContribution ],
37
- this.init(rectRenderContribitions);
34
+ this.numberType = RECT_NUMBER_TYPE, this.init(rectRenderContribitions);
38
35
  }
39
36
  drawShape(rect, context, x, y, drawContext, params, fillCb, strokeCb) {
40
- var _a;
41
- const rectAttribute = null !== (_a = this.tempTheme) && void 0 !== _a ? _a : getTheme(rect, null == params ? void 0 : params.theme).rect, {fill: fill = rectAttribute.fill, background: background, stroke: stroke = rectAttribute.stroke, cornerRadius: cornerRadius = rectAttribute.cornerRadius, opacity: opacity = rectAttribute.opacity, fillOpacity: fillOpacity = rectAttribute.fillOpacity, lineWidth: lineWidth = rectAttribute.lineWidth, strokeOpacity: strokeOpacity = rectAttribute.strokeOpacity, visible: visible = rectAttribute.visible, x1: x1, y1: y1, x: originX = rectAttribute.x, y: originY = rectAttribute.y} = rect.attribute;
42
- let {width: width, height: height} = rect.attribute;
43
- width = (null != width ? width : x1 - originX) || 0, height = (null != height ? height : y1 - originY) || 0;
44
- const fVisible = rectFillVisible(opacity, fillOpacity, width, height, fill), sVisible = rectStrokeVisible(opacity, strokeOpacity, width, height), doFill = runFill(fill, background), doStroke = runStroke(stroke, lineWidth);
37
+ const rectAttribute = getTheme(rect, null == params ? void 0 : params.theme).rect, {fill: fill = rectAttribute.fill, background: background, stroke: stroke = rectAttribute.stroke, width: width = rectAttribute.width, height: height = rectAttribute.height, cornerRadius: cornerRadius = rectAttribute.cornerRadius, opacity: opacity = rectAttribute.opacity, fillOpacity: fillOpacity = rectAttribute.fillOpacity, lineWidth: lineWidth = rectAttribute.lineWidth, strokeOpacity: strokeOpacity = rectAttribute.strokeOpacity, visible: visible = rectAttribute.visible, x: originX = rectAttribute.x, y: originY = rectAttribute.y} = rect.attribute, fVisible = rectFillVisible(opacity, fillOpacity, width, height, fill), sVisible = rectStrokeVisible(opacity, strokeOpacity, width, height), doFill = runFill(fill, background), doStroke = runStroke(stroke, lineWidth);
45
38
  if (!rect.valid || !visible) return;
46
39
  if (!doFill && !doStroke) return;
47
40
  if (!(fVisible || sVisible || fillCb || strokeCb || background)) return;
@@ -59,8 +52,7 @@ let DefaultCanvasRectRender = class extends BaseRender {
59
52
  }
60
53
  draw(rect, renderService, drawContext, params) {
61
54
  const rectAttribute = getTheme(rect, null == params ? void 0 : params.theme).rect;
62
- this.tempTheme = rectAttribute, this._draw(rect, rectAttribute, !1, drawContext, params),
63
- this.tempTheme = null;
55
+ this._draw(rect, rectAttribute, !1, drawContext, params);
64
56
  }
65
57
  };
66
58
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/render/contributions/render/rect-render.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAE5D,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAe7E,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AACnE,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACjF,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EACL,uCAAuC,EACvC,6BAA6B,EAC7B,oCAAoC,EACpC,gCAAgC,EAChC,iCAAiC,EAClC,MAAM,iBAAiB,CAAC;AAGlB,IAAM,uBAAuB,GAA7B,MAAM,uBAAwB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,aAAa,GAAG,QAAQ,CAAC,IAAI,EAAE,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,KAAK,CAAC,CAAC,IAAI,CAAC;QACzD,IAAI,CAAC,SAAS,GAAG,aAAa,CAAC;QAC/B,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,aAAa,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,CAAC,CAAC;QAC5D,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;IACxB,CAAC;CACF,CAAA;AA1JY,uBAAuB;IADnC,UAAU,EAAE;IAOR,WAAA,MAAM,CAAC,oBAAoB,CAAC,CAAA;IAC5B,WAAA,KAAK,CAAC,sBAAsB,CAAC,CAAA;;GAPrB,uBAAuB,CA0JnC;SA1JY,uBAAuB","file":"rect-render.js","sourcesContent":["import { isArray } from '@visactor/vutils';\nimport { inject, injectable, named } from '../../../common/inversify-lite';\nimport { getTheme } from '../../../graphic/theme';\nimport { RECT_NUMBER_TYPE } from '../../../graphic/constants';\nimport { createRectPath } from '../../../common/shape/rect';\n// eslint-disable-next-line @typescript-eslint/consistent-type-imports\nimport { ContributionProvider } from '../../../common/contribution-provider';\nimport type {\n IGraphicAttribute,\n IContext2d,\n IMarkAttribute,\n IRect,\n IThemeAttribute,\n IGraphicRender,\n IDrawContext,\n IGraphicRenderDrawParams,\n IRenderService,\n IRectRenderContribution,\n IContributionProvider,\n IRectGraphicAttribute\n} from '../../../interface';\nimport { RectRenderContribution } from './contributions/constants';\nimport { rectFillVisible, rectStrokeVisible, runFill, runStroke } from './utils';\nimport { BaseRender } from './base-render';\nimport {\n defaultRectBackgroundRenderContribution,\n defaultRectRenderContribution,\n defaultRectTextureRenderContribution,\n splitRectAfterRenderContribution,\n splitRectBeforeRenderContribution\n} from './contributions';\n\n@injectable()\nexport class DefaultCanvasRectRender extends BaseRender<IRect> implements IGraphicRender {\n type = 'rect';\n numberType: number = RECT_NUMBER_TYPE;\n tempTheme: Required<IRectGraphicAttribute>;\n\n constructor(\n @inject(ContributionProvider)\n @named(RectRenderContribution)\n protected readonly rectRenderContribitions: IContributionProvider<IRectRenderContribution>\n ) {\n super();\n this.builtinContributions = [\n defaultRectRenderContribution,\n defaultRectBackgroundRenderContribution,\n defaultRectTextureRenderContribution,\n splitRectAfterRenderContribution,\n splitRectBeforeRenderContribution\n ];\n this.init(rectRenderContribitions);\n }\n\n drawShape(\n rect: IRect,\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 rectAttribute = this.tempTheme ?? getTheme(rect, params?.theme).rect;\n const {\n fill = rectAttribute.fill,\n background,\n stroke = rectAttribute.stroke,\n cornerRadius = rectAttribute.cornerRadius,\n opacity = rectAttribute.opacity,\n fillOpacity = rectAttribute.fillOpacity,\n lineWidth = rectAttribute.lineWidth,\n strokeOpacity = rectAttribute.strokeOpacity,\n visible = rectAttribute.visible,\n x1,\n y1,\n x: originX = rectAttribute.x,\n y: originY = rectAttribute.y\n } = rect.attribute;\n let { width, height } = rect.attribute;\n width = (width ?? x1 - originX) || 0;\n height = (height ?? y1 - originY) || 0;\n\n // 不绘制或者透明\n const fVisible = rectFillVisible(opacity, fillOpacity, width, height, fill);\n const sVisible = rectStrokeVisible(opacity, strokeOpacity, width, height);\n const doFill = runFill(fill, background);\n const doStroke = runStroke(stroke, lineWidth);\n\n if (!(rect.valid && visible)) {\n return;\n }\n\n if (!(doFill || doStroke)) {\n return;\n }\n\n // 如果存在fillCb和strokeCb,那就不直接跳过\n if (!(fVisible || sVisible || fillCb || strokeCb || background)) {\n return;\n }\n\n if (cornerRadius === 0 || (isArray(cornerRadius) && (<number[]>cornerRadius).every(num => num === 0))) {\n // 不需要处理圆角\n context.beginPath();\n context.rect(x, y, width, height);\n } else {\n context.beginPath();\n\n // 测试后,cache对于重绘性能提升不大,但是在首屏有一定性能损耗,因此rect不再使用cache\n createRectPath(context, x, y, width, height, cornerRadius);\n }\n\n const doFillOrStroke = {\n doFill,\n doStroke\n };\n\n // shadow\n context.setShadowBlendStyle && context.setShadowBlendStyle(rect, rect.attribute, rectAttribute);\n\n this.beforeRenderStep(\n rect,\n context,\n x,\n y,\n doFill,\n doStroke,\n fVisible,\n sVisible,\n rectAttribute,\n drawContext,\n fillCb,\n strokeCb,\n doFillOrStroke\n );\n\n if (doFillOrStroke.doFill) {\n if (fillCb) {\n fillCb(context, rect.attribute, rectAttribute);\n } else if (fVisible) {\n // 存在fill\n context.setCommonStyle(rect, rect.attribute, originX - x, originY - y, rectAttribute);\n context.fill();\n }\n }\n if (doFillOrStroke.doStroke) {\n if (strokeCb) {\n strokeCb(context, rect.attribute, rectAttribute);\n } else if (sVisible) {\n // 存在stroke\n context.setStrokeStyle(rect, rect.attribute, originX - x, originY - y, rectAttribute);\n context.stroke();\n }\n }\n\n this.afterRenderStep(\n rect,\n context,\n x,\n y,\n doFill,\n doStroke,\n fVisible,\n sVisible,\n rectAttribute,\n drawContext,\n fillCb,\n strokeCb\n );\n }\n\n draw(rect: IRect, renderService: IRenderService, drawContext: IDrawContext, params?: IGraphicRenderDrawParams) {\n const rectAttribute = getTheme(rect, params?.theme).rect;\n this.tempTheme = rectAttribute;\n this._draw(rect, rectAttribute, false, drawContext, params);\n this.tempTheme = null;\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/render/contributions/render/rect-render.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OA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G,MAAM,aAAa,GAAG,QAAQ,CAAC,IAAI,EAAE,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,KAAK,CAAC,CAAC,IAAI,CAAC;QACzD,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,aAAa,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,CAAC,CAAC;IAC9D,CAAC;CACF,CAAA;AA9IY,uBAAuB;IADnC,UAAU,EAAE;IAMR,WAAA,MAAM,CAAC,oBAAoB,CAAC,CAAA;IAC5B,WAAA,KAAK,CAAC,sBAAsB,CAAC,CAAA;;GANrB,uBAAuB,CA8InC;SA9IY,uBAAuB","file":"rect-render.js","sourcesContent":["import { isArray } from '@visactor/vutils';\nimport { inject, injectable, named } from '../../../common/inversify-lite';\nimport { getTheme } from '../../../graphic/theme';\nimport { RECT_NUMBER_TYPE } from '../../../graphic/constants';\nimport { createRectPath } from '../../../common/shape/rect';\n// eslint-disable-next-line @typescript-eslint/consistent-type-imports\nimport { ContributionProvider } from '../../../common/contribution-provider';\nimport type {\n IGraphicAttribute,\n IContext2d,\n IMarkAttribute,\n IRect,\n IThemeAttribute,\n IGraphicRender,\n IDrawContext,\n IGraphicRenderDrawParams,\n IRenderService,\n IRectRenderContribution,\n IContributionProvider\n} from '../../../interface';\nimport { RectRenderContribution } from './contributions/constants';\nimport { rectFillVisible, rectStrokeVisible, runFill, runStroke } from './utils';\nimport { BaseRender } from './base-render';\n\n@injectable()\nexport class DefaultCanvasRectRender extends BaseRender<IRect> implements IGraphicRender {\n type = 'rect';\n numberType: number = RECT_NUMBER_TYPE;\n\n constructor(\n @inject(ContributionProvider)\n @named(RectRenderContribution)\n protected readonly rectRenderContribitions: IContributionProvider<IRectRenderContribution>\n ) {\n super();\n this.init(rectRenderContribitions);\n }\n\n drawShape(\n rect: IRect,\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 rectAttribute = graphicService.themeService.getCurrentTheme().rectAttribute;\n const rectAttribute = getTheme(rect, params?.theme).rect;\n const {\n fill = rectAttribute.fill,\n background,\n stroke = rectAttribute.stroke,\n width = rectAttribute.width,\n height = rectAttribute.height,\n cornerRadius = rectAttribute.cornerRadius,\n opacity = rectAttribute.opacity,\n fillOpacity = rectAttribute.fillOpacity,\n lineWidth = rectAttribute.lineWidth,\n strokeOpacity = rectAttribute.strokeOpacity,\n visible = rectAttribute.visible,\n x: originX = rectAttribute.x,\n y: originY = rectAttribute.y\n } = rect.attribute;\n\n // 不绘制或者透明\n const fVisible = rectFillVisible(opacity, fillOpacity, width, height, fill);\n const sVisible = rectStrokeVisible(opacity, strokeOpacity, width, height);\n const doFill = runFill(fill, background);\n const doStroke = runStroke(stroke, lineWidth);\n\n if (!(rect.valid && visible)) {\n return;\n }\n\n if (!(doFill || doStroke)) {\n return;\n }\n\n // 如果存在fillCb和strokeCb,那就不直接跳过\n if (!(fVisible || sVisible || fillCb || strokeCb || background)) {\n return;\n }\n\n if (cornerRadius === 0 || (isArray(cornerRadius) && (<number[]>cornerRadius).every(num => num === 0))) {\n // 不需要处理圆角\n context.beginPath();\n context.rect(x, y, width, height);\n } else {\n context.beginPath();\n\n // 测试后,cache对于重绘性能提升不大,但是在首屏有一定性能损耗,因此rect不再使用cache\n createRectPath(context, x, y, width, height, cornerRadius);\n }\n\n const doFillOrStroke = {\n doFill,\n doStroke\n };\n\n // shadow\n context.setShadowBlendStyle && context.setShadowBlendStyle(rect, rect.attribute, rectAttribute);\n\n this.beforeRenderStep(\n rect,\n context,\n x,\n y,\n doFill,\n doStroke,\n fVisible,\n sVisible,\n rectAttribute,\n drawContext,\n fillCb,\n strokeCb,\n doFillOrStroke\n );\n\n if (doFillOrStroke.doFill) {\n if (fillCb) {\n fillCb(context, rect.attribute, rectAttribute);\n } else if (fVisible) {\n // 存在fill\n context.setCommonStyle(rect, rect.attribute, originX - x, originY - y, rectAttribute);\n context.fill();\n }\n }\n if (doFillOrStroke.doStroke) {\n if (strokeCb) {\n strokeCb(context, rect.attribute, rectAttribute);\n } else if (sVisible) {\n // 存在stroke\n context.setStrokeStyle(rect, rect.attribute, originX - x, originY - y, rectAttribute);\n context.stroke();\n }\n }\n\n this.afterRenderStep(\n rect,\n context,\n x,\n y,\n doFill,\n doStroke,\n fVisible,\n sVisible,\n rectAttribute,\n drawContext,\n fillCb,\n strokeCb\n );\n }\n\n draw(rect: IRect, renderService: IRenderService, drawContext: IDrawContext, params?: IGraphicRenderDrawParams) {\n const rectAttribute = getTheme(rect, params?.theme).rect;\n this._draw(rect, rectAttribute, false, drawContext, params);\n }\n}\n"]}
@@ -1 +1,4 @@
1
-
1
+ import type { IGraphic, IGraphicRender, IRenderSelector } from '../../../interface';
2
+ export declare abstract class DefaultRenderSelector implements IRenderSelector {
3
+ selector(graphic: IGraphic): IGraphicRender | null;
4
+ }
@@ -1,3 +1,18 @@
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
+ };
1
6
 
7
+ import { injectable } from "../../../common/inversify-lite";
2
8
 
9
+ let DefaultRenderSelector = class {
10
+ selector(graphic) {
11
+ return null;
12
+ }
13
+ };
14
+
15
+ DefaultRenderSelector = __decorate([ injectable() ], DefaultRenderSelector);
16
+
17
+ export { DefaultRenderSelector };
3
18
  //# sourceMappingURL=render-slector.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/render/contributions/render/render-slector.ts"],"names":[],"mappings":"","file":"render-slector.js","sourcesContent":["// import { injectable } from '../../../common/inversify-lite';\n// import type { IGraphic, IGraphicRender, IRenderSelector } from '../../../interface';\n\n// @injectable()\n// export class DefaultRenderSelector implements IRenderSelector {\n// selector(graphic: IGraphic): IGraphicRender | null {\n// return null;\n// }\n// }\n"]}
1
+ {"version":3,"sources":["../src/render/contributions/render/render-slector.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAIrD,IAAe,qBAAqB,GAApC,MAAe,qBAAqB;IACzC,QAAQ,CAAC,OAAiB;QACxB,OAAO,IAAI,CAAC;IACd,CAAC;CACF,CAAA;AAJqB,qBAAqB;IAD1C,UAAU,EAAE;GACS,qBAAqB,CAI1C;SAJqB,qBAAqB","file":"render-slector.js","sourcesContent":["import { injectable } from '../../../common/inversify-lite';\nimport type { IGraphic, IGraphicRender, IRenderSelector } from '../../../interface';\n\n@injectable()\nexport abstract class DefaultRenderSelector implements IRenderSelector {\n selector(graphic: IGraphic): IGraphicRender | null {\n return null;\n }\n}\n"]}
@@ -3,7 +3,6 @@ import { BaseRender } from './base-render';
3
3
  export declare class DefaultCanvasRichTextRender extends BaseRender<IRichText> implements IGraphicRender {
4
4
  type: 'richtext';
5
5
  numberType: number;
6
- constructor();
7
6
  drawShape(richtext: IRichText, context: IContext2d, x: number, y: number, drawContext: IDrawContext): void;
8
7
  drawIcon(icon: IRichTextIcon, context: IContext2d, x: number, y: number, baseline: number): void;
9
8
  draw(richtext: IRichText, renderService: IRenderService, drawContext: IDrawContext): void;
@@ -2,8 +2,6 @@ var __decorate = this && this.__decorate || function(decorators, target, key, de
2
2
  var d, c = arguments.length, r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc;
3
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
4
  return c > 3 && r && Object.defineProperty(target, key, r), r;
5
- }, __metadata = this && this.__metadata || function(k, v) {
6
- if ("object" == typeof Reflect && "function" == typeof Reflect.metadata) return Reflect.metadata(k, v);
7
5
  };
8
6
 
9
7
  import { injectable } from "../../../common/inversify-lite";
@@ -18,20 +16,16 @@ import { fillVisible } from "./utils";
18
16
 
19
17
  import { BaseRender } from "./base-render";
20
18
 
21
- import { defaultTextBackgroundRenderContribution } from "./contributions/text-contribution-render";
22
-
23
19
  let DefaultCanvasRichTextRender = class extends BaseRender {
24
20
  constructor() {
25
- super(), this.numberType = RICHTEXT_NUMBER_TYPE, this.builtinContributions = [ defaultTextBackgroundRenderContribution ],
26
- this.init();
21
+ super(...arguments), this.numberType = RICHTEXT_NUMBER_TYPE;
27
22
  }
28
23
  drawShape(richtext, context, x, y, drawContext) {
29
- const richtextAttribute = getTheme(richtext).richtext, {strokeOpacity: strokeOpacity = richtextAttribute.strokeOpacity, opacity: opacity = richtextAttribute.opacity, fillOpacity: fillOpacity = richtextAttribute.fillOpacity, visible: visible = richtextAttribute.visible} = richtext.attribute;
24
+ const richtextAttribute = getTheme(richtext).richtext, {width: width = richtextAttribute.width, height: height = richtextAttribute.height, opacity: opacity = richtextAttribute.opacity, fillOpacity: fillOpacity = richtextAttribute.fillOpacity, visible: visible = richtextAttribute.visible} = richtext.attribute;
30
25
  if (!richtext.valid || !visible) return;
31
- const fVisible = fillVisible(opacity, fillOpacity, !0), sVisible = fillVisible(opacity, strokeOpacity, !0);
32
- if (!fVisible) return;
33
- context.translate(x, y), this.beforeRenderStep(richtext, context, x, y, fVisible, sVisible, fVisible, sVisible, richtextAttribute, drawContext);
34
- richtext.getFrameCache().draw(context, this.drawIcon), this.afterRenderStep(richtext, context, x, y, fVisible, sVisible, fVisible, sVisible, richtextAttribute, drawContext);
26
+ if (!fillVisible(opacity, fillOpacity, !0)) return;
27
+ context.translate(x, y);
28
+ richtext.getFrameCache().draw(context, this.drawIcon);
35
29
  }
36
30
  drawIcon(icon, context, x, y, baseline) {
37
31
  var _a;
@@ -53,7 +47,7 @@ let DefaultCanvasRichTextRender = class extends BaseRender {
53
47
  }
54
48
  };
55
49
 
56
- DefaultCanvasRichTextRender = __decorate([ injectable(), __metadata("design:paramtypes", []) ], DefaultCanvasRichTextRender);
50
+ DefaultCanvasRichTextRender = __decorate([ injectable() ], DefaultCanvasRichTextRender);
57
51
 
58
52
  export { DefaultCanvasRichTextRender };
59
53
  //# sourceMappingURL=richtext-render.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/render/contributions/render/richtext-render.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AASlE,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,uCAAuC,EAAE,MAAM,0CAA0C,CAAC;AAG5F,IAAM,2BAA2B,GAAjC,MAAM,2BAA4B,SAAQ,UAAqB;IAIpE;QACE,KAAK,EAAE,CAAC;QAHV,eAAU,GAAW,oBAAoB,CAAC;QAIxC,IAAI,CAAC,oBAAoB,GAAG,CAAC,uCAA8C,CAAC,CAAC;QAC7E,IAAI,CAAC,IAAI,EAAE,CAAC;IACd,CAAC;IAED,SAAS,CAAC,QAAmB,EAAE,OAAmB,EAAE,CAAS,EAAE,CAAS,EAAE,WAAyB;QACjG,MAAM,iBAAiB,GAAG,QAAQ,CAAC,QAAQ,C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,CAAC;gBAC5C,OAAO,CAAC,SAAS,GAAG,cAAwB,CAAC;gBAC7C,OAAO,CAAC,IAAI,EAAE,CAAC;aAChB;YACD,IAAI,gBAAgB,EAAE;gBAEpB,OAAO,CAAC,WAAW,GAAG,uBAAuB,CAAC;gBAC9C,OAAO,CAAC,WAAW,GAAG,gBAA0B,CAAC;gBACjD,OAAO,CAAC,MAAM,EAAE,CAAC;aAClB;SACF;QAGD,MAAM,GAAG,GAAG,GAAG,KAAI,MAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,SAAS,0CAAE,GAAG,CAAC,GAAG,CAAC,CAAA,CAAC;QAC7C,IAAI,CAAC,GAAG,IAAI,GAAG,CAAC,KAAK,KAAK,SAAS,EAAE;YACnC,OAAO;SACR;QAED,OAAO,CAAC,WAAW,GAAG,OAAO,CAAC;QAC9B,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;IACnD,CAAC;IAED,IAAI,CAAC,QAAmB,EAAE,aAA6B,EAAE,WAAyB;QAChF,MAAM,iBAAiB,GAAG,QAAQ,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC;QACtD,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,iBAAiB,EAAE,KAAK,EAAE,WAAW,CAAC,CAAC;IAC9D,CAAC;CACF,CAAA;AA/HY,2BAA2B;IADvC,UAAU,EAAE;;GACA,2BAA2B,CA+HvC;SA/HY,2BAA2B","file":"richtext-render.js","sourcesContent":["import { injectable } from '../../../common/inversify-lite';\nimport { createRectPath } from '../../../common/shape/rect';\nimport { getTheme } from '../../../graphic/theme';\nimport { RICHTEXT_NUMBER_TYPE } from '../../../graphic/constants';\nimport type {\n IContext2d,\n IRichText,\n IRichTextIcon,\n IDrawContext,\n IRenderService,\n IGraphicRender\n} from '../../../interface';\nimport { fillVisible } from './utils';\nimport { BaseRender } from './base-render';\nimport { defaultTextBackgroundRenderContribution } from './contributions/text-contribution-render';\n\n@injectable()\nexport class DefaultCanvasRichTextRender extends BaseRender<IRichText> implements IGraphicRender {\n type: 'richtext';\n numberType: number = RICHTEXT_NUMBER_TYPE;\n\n constructor() {\n super();\n this.builtinContributions = [defaultTextBackgroundRenderContribution as any];\n this.init();\n }\n\n drawShape(richtext: IRichText, context: IContext2d, x: number, y: number, drawContext: IDrawContext) {\n const richtextAttribute = getTheme(richtext).richtext;\n const {\n strokeOpacity = richtextAttribute.strokeOpacity,\n opacity = richtextAttribute.opacity,\n fillOpacity = richtextAttribute.fillOpacity,\n visible = richtextAttribute.visible\n } = richtext.attribute;\n\n if (!(richtext.valid && visible)) {\n return;\n }\n\n const fVisible = fillVisible(opacity, fillOpacity, true);\n const sVisible = fillVisible(opacity, strokeOpacity, true);\n if (!fVisible) {\n return;\n }\n\n context.translate(x, y);\n this.beforeRenderStep(\n richtext,\n context,\n x,\n y,\n fVisible,\n sVisible,\n fVisible,\n sVisible,\n richtextAttribute,\n drawContext\n );\n const frame = richtext.getFrameCache();\n frame.draw(context, this.drawIcon);\n\n this.afterRenderStep(\n richtext,\n context,\n x,\n y,\n fVisible,\n sVisible,\n fVisible,\n sVisible,\n richtextAttribute,\n drawContext\n );\n }\n\n drawIcon(icon: IRichTextIcon, context: IContext2d, x: number, y: number, baseline: number) {\n const richtextIconAttribute = getTheme(icon).richtextIcon;\n\n const {\n width = richtextIconAttribute.width,\n height = richtextIconAttribute.height,\n opacity = richtextIconAttribute.opacity,\n image: url,\n backgroundFill = richtextIconAttribute.backgroundFill,\n // backgroundFillColor = richtextIconAttribute.backgroundFillColor,\n backgroundFillOpacity = richtextIconAttribute.backgroundFillOpacity,\n backgroundStroke = richtextIconAttribute.backgroundStroke,\n // backgroundStrokeColor = richtextIconAttribute.backgroundStrokeColor,\n backgroundStrokeOpacity = richtextIconAttribute.backgroundStrokeOpacity,\n backgroundRadius = richtextIconAttribute.backgroundRadius,\n margin\n } = icon.attribute;\n\n const { backgroundWidth = width, backgroundHeight = height } = icon.attribute;\n\n if (margin) {\n x += icon._marginArray[3];\n y += icon._marginArray[0];\n }\n\n // y -= height / 2 - baseline;\n\n // 绘制background\n if (icon._hovered) {\n const expandX = (backgroundWidth - width) / 2;\n const expandY = (backgroundHeight - height) / 2;\n\n if (backgroundRadius === 0) {\n // 不需要处理圆角\n context.beginPath();\n context.rect(x - expandX, y - expandY, backgroundWidth, backgroundHeight);\n } else {\n context.beginPath();\n createRectPath(context, x - expandX, y - expandY, backgroundWidth, backgroundHeight, backgroundRadius);\n }\n if (backgroundFill) {\n // context.setCommonStyle(rect, rect.attribute, x, y, rectAttribute);\n context.globalAlpha = backgroundFillOpacity;\n context.fillStyle = backgroundFill as string;\n context.fill();\n }\n if (backgroundStroke) {\n // context.setStrokeStyle(rect, rect.attribute, x, y, rectAttribute);\n context.globalAlpha = backgroundStrokeOpacity;\n context.strokeStyle = backgroundStroke as string;\n context.stroke();\n }\n }\n\n // 绘制图标\n const res = url && icon?.resources?.get(url);\n if (!res || res.state !== 'success') {\n return;\n }\n // context.setCommonStyle(icon, icon.attribute, x, y, iconAttribute);\n context.globalAlpha = opacity;\n context.drawImage(res.data, x, y, width, height);\n }\n\n draw(richtext: IRichText, renderService: IRenderService, drawContext: IDrawContext) {\n const richtextAttribute = getTheme(richtext).richtext;\n this._draw(richtext, richtextAttribute, false, drawContext);\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/render/contributions/render/richtext-render.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AASlE,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAA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B,EAAE;gBAEpB,OAAO,CAAC,WAAW,GAAG,uBAAuB,CAAC;gBAC9C,OAAO,CAAC,WAAW,GAAG,gBAA0B,CAAC;gBACjD,OAAO,CAAC,MAAM,EAAE,CAAC;aAClB;SACF;QAGD,MAAM,GAAG,GAAG,GAAG,KAAI,MAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,SAAS,0CAAE,GAAG,CAAC,GAAG,CAAC,CAAA,CAAC;QAC7C,IAAI,CAAC,GAAG,IAAI,GAAG,CAAC,KAAK,KAAK,SAAS,EAAE;YACnC,OAAO;SACR;QAED,OAAO,CAAC,WAAW,GAAG,OAAO,CAAC;QAC9B,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;IACnD,CAAC;IAED,IAAI,CAAC,QAAmB,EAAE,aAA6B,EAAE,WAAyB;QAChF,MAAM,iBAAiB,GAAG,QAAQ,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC;QACtD,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,iBAAiB,EAAE,KAAK,EAAE,WAAW,CAAC,CAAC;IAC9D,CAAC;CACF,CAAA;AAhGY,2BAA2B;IADvC,UAAU,EAAE;GACA,2BAA2B,CAgGvC;SAhGY,2BAA2B","file":"richtext-render.js","sourcesContent":["import { injectable } from '../../../common/inversify-lite';\nimport { createRectPath } from '../../../common/shape/rect';\nimport { getTheme } from '../../../graphic/theme';\nimport { RICHTEXT_NUMBER_TYPE } from '../../../graphic/constants';\nimport type {\n IContext2d,\n IRichText,\n IRichTextIcon,\n IDrawContext,\n IRenderService,\n IGraphicRender\n} from '../../../interface';\nimport { fillVisible } from './utils';\nimport { BaseRender } from './base-render';\n\n@injectable()\nexport class DefaultCanvasRichTextRender extends BaseRender<IRichText> implements IGraphicRender {\n type: 'richtext';\n numberType: number = RICHTEXT_NUMBER_TYPE;\n\n drawShape(richtext: IRichText, context: IContext2d, x: number, y: number, drawContext: IDrawContext) {\n const richtextAttribute = getTheme(richtext).richtext;\n const {\n width = richtextAttribute.width,\n height = richtextAttribute.height,\n opacity = richtextAttribute.opacity,\n fillOpacity = richtextAttribute.fillOpacity,\n visible = richtextAttribute.visible\n } = richtext.attribute;\n\n if (!(richtext.valid && visible)) {\n return;\n }\n\n const fVisible = fillVisible(opacity, fillOpacity, true);\n if (!fVisible) {\n return;\n }\n\n context.translate(x, y);\n const frame = richtext.getFrameCache();\n frame.draw(context, this.drawIcon);\n }\n\n drawIcon(icon: IRichTextIcon, context: IContext2d, x: number, y: number, baseline: number) {\n const richtextIconAttribute = getTheme(icon).richtextIcon;\n\n const {\n width = richtextIconAttribute.width,\n height = richtextIconAttribute.height,\n opacity = richtextIconAttribute.opacity,\n image: url,\n backgroundFill = richtextIconAttribute.backgroundFill,\n // backgroundFillColor = richtextIconAttribute.backgroundFillColor,\n backgroundFillOpacity = richtextIconAttribute.backgroundFillOpacity,\n backgroundStroke = richtextIconAttribute.backgroundStroke,\n // backgroundStrokeColor = richtextIconAttribute.backgroundStrokeColor,\n backgroundStrokeOpacity = richtextIconAttribute.backgroundStrokeOpacity,\n backgroundRadius = richtextIconAttribute.backgroundRadius,\n margin\n } = icon.attribute;\n\n const { backgroundWidth = width, backgroundHeight = height } = icon.attribute;\n\n if (margin) {\n x += icon._marginArray[3];\n y += icon._marginArray[0];\n }\n\n // y -= height / 2 - baseline;\n\n // 绘制background\n if (icon._hovered) {\n const expandX = (backgroundWidth - width) / 2;\n const expandY = (backgroundHeight - height) / 2;\n\n if (backgroundRadius === 0) {\n // 不需要处理圆角\n context.beginPath();\n context.rect(x - expandX, y - expandY, backgroundWidth, backgroundHeight);\n } else {\n context.beginPath();\n createRectPath(context, x - expandX, y - expandY, backgroundWidth, backgroundHeight, backgroundRadius);\n }\n if (backgroundFill) {\n // context.setCommonStyle(rect, rect.attribute, x, y, rectAttribute);\n context.globalAlpha = backgroundFillOpacity;\n context.fillStyle = backgroundFill as string;\n context.fill();\n }\n if (backgroundStroke) {\n // context.setStrokeStyle(rect, rect.attribute, x, y, rectAttribute);\n context.globalAlpha = backgroundStrokeOpacity;\n context.strokeStyle = backgroundStroke as string;\n context.stroke();\n }\n }\n\n // 绘制图标\n const res = url && icon?.resources?.get(url);\n if (!res || res.state !== 'success') {\n return;\n }\n // context.setCommonStyle(icon, icon.attribute, x, y, iconAttribute);\n context.globalAlpha = opacity;\n context.drawImage(res.data, x, y, width, height);\n }\n\n draw(richtext: IRichText, renderService: IRenderService, drawContext: IDrawContext) {\n const richtextAttribute = getTheme(richtext).richtext;\n this._draw(richtext, richtextAttribute, false, drawContext);\n }\n}\n"]}
@@ -22,12 +22,9 @@ import { BaseRender } from "./base-render";
22
22
 
23
23
  import { SymbolRenderContribution } from "./contributions/constants";
24
24
 
25
- import { defaultSymbolBackgroundRenderContribution, defaultSymbolRenderContribution, defaultSymbolTextureRenderContribution } from "./contributions";
26
-
27
25
  let DefaultCanvasSymbolRender = class extends BaseRender {
28
26
  constructor(symbolRenderContribitions) {
29
27
  super(), this.symbolRenderContribitions = symbolRenderContribitions, this.numberType = SYMBOL_NUMBER_TYPE,
30
- this.builtinContributions = [ defaultSymbolRenderContribution, defaultSymbolBackgroundRenderContribution, defaultSymbolTextureRenderContribution ],
31
28
  this.init(symbolRenderContribitions);
32
29
  }
33
30
  drawShape(symbol, context, x, y, drawContext, params, fillCb, strokeCb) {
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/render/contributions/render/symbol-render.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,gCAAgC,CAAC;AAE3E,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAC7E,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAehE,OAAO,EAAE,UAAU,EAAE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M,EAAE,eAAe,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,CAAC,CAAC;IAClE,CAAC;CACF,CAAA;AA3MY,yBAAyB;IADrC,UAAU,EAAE;IAMR,WAAA,MAAM,CAAC,oBAAoB,CAAC,CAAA;IAC5B,WAAA,KAAK,CAAC,wBAAwB,CAAC,CAAA;;GANvB,yBAAyB,CA2MrC;SA3MY,yBAAyB","file":"symbol-render.js","sourcesContent":["import { mat4Allocate } from '../../../allocator/matrix-allocate';\nimport { inject, injectable, named } from '../../../common/inversify-lite';\n// eslint-disable-next-line\nimport { ContributionProvider } from '../../../common/contribution-provider';\nimport { getTheme } from '../../../graphic/theme';\nimport { SYMBOL_NUMBER_TYPE } from '../../../graphic/constants';\nimport type {\n IGraphicAttribute,\n IContext2d,\n IMarkAttribute,\n ISymbol,\n IThemeAttribute,\n ISymbolRenderContribution,\n IDrawContext,\n IRenderService,\n IGraphicRender,\n IGraphicRenderDrawParams,\n IContributionProvider\n} from '../../../interface';\nimport type {} from '../../render-service';\nimport { BaseRender } from './base-render';\nimport { BaseRenderContributionTime } from '../../../common/enums';\nimport { SymbolRenderContribution } from './contributions/constants';\nimport { drawPathProxy, fillVisible, runFill, runStroke, strokeVisible } from './utils';\nimport {\n defaultSymbolBackgroundRenderContribution,\n defaultSymbolRenderContribution,\n defaultSymbolTextureRenderContribution\n} from './contributions';\n\n@injectable()\nexport class DefaultCanvasSymbolRender extends BaseRender<ISymbol> implements IGraphicRender {\n type: 'symbol';\n numberType: number = SYMBOL_NUMBER_TYPE;\n\n constructor(\n @inject(ContributionProvider)\n @named(SymbolRenderContribution)\n protected readonly symbolRenderContribitions: IContributionProvider<ISymbolRenderContribution>\n ) {\n super();\n this.builtinContributions = [\n defaultSymbolRenderContribution,\n defaultSymbolBackgroundRenderContribution,\n defaultSymbolTextureRenderContribution\n ];\n this.init(symbolRenderContribitions);\n }\n\n drawShape(\n symbol: ISymbol,\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 symbolAttribute = graphicService.themeService.getCurrentTheme().symbolAttribute;\n const symbolAttribute = getTheme(symbol, params?.theme).symbol;\n\n const {\n size = symbolAttribute.size,\n x: originX = symbolAttribute.x,\n y: originY = symbolAttribute.y,\n scaleX = symbolAttribute.scaleX,\n scaleY = symbolAttribute.scaleY\n } = symbol.attribute;\n\n const data = this.valid(symbol, symbolAttribute, fillCb, strokeCb);\n if (!data) {\n return;\n }\n const { fVisible, sVisible, doFill, doStroke } = data;\n\n const parsedPath = symbol.getParsedPath();\n // todo: 考虑使用path\n if (!parsedPath) {\n return;\n }\n\n const { keepDirIn3d = symbolAttribute.keepDirIn3d } = symbol.attribute;\n const z = this.z ?? 0;\n context.beginPath();\n if (keepDirIn3d && context.camera && context.project) {\n const p = context.project(x, y, z);\n const camera = context.camera;\n context.camera = null;\n if (\n parsedPath.draw(context, size, p.x, p.y, undefined, (p, a) => {\n // 如果是svg的话,合并一下fill和stroke\n if (symbol._parsedPath.svgCache) {\n const obj = Object.assign({}, a);\n obj.fill = a.fill ?? symbol.attribute.fill;\n obj.opacity = a.fill ?? symbol.attribute.opacity;\n obj.fillOpacity = symbol.attribute.fillOpacity;\n obj.stroke = a.stroke ?? symbol.attribute.stroke;\n a = obj;\n }\n if (a.fill) {\n if (fillCb) {\n fillCb(context, symbol.attribute, symbolAttribute);\n } else {\n context.setCommonStyle(symbol, a, originX - x, originY - y, symbolAttribute);\n context.fill();\n }\n }\n if (a.stroke) {\n if (strokeCb) {\n strokeCb(context, symbol.attribute, symbolAttribute);\n } else {\n context.setStrokeStyle(symbol, a, (originX - x) / scaleX, (originY - y) / scaleY, symbolAttribute);\n context.stroke();\n }\n }\n }) === false\n ) {\n context.closePath();\n }\n context.camera = camera;\n } else {\n if (\n parsedPath.draw(context, size, x, y, z, (p, a) => {\n // 如果是svg的话,合并一下fill和stroke\n if (symbol._parsedPath.svgCache) {\n const obj = Object.assign({}, a);\n obj.fill = a.fill ?? symbol.attribute.fill;\n obj.opacity = a.opacity ?? symbol.attribute.opacity;\n obj.fillOpacity = symbol.attribute.fillOpacity;\n obj.stroke = a.stroke ?? symbol.attribute.stroke;\n a = obj;\n }\n if (a.fill) {\n if (fillCb) {\n fillCb(context, symbol.attribute, symbolAttribute);\n } else {\n context.setCommonStyle(symbol, a, originX - x, originY - y, symbolAttribute);\n context.fill();\n }\n }\n if (a.stroke) {\n if (strokeCb) {\n strokeCb(context, symbol.attribute, symbolAttribute);\n } else {\n context.setStrokeStyle(symbol, a, (originX - x) / scaleX, (originY - y) / scaleY, symbolAttribute);\n context.stroke();\n }\n }\n }) === false\n ) {\n context.closePath();\n }\n }\n\n // shadow\n context.setShadowBlendStyle && context.setShadowBlendStyle(symbol, symbol.attribute, symbolAttribute);\n\n this.beforeRenderStep(\n symbol,\n context,\n x,\n y,\n doFill,\n doStroke,\n fVisible,\n sVisible,\n symbolAttribute,\n drawContext,\n fillCb,\n strokeCb\n );\n\n // if (fill !== false) {\n // context.setCommonStyle(symbol.attribute, symbolAttribute);\n // context.fill();\n // }\n // if (stroke !== false) {\n // context.setStrokeStyle(symbol.attribute, symbolAttribute);\n // context.stroke();\n // }\n\n // svg就不用fill和stroke了\n if (doFill && !parsedPath.isSvg) {\n if (fillCb) {\n fillCb(context, symbol.attribute, symbolAttribute);\n } else if (fVisible) {\n context.setCommonStyle(symbol, symbol.attribute, originX - x, originY - y, symbolAttribute);\n context.fill();\n }\n }\n if (doStroke && !parsedPath.isSvg) {\n if (strokeCb) {\n strokeCb(context, symbol.attribute, symbolAttribute);\n } else if (sVisible) {\n context.setStrokeStyle(\n symbol,\n symbol.attribute,\n (originX - x) / scaleX,\n (originY - y) / scaleY,\n symbolAttribute\n );\n context.stroke();\n }\n }\n\n this.afterRenderStep(\n symbol,\n context,\n x,\n y,\n doFill,\n doStroke,\n fVisible,\n sVisible,\n symbolAttribute,\n drawContext,\n fillCb,\n strokeCb\n );\n }\n\n draw(symbol: ISymbol, renderService: IRenderService, drawContext: IDrawContext, params?: IGraphicRenderDrawParams) {\n const symbolAttribute = getTheme(symbol, params?.theme).symbol;\n this._draw(symbol, symbolAttribute, false, drawContext, params);\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/render/contributions/render/symbol-render.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,gCAAgC,CAAC;AAE3E,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAC7E,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAehE,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AAI9D,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,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;QAE/D,MAAM,EACJ,IAAI,GAAG,eAAe,CAAC,IAAI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,MAAM,EACtB,eAAe,CAChB,CAAC;gBACF,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;AAtMY,yBAAyB;IADrC,UAAU,EAAE;IAMR,WAAA,MAAM,CAAC,oBAAoB,CAAC,CAAA;IAC5B,WAAA,KAAK,CAAC,wBAAwB,CAAC,CAAA;;GANvB,yBAAyB,CAsMrC;SAtMY,yBAAyB","file":"symbol-render.js","sourcesContent":["import { mat4Allocate } from '../../../allocator/matrix-allocate';\nimport { inject, injectable, named } from '../../../common/inversify-lite';\n// eslint-disable-next-line\nimport { ContributionProvider } from '../../../common/contribution-provider';\nimport { getTheme } from '../../../graphic/theme';\nimport { SYMBOL_NUMBER_TYPE } from '../../../graphic/constants';\nimport type {\n IGraphicAttribute,\n IContext2d,\n IMarkAttribute,\n ISymbol,\n IThemeAttribute,\n ISymbolRenderContribution,\n IDrawContext,\n IRenderService,\n IGraphicRender,\n IGraphicRenderDrawParams,\n IContributionProvider\n} from '../../../interface';\nimport type {} from '../../render-service';\nimport { BaseRender } from './base-render';\nimport { BaseRenderContributionTime } from '../../../common/enums';\nimport { SymbolRenderContribution } from './contributions/constants';\nimport { drawPathProxy, fillVisible, runFill, runStroke, strokeVisible } from './utils';\n\n@injectable()\nexport class DefaultCanvasSymbolRender extends BaseRender<ISymbol> implements IGraphicRender {\n type: 'symbol';\n numberType: number = SYMBOL_NUMBER_TYPE;\n\n constructor(\n @inject(ContributionProvider)\n @named(SymbolRenderContribution)\n protected readonly symbolRenderContribitions: IContributionProvider<ISymbolRenderContribution>\n ) {\n super();\n this.init(symbolRenderContribitions);\n }\n\n drawShape(\n symbol: ISymbol,\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 symbolAttribute = graphicService.themeService.getCurrentTheme().symbolAttribute;\n const symbolAttribute = getTheme(symbol, params?.theme).symbol;\n\n const {\n size = symbolAttribute.size,\n x: originX = symbolAttribute.x,\n y: originY = symbolAttribute.y,\n scaleX = symbolAttribute.scaleX,\n scaleY = symbolAttribute.scaleY\n } = symbol.attribute;\n\n const data = this.valid(symbol, symbolAttribute, fillCb, strokeCb);\n if (!data) {\n return;\n }\n const { fVisible, sVisible, doFill, doStroke } = data;\n\n const parsedPath = symbol.getParsedPath();\n // todo: 考虑使用path\n if (!parsedPath) {\n return;\n }\n\n const { keepDirIn3d = symbolAttribute.keepDirIn3d } = symbol.attribute;\n const z = this.z ?? 0;\n context.beginPath();\n if (keepDirIn3d && context.camera && context.project) {\n const p = context.project(x, y, z);\n const camera = context.camera;\n context.camera = null;\n if (\n parsedPath.draw(context, size, p.x, p.y, undefined, (p, a) => {\n // 如果是svg的话,合并一下fill和stroke\n if (symbol._parsedPath.svgCache) {\n const obj = Object.assign({}, a);\n obj.fill = a.fill ?? symbol.attribute.fill;\n obj.opacity = a.fill ?? symbol.attribute.opacity;\n obj.fillOpacity = symbol.attribute.fillOpacity;\n obj.stroke = a.stroke ?? symbol.attribute.stroke;\n a = obj;\n }\n if (a.fill) {\n if (fillCb) {\n fillCb(context, symbol.attribute, symbolAttribute);\n } else {\n context.setCommonStyle(symbol, a, originX - x, originY - y, symbolAttribute);\n context.fill();\n }\n }\n if (a.stroke) {\n if (strokeCb) {\n strokeCb(context, symbol.attribute, symbolAttribute);\n } else {\n context.setStrokeStyle(symbol, a, (originX - x) / scaleX, (originY - y) / scaleY, symbolAttribute);\n context.stroke();\n }\n }\n }) === false\n ) {\n context.closePath();\n }\n context.camera = camera;\n } else {\n if (\n parsedPath.draw(context, size, x, y, z, (p, a) => {\n // 如果是svg的话,合并一下fill和stroke\n if (symbol._parsedPath.svgCache) {\n const obj = Object.assign({}, a);\n obj.fill = a.fill ?? symbol.attribute.fill;\n obj.opacity = a.opacity ?? symbol.attribute.opacity;\n obj.fillOpacity = symbol.attribute.fillOpacity;\n obj.stroke = a.stroke ?? symbol.attribute.stroke;\n a = obj;\n }\n if (a.fill) {\n if (fillCb) {\n fillCb(context, symbol.attribute, symbolAttribute);\n } else {\n context.setCommonStyle(symbol, a, originX - x, originY - y, symbolAttribute);\n context.fill();\n }\n }\n if (a.stroke) {\n if (strokeCb) {\n strokeCb(context, symbol.attribute, symbolAttribute);\n } else {\n context.setStrokeStyle(symbol, a, (originX - x) / scaleX, (originY - y) / scaleY, symbolAttribute);\n context.stroke();\n }\n }\n }) === false\n ) {\n context.closePath();\n }\n }\n\n // shadow\n context.setShadowBlendStyle && context.setShadowBlendStyle(symbol, symbol.attribute, symbolAttribute);\n\n this.beforeRenderStep(\n symbol,\n context,\n x,\n y,\n doFill,\n doStroke,\n fVisible,\n sVisible,\n symbolAttribute,\n drawContext,\n fillCb,\n strokeCb\n );\n\n // if (fill !== false) {\n // context.setCommonStyle(symbol.attribute, symbolAttribute);\n // context.fill();\n // }\n // if (stroke !== false) {\n // context.setStrokeStyle(symbol.attribute, symbolAttribute);\n // context.stroke();\n // }\n\n // svg就不用fill和stroke了\n if (doFill && !parsedPath.isSvg) {\n if (fillCb) {\n fillCb(context, symbol.attribute, symbolAttribute);\n } else if (fVisible) {\n context.setCommonStyle(symbol, symbol.attribute, originX - x, originY - y, symbolAttribute);\n context.fill();\n }\n }\n if (doStroke && !parsedPath.isSvg) {\n if (strokeCb) {\n strokeCb(context, symbol.attribute, symbolAttribute);\n } else if (sVisible) {\n context.setStrokeStyle(\n symbol,\n symbol.attribute,\n (originX - x) / scaleX,\n (originY - y) / scaleY,\n symbolAttribute\n );\n context.stroke();\n }\n }\n\n this.afterRenderStep(\n symbol,\n context,\n x,\n y,\n doFill,\n doStroke,\n fVisible,\n sVisible,\n symbolAttribute,\n drawContext,\n fillCb,\n strokeCb\n );\n }\n\n draw(symbol: ISymbol, renderService: IRenderService, drawContext: IDrawContext, params?: IGraphicRenderDrawParams) {\n const symbolAttribute = getTheme(symbol, params?.theme).symbol;\n this._draw(symbol, symbolAttribute, false, drawContext, params);\n }\n}\n"]}
@@ -30,16 +30,14 @@ import { max } from "@visactor/vutils";
30
30
 
31
31
  import { calculateLineHeight } from "../../../common/utils";
32
32
 
33
- import { defaultTextBackgroundRenderContribution } from "./contributions/text-contribution-render";
34
-
35
33
  let DefaultCanvasTextRender = class extends BaseRender {
36
34
  constructor(textRenderContribitions) {
37
35
  super(), this.textRenderContribitions = textRenderContribitions, this.numberType = TEXT_NUMBER_TYPE,
38
- this.builtinContributions = [ defaultTextBackgroundRenderContribution ], this.init(textRenderContribitions);
36
+ this.init(textRenderContribitions);
39
37
  }
40
38
  drawShape(text, context, x, y, drawContext, params, fillCb, strokeCb) {
41
39
  var _a, _b, _c;
42
- const textAttribute = getTheme(text, null == params ? void 0 : params.theme).text, {text: str, underline: underline = textAttribute.underline, lineThrough: lineThrough = textAttribute.lineThrough, keepDirIn3d: keepDirIn3d = textAttribute.keepDirIn3d, direction: direction = textAttribute.direction, fontSize: fontSize = textAttribute.fontSize, verticalMode: verticalMode = textAttribute.verticalMode, x: originX = textAttribute.x, y: originY = textAttribute.y} = text.attribute;
40
+ const textAttribute = getTheme(text, null == params ? void 0 : params.theme).text, {text: str, fill: fill = textAttribute.fill, stroke: stroke = textAttribute.stroke, fillOpacity: fillOpacity = textAttribute.fillOpacity, strokeOpacity: strokeOpacity = textAttribute.strokeOpacity, opacity: opacity = textAttribute.opacity, lineWidth: lineWidth = textAttribute.lineWidth, visible: visible = textAttribute.visible, underline: underline = textAttribute.underline, lineThrough: lineThrough = textAttribute.lineThrough, keepDirIn3d: keepDirIn3d = textAttribute.keepDirIn3d, direction: direction = textAttribute.direction, fontSize: fontSize = textAttribute.fontSize, verticalMode: verticalMode = textAttribute.verticalMode, x: originX = textAttribute.x, y: originY = textAttribute.y} = text.attribute;
43
41
  let {textAlign: textAlign = textAttribute.textAlign, textBaseline: textBaseline = textAttribute.textBaseline} = text.attribute;
44
42
  if (!verticalMode && "vertical" === direction) {
45
43
  const t = textAlign;
@@ -80,7 +78,6 @@ let DefaultCanvasTextRender = class extends BaseRender {
80
78
  this.drawMultiUnderLine(underline, lineThrough, text, (line.leftOffset || 0) + x, (line.topOffset || 0) + yOffset + y, z, line.width, textAttribute, context);
81
79
  }))));
82
80
  } else {
83
- text.tryUpdateAABBBounds();
84
81
  const cache = text.cache, {verticalList: verticalList} = cache;
85
82
  context.textAlign = "left", context.textBaseline = "top";
86
83
  const totalHeight = lineHeight * verticalList.length;
@@ -102,16 +99,15 @@ let DefaultCanvasTextRender = class extends BaseRender {
102
99
  currentOffsetY += width;
103
100
  }));
104
101
  }));
105
- } else if ("horizontal" === direction) {
106
- context.setTextStyle(text.attribute, textAttribute, z);
107
- const t = text.clipedText;
108
- let dy = 0;
109
- lineHeight !== fontSize && ("top" === textBaseline ? dy = (lineHeight - fontSize) / 2 : "middle" === textBaseline || "bottom" === textBaseline && (dy = -(lineHeight - fontSize) / 2)),
110
- drawText(t, 0, dy, 0);
111
102
  } else {
112
- text.tryUpdateAABBBounds();
113
103
  const cache = text.cache;
114
- if (cache) {
104
+ if ("horizontal" === direction) {
105
+ context.setTextStyle(text.attribute, textAttribute, z);
106
+ const t = text.clipedText;
107
+ let dy = 0;
108
+ lineHeight !== fontSize && ("top" === textBaseline ? dy = (lineHeight - fontSize) / 2 : "middle" === textBaseline || "bottom" === textBaseline && (dy = -(lineHeight - fontSize) / 2)),
109
+ drawText(t, 0, dy, 0);
110
+ } else if (cache) {
115
111
  context.setTextStyleWithoutAlignBaseline(text.attribute, textAttribute, z);
116
112
  const {verticalList: verticalList} = cache;
117
113
  let offsetY = 0;