@visactor/vrender 0.15.0-alpha.14 → 0.15.0-alpha.16

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 (303) hide show
  1. package/cjs/animate/animate.d.ts +0 -1
  2. package/cjs/animate/animate.js +0 -3
  3. package/cjs/animate/animate.js.map +1 -1
  4. package/cjs/animate/timeline.d.ts +1 -1
  5. package/cjs/animate/timeline.js +2 -2
  6. package/cjs/animate/timeline.js.map +1 -1
  7. package/cjs/canvas/contributions/browser/context.d.ts +0 -1
  8. package/cjs/common/contribution-provider.d.ts +0 -1
  9. package/cjs/common/contribution-provider.js +2 -7
  10. package/cjs/common/contribution-provider.js.map +1 -1
  11. package/cjs/common/enums.d.ts +2 -4
  12. package/cjs/common/enums.js +2 -3
  13. package/cjs/common/enums.js.map +1 -1
  14. package/cjs/core/contributions/env/base-contribution.d.ts +1 -11
  15. package/cjs/core/contributions/env/base-contribution.js +1 -22
  16. package/cjs/core/contributions/env/base-contribution.js.map +1 -1
  17. package/cjs/core/contributions/env/browser-contribution.d.ts +2 -11
  18. package/cjs/core/contributions/env/browser-contribution.js +0 -66
  19. package/cjs/core/contributions/env/browser-contribution.js.map +1 -1
  20. package/cjs/core/contributions/textMeasure/layout.js +1 -1
  21. package/cjs/core/contributions/textMeasure/layout.js.map +1 -1
  22. package/cjs/core/contributions/window/base-contribution.d.ts +5 -11
  23. package/cjs/core/contributions/window/base-contribution.js +0 -10
  24. package/cjs/core/contributions/window/base-contribution.js.map +1 -1
  25. package/cjs/core/contributions/window/browser-contribution.d.ts +0 -11
  26. package/cjs/core/contributions/window/browser-contribution.js +2 -33
  27. package/cjs/core/contributions/window/browser-contribution.js.map +1 -1
  28. package/cjs/core/global.d.ts +1 -11
  29. package/cjs/core/global.js +0 -18
  30. package/cjs/core/global.js.map +1 -1
  31. package/cjs/core/layer.js +6 -6
  32. package/cjs/core/layer.js.map +1 -1
  33. package/cjs/core/stage.d.ts +4 -13
  34. package/cjs/core/stage.js +25 -54
  35. package/cjs/core/stage.js.map +1 -1
  36. package/cjs/core/window.d.ts +0 -6
  37. package/cjs/core/window.js +1 -10
  38. package/cjs/core/window.js.map +1 -1
  39. package/cjs/graphic/builtin-symbol/arrow2-left.js +1 -1
  40. package/cjs/graphic/builtin-symbol/arrow2-left.js.map +1 -1
  41. package/cjs/graphic/builtin-symbol/arrow2-right.js +1 -1
  42. package/cjs/graphic/builtin-symbol/arrow2-right.js.map +1 -1
  43. package/cjs/graphic/builtin-symbol/index.d.ts +1 -1
  44. package/cjs/graphic/builtin-symbol/index.js +2 -2
  45. package/cjs/graphic/builtin-symbol/index.js.map +1 -1
  46. package/cjs/graphic/builtin-symbol/utils.d.ts +5 -13
  47. package/cjs/graphic/builtin-symbol/utils.js +9 -23
  48. package/cjs/graphic/builtin-symbol/utils.js.map +1 -1
  49. package/cjs/graphic/config.js +6 -7
  50. package/cjs/graphic/config.js.map +1 -1
  51. package/cjs/graphic/constants.d.ts +0 -22
  52. package/cjs/graphic/constants.js +2 -20
  53. package/cjs/graphic/constants.js.map +1 -1
  54. package/cjs/graphic/graphic.d.ts +0 -3
  55. package/cjs/graphic/graphic.js +26 -40
  56. package/cjs/graphic/graphic.js.map +1 -1
  57. package/cjs/graphic/group.js +1 -1
  58. package/cjs/graphic/group.js.map +1 -1
  59. package/cjs/graphic/index.d.ts +0 -1
  60. package/cjs/graphic/index.js +13 -13
  61. package/cjs/graphic/index.js.map +1 -1
  62. package/cjs/graphic/richtext/utils.d.ts +1 -1
  63. package/cjs/graphic/richtext/utils.js +1 -1
  64. package/cjs/graphic/richtext/utils.js.map +1 -1
  65. package/cjs/graphic/symbol.d.ts +1 -2
  66. package/cjs/graphic/symbol.js +4 -27
  67. package/cjs/graphic/symbol.js.map +1 -1
  68. package/cjs/graphic/text.js +23 -33
  69. package/cjs/graphic/text.js.map +1 -1
  70. package/cjs/graphic/tools.d.ts +2 -3
  71. package/cjs/graphic/tools.js +3 -58
  72. package/cjs/graphic/tools.js.map +1 -1
  73. package/cjs/graphic/wrap-text.js +8 -10
  74. package/cjs/graphic/wrap-text.js.map +1 -1
  75. package/cjs/index.d.ts +1 -2
  76. package/cjs/index.js +2 -2
  77. package/cjs/index.js.map +1 -1
  78. package/cjs/interface/animate.d.ts +1 -3
  79. package/cjs/interface/animate.js.map +1 -1
  80. package/cjs/interface/global.d.ts +1 -25
  81. package/cjs/interface/global.js.map +1 -1
  82. package/cjs/interface/graphic/image.d.ts +0 -1
  83. package/cjs/interface/graphic/image.js.map +1 -1
  84. package/cjs/interface/graphic/line.d.ts +1 -0
  85. package/cjs/interface/graphic/line.js.map +1 -1
  86. package/cjs/interface/graphic/symbol.d.ts +2 -3
  87. package/cjs/interface/graphic/symbol.js.map +1 -1
  88. package/cjs/interface/graphic/text.d.ts +0 -1
  89. package/cjs/interface/graphic/text.js.map +1 -1
  90. package/cjs/interface/graphic.d.ts +3 -25
  91. package/cjs/interface/graphic.js.map +1 -1
  92. package/cjs/interface/render.d.ts +0 -1
  93. package/cjs/interface/render.js.map +1 -1
  94. package/cjs/interface/stage.d.ts +3 -10
  95. package/cjs/interface/stage.js.map +1 -1
  96. package/cjs/interface/window.d.ts +0 -12
  97. package/cjs/interface/window.js.map +1 -1
  98. package/cjs/picker/contributions/canvas-picker/symbol-picker.js +2 -4
  99. package/cjs/picker/contributions/canvas-picker/symbol-picker.js.map +1 -1
  100. package/cjs/picker/pick-interceptor.js +3 -2
  101. package/cjs/picker/pick-interceptor.js.map +1 -1
  102. package/cjs/plugins/builtin-plugin/flex-layout-plugin.d.ts +0 -2
  103. package/cjs/plugins/builtin-plugin/flex-layout-plugin.js +21 -42
  104. package/cjs/plugins/builtin-plugin/flex-layout-plugin.js.map +1 -1
  105. package/cjs/plugins/plugin-modules.js +1 -1
  106. package/cjs/plugins/plugin-modules.js.map +1 -1
  107. package/cjs/render/contributions/render/area-render.js +31 -21
  108. package/cjs/render/contributions/render/area-render.js.map +1 -1
  109. package/cjs/render/contributions/render/contributions/image-contribution-render.js +1 -23
  110. package/cjs/render/contributions/render/contributions/image-contribution-render.js.map +1 -1
  111. package/cjs/render/contributions/render/draw-contribution.d.ts +1 -3
  112. package/cjs/render/contributions/render/draw-contribution.js +1 -3
  113. package/cjs/render/contributions/render/draw-contribution.js.map +1 -1
  114. package/cjs/render/contributions/render/image-render.js +3 -7
  115. package/cjs/render/contributions/render/image-render.js.map +1 -1
  116. package/cjs/render/contributions/render/line-render.js +50 -23
  117. package/cjs/render/contributions/render/line-render.js.map +1 -1
  118. package/cjs/render/contributions/render/symbol-render.js +5 -12
  119. package/cjs/render/contributions/render/symbol-render.js.map +1 -1
  120. package/cjs/render/contributions/render/utils.d.ts +2 -2
  121. package/cjs/render/contributions/render/utils.js.map +1 -1
  122. package/cjs/render/render-service.js +1 -3
  123. package/cjs/render/render-service.js.map +1 -1
  124. package/dist/index.js +318 -3342
  125. package/dist/index.min.js +1 -1
  126. package/es/animate/animate.d.ts +0 -1
  127. package/es/animate/animate.js +0 -3
  128. package/es/animate/animate.js.map +1 -1
  129. package/es/animate/timeline.d.ts +1 -1
  130. package/es/animate/timeline.js +2 -2
  131. package/es/animate/timeline.js.map +1 -1
  132. package/es/canvas/contributions/browser/context.d.ts +0 -1
  133. package/es/common/contribution-provider.d.ts +0 -1
  134. package/es/common/contribution-provider.js +0 -4
  135. package/es/common/contribution-provider.js.map +1 -1
  136. package/es/common/enums.d.ts +2 -4
  137. package/es/common/enums.js +2 -3
  138. package/es/common/enums.js.map +1 -1
  139. package/es/core/contributions/env/base-contribution.d.ts +1 -11
  140. package/es/core/contributions/env/base-contribution.js +0 -23
  141. package/es/core/contributions/env/base-contribution.js.map +1 -1
  142. package/es/core/contributions/env/browser-contribution.d.ts +2 -11
  143. package/es/core/contributions/env/browser-contribution.js +1 -67
  144. package/es/core/contributions/env/browser-contribution.js.map +1 -1
  145. package/es/core/contributions/textMeasure/layout.js +1 -1
  146. package/es/core/contributions/textMeasure/layout.js.map +1 -1
  147. package/es/core/contributions/window/base-contribution.d.ts +5 -11
  148. package/es/core/contributions/window/base-contribution.js +0 -10
  149. package/es/core/contributions/window/base-contribution.js.map +1 -1
  150. package/es/core/contributions/window/browser-contribution.d.ts +0 -11
  151. package/es/core/contributions/window/browser-contribution.js +2 -33
  152. package/es/core/contributions/window/browser-contribution.js.map +1 -1
  153. package/es/core/global.d.ts +1 -11
  154. package/es/core/global.js +0 -18
  155. package/es/core/global.js.map +1 -1
  156. package/es/core/layer.js +6 -6
  157. package/es/core/layer.js.map +1 -1
  158. package/es/core/stage.d.ts +4 -13
  159. package/es/core/stage.js +24 -57
  160. package/es/core/stage.js.map +1 -1
  161. package/es/core/window.d.ts +0 -6
  162. package/es/core/window.js +1 -10
  163. package/es/core/window.js.map +1 -1
  164. package/es/graphic/builtin-symbol/arrow2-left.js +1 -1
  165. package/es/graphic/builtin-symbol/arrow2-left.js.map +1 -1
  166. package/es/graphic/builtin-symbol/arrow2-right.js +1 -1
  167. package/es/graphic/builtin-symbol/arrow2-right.js.map +1 -1
  168. package/es/graphic/builtin-symbol/index.d.ts +1 -1
  169. package/es/graphic/builtin-symbol/index.js +1 -11
  170. package/es/graphic/builtin-symbol/index.js.map +1 -1
  171. package/es/graphic/builtin-symbol/utils.d.ts +5 -13
  172. package/es/graphic/builtin-symbol/utils.js +7 -25
  173. package/es/graphic/builtin-symbol/utils.js.map +1 -1
  174. package/es/graphic/config.js +6 -7
  175. package/es/graphic/config.js.map +1 -1
  176. package/es/graphic/constants.d.ts +0 -22
  177. package/es/graphic/constants.js +0 -26
  178. package/es/graphic/constants.js.map +1 -1
  179. package/es/graphic/graphic.d.ts +0 -3
  180. package/es/graphic/graphic.js +26 -40
  181. package/es/graphic/graphic.js.map +1 -1
  182. package/es/graphic/group.js +1 -1
  183. package/es/graphic/group.js.map +1 -1
  184. package/es/graphic/index.d.ts +0 -1
  185. package/es/graphic/index.js +0 -2
  186. package/es/graphic/index.js.map +1 -1
  187. package/es/graphic/richtext/utils.d.ts +1 -1
  188. package/es/graphic/richtext/utils.js +1 -1
  189. package/es/graphic/richtext/utils.js.map +1 -1
  190. package/es/graphic/symbol.d.ts +1 -2
  191. package/es/graphic/symbol.js +1 -28
  192. package/es/graphic/symbol.js.map +1 -1
  193. package/es/graphic/text.js +23 -33
  194. package/es/graphic/text.js.map +1 -1
  195. package/es/graphic/tools.d.ts +2 -3
  196. package/es/graphic/tools.js +0 -59
  197. package/es/graphic/tools.js.map +1 -1
  198. package/es/graphic/wrap-text.js +8 -10
  199. package/es/graphic/wrap-text.js.map +1 -1
  200. package/es/index.d.ts +1 -2
  201. package/es/index.js +1 -3
  202. package/es/index.js.map +1 -1
  203. package/es/interface/animate.d.ts +1 -3
  204. package/es/interface/animate.js.map +1 -1
  205. package/es/interface/global.d.ts +1 -25
  206. package/es/interface/global.js.map +1 -1
  207. package/es/interface/graphic/image.d.ts +0 -1
  208. package/es/interface/graphic/image.js.map +1 -1
  209. package/es/interface/graphic/line.d.ts +1 -0
  210. package/es/interface/graphic/line.js.map +1 -1
  211. package/es/interface/graphic/symbol.d.ts +2 -3
  212. package/es/interface/graphic/symbol.js.map +1 -1
  213. package/es/interface/graphic/text.d.ts +0 -1
  214. package/es/interface/graphic/text.js.map +1 -1
  215. package/es/interface/graphic.d.ts +3 -25
  216. package/es/interface/graphic.js.map +1 -1
  217. package/es/interface/render.d.ts +0 -1
  218. package/es/interface/render.js.map +1 -1
  219. package/es/interface/stage.d.ts +3 -10
  220. package/es/interface/stage.js.map +1 -1
  221. package/es/interface/window.d.ts +0 -12
  222. package/es/interface/window.js.map +1 -1
  223. package/es/picker/contributions/canvas-picker/symbol-picker.js +1 -6
  224. package/es/picker/contributions/canvas-picker/symbol-picker.js.map +1 -1
  225. package/es/picker/pick-interceptor.js +3 -2
  226. package/es/picker/pick-interceptor.js.map +1 -1
  227. package/es/plugins/builtin-plugin/flex-layout-plugin.d.ts +0 -2
  228. package/es/plugins/builtin-plugin/flex-layout-plugin.js +20 -47
  229. package/es/plugins/builtin-plugin/flex-layout-plugin.js.map +1 -1
  230. package/es/plugins/plugin-modules.js +2 -2
  231. package/es/plugins/plugin-modules.js.map +1 -1
  232. package/es/render/contributions/render/area-render.js +30 -20
  233. package/es/render/contributions/render/area-render.js.map +1 -1
  234. package/es/render/contributions/render/contributions/image-contribution-render.js +0 -27
  235. package/es/render/contributions/render/contributions/image-contribution-render.js.map +1 -1
  236. package/es/render/contributions/render/draw-contribution.d.ts +1 -3
  237. package/es/render/contributions/render/draw-contribution.js +0 -4
  238. package/es/render/contributions/render/draw-contribution.js.map +1 -1
  239. package/es/render/contributions/render/image-render.js +2 -10
  240. package/es/render/contributions/render/image-render.js.map +1 -1
  241. package/es/render/contributions/render/line-render.js +49 -22
  242. package/es/render/contributions/render/line-render.js.map +1 -1
  243. package/es/render/contributions/render/symbol-render.js +5 -12
  244. package/es/render/contributions/render/symbol-render.js.map +1 -1
  245. package/es/render/contributions/render/utils.d.ts +2 -2
  246. package/es/render/contributions/render/utils.js.map +1 -1
  247. package/es/render/render-service.js +1 -3
  248. package/es/render/render-service.js.map +1 -1
  249. package/package.json +13 -10
  250. package/cjs/graphic/builtin-symbol/arrow2-down.d.ts +0 -12
  251. package/cjs/graphic/builtin-symbol/arrow2-down.js +0 -30
  252. package/cjs/graphic/builtin-symbol/arrow2-down.js.map +0 -1
  253. package/cjs/graphic/builtin-symbol/arrow2-up.d.ts +0 -12
  254. package/cjs/graphic/builtin-symbol/arrow2-up.js +0 -30
  255. package/cjs/graphic/builtin-symbol/arrow2-up.js.map +0 -1
  256. package/cjs/graphic/builtin-symbol/close.d.ts +0 -13
  257. package/cjs/graphic/builtin-symbol/close.js +0 -33
  258. package/cjs/graphic/builtin-symbol/close.js.map +0 -1
  259. package/cjs/graphic/builtin-symbol/line-h.d.ts +0 -13
  260. package/cjs/graphic/builtin-symbol/line-h.js +0 -32
  261. package/cjs/graphic/builtin-symbol/line-h.js.map +0 -1
  262. package/cjs/graphic/builtin-symbol/line-v.d.ts +0 -13
  263. package/cjs/graphic/builtin-symbol/line-v.js +0 -32
  264. package/cjs/graphic/builtin-symbol/line-v.js.map +0 -1
  265. package/cjs/jsx/graphicType.d.ts +0 -172
  266. package/cjs/jsx/graphicType.js +0 -133
  267. package/cjs/jsx/graphicType.js.map +0 -1
  268. package/cjs/jsx/index.d.ts +0 -2
  269. package/cjs/jsx/index.js +0 -21
  270. package/cjs/jsx/index.js.map +0 -1
  271. package/cjs/jsx/jsx-classic.d.ts +0 -3
  272. package/cjs/jsx/jsx-classic.js +0 -58
  273. package/cjs/jsx/jsx-classic.js.map +0 -1
  274. package/cjs/plugins/builtin-plugin/html-attribute-plugin.d.ts +0 -13
  275. package/cjs/plugins/builtin-plugin/html-attribute-plugin.js +0 -79
  276. package/cjs/plugins/builtin-plugin/html-attribute-plugin.js.map +0 -1
  277. package/es/graphic/builtin-symbol/arrow2-down.d.ts +0 -12
  278. package/es/graphic/builtin-symbol/arrow2-down.js +0 -24
  279. package/es/graphic/builtin-symbol/arrow2-down.js.map +0 -1
  280. package/es/graphic/builtin-symbol/arrow2-up.d.ts +0 -12
  281. package/es/graphic/builtin-symbol/arrow2-up.js +0 -24
  282. package/es/graphic/builtin-symbol/arrow2-up.js.map +0 -1
  283. package/es/graphic/builtin-symbol/close.d.ts +0 -13
  284. package/es/graphic/builtin-symbol/close.js +0 -27
  285. package/es/graphic/builtin-symbol/close.js.map +0 -1
  286. package/es/graphic/builtin-symbol/line-h.d.ts +0 -13
  287. package/es/graphic/builtin-symbol/line-h.js +0 -26
  288. package/es/graphic/builtin-symbol/line-h.js.map +0 -1
  289. package/es/graphic/builtin-symbol/line-v.d.ts +0 -13
  290. package/es/graphic/builtin-symbol/line-v.js +0 -26
  291. package/es/graphic/builtin-symbol/line-v.js.map +0 -1
  292. package/es/jsx/graphicType.d.ts +0 -172
  293. package/es/jsx/graphicType.js +0 -126
  294. package/es/jsx/graphicType.js.map +0 -1
  295. package/es/jsx/index.d.ts +0 -2
  296. package/es/jsx/index.js +0 -4
  297. package/es/jsx/index.js.map +0 -1
  298. package/es/jsx/jsx-classic.d.ts +0 -3
  299. package/es/jsx/jsx-classic.js +0 -56
  300. package/es/jsx/jsx-classic.js.map +0 -1
  301. package/es/plugins/builtin-plugin/html-attribute-plugin.d.ts +0 -13
  302. package/es/plugins/builtin-plugin/html-attribute-plugin.js +0 -75
  303. package/es/plugins/builtin-plugin/html-attribute-plugin.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/core/layer.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAgBzC,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAEzC,MAAM,CAAC,MAAM,wBAAwB,GAAG,MAAM,CAAC,GAAG,CAAC,0BAA0B,CAAC,CAAC;AAO/E,MAAM,OAAO,KAAM,SAAQ,KAAK;IAsB9B,IAAI,SAAS;QACX,OAAO,IAAI,CAAC,YAAY,CAAC,SAAS,CAAC;IACrC,CAAC;IAKD,IAAI,KAAK;QACP,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE;YACf,OAAO,CAAC,CAAC;SACV;QACD,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC;IAC1B,CAAC;IACD,IAAI,MAAM;QACR,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE;YACf,OAAO,CAAC,CAAC;SACV;QACD,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC;IAC3B,CAAC;IACD,IAAI,SAAS;QACX,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE;YACf,OAAO,CAAC,CAAC;SACV;QACD,OAAO,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC;IAC9B,CAAC;IACD,IAAI,UAAU;QACZ,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE;YACf,OAAO,C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AAa,EAAE,MAAM,CAAC,aAAa,EACnC,CAAC,EAAE,MAAA,MAAM,CAAC,CAAC,mCAAI,IAAI,CAAC,KAAK,CAAC,CAAC,EAC3B,CAAC,EAAE,MAAA,MAAM,CAAC,CAAC,mCAAI,IAAI,CAAC,KAAK,CAAC,CAAC,EAC3B,KAAK,EAAE,IAAI,CAAC,SAAS,EACrB,MAAM,EAAE,IAAI,CAAC,UAAU,EACvB,KAAK,EAAE,IAAI,CAAC,KAAK,EACjB,KAAK,EAAE,IAAI,IACR,MAAM,EACT,CAAC;QACH,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;IAC1C,CAAC;CACF","file":"layer.js","sourcesContent":["import type { AABBBounds, IBoundsLike } from '@visactor/vutils';\nimport { application } from '../application';\nimport { container } from '../container';\nimport type {\n IDrawToParams,\n IGraphic,\n IGroup,\n ILayer,\n ILayerDrawParams,\n IStage,\n IGlobal,\n ILayerHandlerContribution,\n IDrawContext,\n ILayerHandlerDrawParams,\n IDrawContribution,\n IWindow,\n ILayerParams\n} from '../interface';\nimport { Theme } from '../graphic/theme';\nimport { Group } from '../graphic/group';\n\nexport const LayerHandlerContribution = Symbol.for('LayerHandlerContribution');\n\ntype BlendMode = 'normal';\n\n// layer需要有多个,对于Canvas来说,layer可以绑定一个canvas或一个ImageData\n// 对于WebGL来说,layer对应一个FrameBuffer\n// 对于Native来说,layer保留一个FrameBufferHandler\nexport class Layer extends Group implements ILayer {\n declare parent: any;\n\n declare _dpr: number;\n declare main: boolean;\n\n declare readonly virtual: boolean;\n declare afterDrawCbs: ((l: this) => void)[];\n\n declare imageData?: ImageData;\n // 混合模式,用于多图层混合\n declare blendMode: BlendMode;\n\n declare background: string;\n declare opacity: number;\n\n declare layer: this;\n declare subLayers: Map<\n number,\n { layer: ILayer; group?: IGroup; zIndex: number; drawContribution?: IDrawContribution }\n >;\n\n get offscreen(): boolean {\n return this.layerHandler.offscreen;\n }\n\n // stage控制\n // width: number;\n // height: number;\n get width(): number {\n if (!this.stage) {\n return 0;\n }\n return this.stage.width;\n }\n get height(): number {\n if (!this.stage) {\n return 0;\n }\n return this.stage.height;\n }\n get viewWidth(): number {\n if (!this.stage) {\n return 0;\n }\n return this.stage.viewWidth;\n }\n get viewHeight(): number {\n if (!this.stage) {\n return 0;\n }\n return this.stage.viewHeight;\n }\n declare pickable: boolean;\n\n get dirtyBound(): AABBBounds {\n // this.getRootNode<any>();\n throw new Error('暂不支持');\n }\n\n get dpr(): number {\n return this._dpr;\n }\n\n declare stage?: IStage;\n protected declare global: IGlobal;\n protected declare window: IWindow;\n protected declare layerHandler: ILayerHandlerContribution;\n\n constructor(stage: IStage, global: IGlobal, window: IWindow, params: ILayerParams) {\n super({});\n this.stage = stage;\n this.global = global;\n this.window = window;\n this.main = params.main;\n this.layerHandler = container.get<ILayerHandlerContribution>(LayerHandlerContribution);\n this.layerHandler.init(this, window, {\n main: params.main,\n canvasId: params.canvasId,\n width: this.viewWidth,\n height: this.viewHeight,\n zIndex: params.zIndex ?? 0\n });\n this.layer = this;\n this.subLayers = new Map();\n this.theme = new Theme();\n this.background = 'rgba(0, 0, 0, 0)';\n this.virtual = !!params.virtual;\n this.afterDrawCbs = [];\n }\n\n combineSubLayer(removeIncrementalKey: boolean = true) {\n const subLayers = Array.from(this.subLayers.values()).sort((a, b) => {\n return a.zIndex - b.zIndex;\n });\n this.layerHandler.merge(\n subLayers.map(l => {\n if (l.layer.subLayers.size) {\n l.layer.combineSubLayer(removeIncrementalKey);\n }\n return l.layer.getNativeHandler();\n })\n );\n if (removeIncrementalKey) {\n subLayers.forEach(l => {\n l.group && (l.group.incremental = 0);\n });\n }\n subLayers.forEach(l => {\n // l.layer.release();\n application.layerService.releaseLayer(this.stage, l.layer);\n });\n this.subLayers.clear();\n }\n\n getNativeHandler(): ILayerHandlerContribution {\n return this.layerHandler;\n }\n\n setStage(stage?: IStage, layer?: ILayer) {\n super.setStage(stage, this);\n }\n\n // 选中图层中的节点\n pick(x: number, y: number): { graphic?: IGraphic; group?: IGroup } | false {\n throw new Error('暂不支持');\n }\n // 绘制图层\n render(params: ILayerDrawParams, userParams?: Partial<IDrawContext>) {\n const stage = this.stage;\n this.layerHandler.render(\n [this],\n {\n renderService: params.renderService,\n x: stage.x,\n y: stage.y,\n width: this.viewWidth,\n height: this.viewHeight,\n stage: this.stage,\n layer: this,\n // TODO: 多图层时不应该再用默认background\n background: params.background ?? this.background,\n updateBounds: params.updateBounds\n },\n userParams\n );\n this.afterDrawCbs.forEach(c => c(this));\n }\n resize(w: number, h: number) {\n this.layerHandler.resize(w, h);\n }\n resizeView(w: number, h: number) {\n this.layerHandler.resizeView(w, h);\n }\n setDpr(dpr: number) {\n this.layerHandler.setDpr(dpr);\n }\n afterDraw(cb: (l: this) => void) {\n this.afterDrawCbs.push(cb);\n }\n\n // 动画相关\n startAnimate(t: number) {\n throw new Error('暂不支持');\n }\n\n setToFrame(t: number) {\n throw new Error('暂不支持');\n }\n\n prepare(dirtyBounds: IBoundsLike, params: ILayerHandlerDrawParams) {\n return;\n }\n\n // 合并到某个target上\n combineTo(target: IWindow, params: IDrawToParams) {\n if (this.offscreen) {\n this.layerHandler.drawTo(target, [this], {\n // TODO: 多图层时不应该再用默认background\n background: params.background ?? this.background,\n renderService: params.renderService,\n x: params.x ?? this.stage.x,\n y: params.y ?? this.stage.y,\n width: this.viewWidth,\n height: this.viewHeight,\n stage: this.stage,\n layer: this,\n ...params\n });\n this.afterDrawCbs.forEach(c => c(this));\n }\n }\n\n release(): void {\n super.release();\n this.layerHandler.release();\n if (this.subLayers) {\n this.subLayers.forEach(l => {\n // l.layer.release();\n application.layerService.releaseLayer(this.stage, l.layer);\n });\n }\n }\n\n drawTo(target: IWindow, params: IDrawToParams) {\n this.layerHandler.drawTo(target, [this], {\n // TODO: 多图层时不应该再用默认background\n background: params.background ?? this.background,\n renderService: params.renderService,\n x: params.x ?? this.stage.x,\n y: params.y ?? this.stage.y,\n width: this.viewWidth,\n height: this.viewHeight,\n stage: this.stage,\n layer: this,\n ...params\n });\n this.afterDrawCbs.forEach(c => c(this));\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/core/layer.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAgBzC,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAEzC,MAAM,CAAC,MAAM,wBAAwB,GAAG,MAAM,CAAC,GAAG,CAAC,0BAA0B,CAAC,CAAC;AAO/E,MAAM,OAAO,KAAM,SAAQ,KAAK;IAsB9B,IAAI,SAAS;QACX,OAAO,IAAI,CAAC,YAAY,CAAC,SAAS,CAAC;IACrC,CAAC;IAKD,IAAI,KAAK;QACP,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE;YACf,OAAO,CAAC,CAAC;SACV;QACD,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC;IAC1B,CAAC;IACD,IAAI,MAAM;QACR,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE;YACf,OAAO,CAAC,CAAC;SACV;QACD,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC;IAC3B,CAAC;IACD,IAAI,SAAS;QACX,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE;YACf,OAAO,CAAC,CAAC;SACV;QACD,OAAO,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC;IAC9B,CAAC;IACD,IAAI,UAAU;QACZ,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE;YACf,OAAO,CAAC,CAAC;SACV;QACD,OAAO,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC;IAC/B,CAAC;IAGD,IAAI,UAAU;QAEZ,MAAM,IAAI,KAAK,CAAC,MAAM,CAAC,CAAC;IAC1B,CAAC;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,KAAK,EACjB,KAAK,EAAE,IAAI,IACR,MAAM,EACT,CAAC;QACH,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;IAC1C,CAAC;CACF","file":"layer.js","sourcesContent":["import type { AABBBounds, IBoundsLike } from '@visactor/vutils';\nimport { application } from '../application';\nimport { container } from '../container';\nimport type {\n IDrawToParams,\n IGraphic,\n IGroup,\n ILayer,\n ILayerDrawParams,\n IStage,\n IGlobal,\n ILayerHandlerContribution,\n IDrawContext,\n ILayerHandlerDrawParams,\n IDrawContribution,\n IWindow,\n ILayerParams\n} from '../interface';\nimport { Theme } from '../graphic/theme';\nimport { Group } from '../graphic/group';\n\nexport const LayerHandlerContribution = Symbol.for('LayerHandlerContribution');\n\ntype BlendMode = 'normal';\n\n// layer需要有多个,对于Canvas来说,layer可以绑定一个canvas或一个ImageData\n// 对于WebGL来说,layer对应一个FrameBuffer\n// 对于Native来说,layer保留一个FrameBufferHandler\nexport class Layer extends Group implements ILayer {\n declare parent: any;\n\n declare _dpr: number;\n declare main: boolean;\n\n declare readonly virtual: boolean;\n declare afterDrawCbs: ((l: this) => void)[];\n\n declare imageData?: ImageData;\n // 混合模式,用于多图层混合\n declare blendMode: BlendMode;\n\n declare background: string;\n declare opacity: number;\n\n declare layer: this;\n declare subLayers: Map<\n number,\n { layer: ILayer; group?: IGroup; zIndex: number; drawContribution?: IDrawContribution }\n >;\n\n get offscreen(): boolean {\n return this.layerHandler.offscreen;\n }\n\n // stage控制\n // width: number;\n // height: number;\n get width(): number {\n if (!this.stage) {\n return 0;\n }\n return this.stage.width;\n }\n get height(): number {\n if (!this.stage) {\n return 0;\n }\n return this.stage.height;\n }\n get viewWidth(): number {\n if (!this.stage) {\n return 0;\n }\n return this.stage.viewWidth;\n }\n get viewHeight(): number {\n if (!this.stage) {\n return 0;\n }\n return this.stage.viewHeight;\n }\n declare pickable: boolean;\n\n get dirtyBound(): AABBBounds {\n // this.getRootNode<any>();\n throw new Error('暂不支持');\n }\n\n get dpr(): number {\n return this._dpr;\n }\n\n declare stage?: IStage;\n protected declare global: IGlobal;\n protected declare window: IWindow;\n protected declare layerHandler: ILayerHandlerContribution;\n\n constructor(stage: IStage, global: IGlobal, window: IWindow, params: ILayerParams) {\n super({});\n this.stage = stage;\n this.global = global;\n this.window = window;\n this.main = params.main;\n this.layerHandler = container.get<ILayerHandlerContribution>(LayerHandlerContribution);\n this.layerHandler.init(this, window, {\n main: params.main,\n canvasId: params.canvasId,\n width: this.viewWidth,\n height: this.viewHeight,\n zIndex: params.zIndex ?? 0\n });\n this.layer = this;\n this.subLayers = new Map();\n this.theme = new Theme();\n this.background = 'rgba(0, 0, 0, 0)';\n this.virtual = !!params.virtual;\n this.afterDrawCbs = [];\n }\n\n combineSubLayer(removeIncrementalKey: boolean = true) {\n const subLayers = Array.from(this.subLayers.values()).sort((a, b) => {\n return a.zIndex - b.zIndex;\n });\n this.layerHandler.merge(\n subLayers.map(l => {\n if (l.layer.subLayers.size) {\n l.layer.combineSubLayer(removeIncrementalKey);\n }\n return l.layer.getNativeHandler();\n })\n );\n if (removeIncrementalKey) {\n subLayers.forEach(l => {\n l.group && (l.group.incremental = 0);\n });\n }\n subLayers.forEach(l => {\n // l.layer.release();\n application.layerService.releaseLayer(this.stage, l.layer);\n });\n this.subLayers.clear();\n }\n\n getNativeHandler(): ILayerHandlerContribution {\n return this.layerHandler;\n }\n\n setStage(stage?: IStage, layer?: ILayer) {\n super.setStage(stage, this);\n }\n\n // 选中图层中的节点\n pick(x: number, y: number): { graphic?: IGraphic; group?: IGroup } | false {\n throw new Error('暂不支持');\n }\n // 绘制图层\n render(params: ILayerDrawParams, userParams?: Partial<IDrawContext>) {\n const stage = this.stage;\n this.layerHandler.render(\n [this],\n {\n renderService: params.renderService,\n x: stage.x,\n y: stage.y,\n width: this.viewWidth,\n height: this.viewHeight,\n stage: this.stage,\n layer: this,\n // TODO: 多图层时不应该再用默认background\n background: params.background ?? this.background,\n updateBounds: params.updateBounds\n },\n userParams\n );\n this.afterDrawCbs.forEach(c => c(this));\n }\n resize(w: number, h: number) {\n this.layerHandler.resize(w, h);\n }\n resizeView(w: number, h: number) {\n this.layerHandler.resizeView(w, h);\n }\n setDpr(dpr: number) {\n this.layerHandler.setDpr(dpr);\n }\n afterDraw(cb: (l: this) => void) {\n this.afterDrawCbs.push(cb);\n }\n\n // 动画相关\n startAnimate(t: number) {\n throw new Error('暂不支持');\n }\n\n setToFrame(t: number) {\n throw new Error('暂不支持');\n }\n\n prepare(dirtyBounds: IBoundsLike, params: ILayerHandlerDrawParams) {\n return;\n }\n\n // 合并到某个target上\n combineTo(target: IWindow, params: IDrawToParams) {\n if (this.offscreen) {\n this.layerHandler.drawTo(target, [this], {\n // TODO: 多图层时不应该再用默认background\n background: params.background ?? this.background,\n renderService: params.renderService,\n x: this.stage.x,\n y: this.stage.y,\n width: this.viewWidth,\n height: this.viewHeight,\n stage: this.stage,\n layer: this,\n ...params\n });\n this.afterDrawCbs.forEach(c => c(this));\n }\n }\n\n release(): void {\n super.release();\n this.layerHandler.release();\n if (this.subLayers) {\n this.subLayers.forEach(l => {\n // l.layer.release();\n application.layerService.releaseLayer(this.stage, l.layer);\n });\n }\n }\n\n drawTo(target: IWindow, params: IDrawToParams) {\n this.layerHandler.drawTo(target, [this], {\n // TODO: 多图层时不应该再用默认background\n background: params.background ?? this.background,\n renderService: params.renderService,\n x: this.stage.x,\n y: this.stage.y,\n width: this.viewWidth,\n height: this.viewHeight,\n stage: this.stage,\n layer: this,\n ...params\n });\n this.afterDrawCbs.forEach(c => c(this));\n }\n}\n"]}
@@ -1,6 +1,6 @@
1
- import type { IAABBBounds, IBounds, IBoundsLike, IMatrix } from '@visactor/vutils';
1
+ import type { IBounds, IBoundsLike, IMatrix } from '@visactor/vutils';
2
2
  import { AABBBounds } from '@visactor/vutils';
3
- import type { IGraphic, IGroup, IExportType, IStage, IStageParams, ILayer, IColor, IOption3D, ICamera, vec3, IDirectionLight, ITicker, IRenderService, IPickerService, IPluginService, ISyncHook, IDrawContext, IWindow, ILayerService, ITimeline, IOptimizeType } from '../interface';
3
+ import type { IGraphic, IGroup, IExportType, IStage, IStageParams, ILayer, IColor, IOption3D, ICamera, vec3, IDirectionLight, ITicker, IRenderService, IPickerService, IPluginService, ISyncHook, IDrawContext, IWindow, ILayerService } from '../interface';
4
4
  import type { Layer } from './layer';
5
5
  import { Group } from '../graphic';
6
6
  export declare class Stage extends Group implements IStage {
@@ -43,7 +43,6 @@ export declare class Stage extends Group implements IStage {
43
43
  ticker: ITicker;
44
44
  autoRender: boolean;
45
45
  _enableLayout: boolean;
46
- htmlAttribute: boolean | string | any;
47
46
  increaseAutoRender: boolean;
48
47
  view3dTranform: boolean;
49
48
  readonly window: IWindow;
@@ -55,17 +54,11 @@ export declare class Stage extends Group implements IStage {
55
54
  private readonly eventSystem?;
56
55
  protected _beforeRender?: (stage: IStage) => void;
57
56
  protected _afterRender?: (stage: IStage) => void;
58
- protected _skipRender?: number;
59
57
  protected _afterNextRenderCbs?: ((stage: IStage) => void)[];
60
58
  protected lastRenderparams?: Partial<IDrawContext>;
61
59
  protected interactiveLayer?: ILayer;
62
60
  protected supportInteractiveLayer: boolean;
63
- protected timeline: ITimeline;
64
- params: Partial<IStageParams>;
65
61
  constructor(params: Partial<IStageParams>);
66
- optmize(params?: IOptimizeType): void;
67
- protected optmizeRender(skipRenderWithOutRange?: boolean): void;
68
- getTimeline(): ITimeline;
69
62
  get3dOptions(options: IOption3D): {
70
63
  center: {
71
64
  x?: number;
@@ -104,8 +97,6 @@ export declare class Stage extends Group implements IStage {
104
97
  disableDirtyBounds(): void;
105
98
  enableLayout(): void;
106
99
  disableLayout(): void;
107
- enableHtmlAttribute(container?: any): void;
108
- disableHtmlAttribute(): void;
109
100
  protected tryUpdateAABBBounds(): AABBBounds;
110
101
  combineLayer(ILayer1: ILayer, ILayer2: ILayer): ILayer;
111
102
  createLayer(canvasId?: string): ILayer;
@@ -141,8 +132,8 @@ export declare class Stage extends Group implements IStage {
141
132
  width: number;
142
133
  height: number;
143
134
  }): void;
144
- renderToNewWindow(fullImage?: boolean, viewBox?: IAABBBounds): IWindow;
145
- toCanvas(fullImage?: boolean, viewBox?: IAABBBounds): HTMLCanvasElement | null;
135
+ renderToNewWindow(fullImage?: boolean): IWindow;
136
+ toCanvas(fullImage?: boolean): HTMLCanvasElement | null;
146
137
  setCursor(mode?: string): void;
147
138
  getCursor(): string;
148
139
  }
package/es/core/stage.js CHANGED
@@ -20,8 +20,6 @@ import { ViewTransform3dPlugin } from "../plugins/builtin-plugin/3dview-transfor
20
20
 
21
21
  import { IncrementalAutoRenderPlugin } from "../plugins/builtin-plugin/incremental-auto-render-plugin";
22
22
 
23
- import { HtmlAttributePlugin } from "../plugins/builtin-plugin/html-attribute-plugin";
24
-
25
23
  import { DirtyBoundsPlugin } from "../plugins/builtin-plugin/dirty-bounds-plugin";
26
24
 
27
25
  import { FlexLayoutPlugin } from "../plugins/builtin-plugin/flex-layout-plugin";
@@ -38,8 +36,6 @@ import { VGlobal } from "../constants";
38
36
 
39
37
  import { LayerService } from "./constants";
40
38
 
41
- import { DefaultTimeline } from "../animate";
42
-
43
39
  const DefaultConfig = {
44
40
  WIDTH: 500,
45
41
  HEIGHT: 500,
@@ -114,7 +110,7 @@ export class Stage extends Group {
114
110
  }, this.afterRender = stage => {
115
111
  this.renderCount++, this._afterRender && this._afterRender(stage), this._afterNextRenderCbs && this._afterNextRenderCbs.forEach((cb => cb(stage))),
116
112
  this._afterNextRenderCbs = null;
117
- }, this.params = params, this.theme = new Theme, this.hooks = {
113
+ }, this.theme = new Theme, this.hooks = {
118
114
  beforeRender: new SyncHook([ "stage" ]),
119
115
  afterRender: new SyncHook([ "stage" ])
120
116
  }, this.global = container.get(VGlobal), this.window = container.get(VWindow), this.renderService = container.get(RenderService),
@@ -155,24 +151,10 @@ export class Stage extends Group {
155
151
  }
156
152
  }
157
153
  })), params.autoRender && this.enableAutoRender(), !1 === params.disableDirtyBounds && this.enableDirtyBounds(),
158
- params.enableHtmlAttribute && this.enableHtmlAttribute(params.enableHtmlAttribute),
159
154
  params.enableLayout && this.enableLayout(), this.hooks.beforeRender.tap("constructor", this.beforeRender),
160
155
  this.hooks.afterRender.tap("constructor", this.afterRender), this._beforeRender = params.beforeRender,
161
156
  this._afterRender = params.afterRender, this.ticker = params.ticker || defaultTicker,
162
- this.supportInteractiveLayer = !1 !== params.interactiveLayer, this.timeline = new DefaultTimeline,
163
- this.ticker.addTimeline(this.timeline), this.timeline.pause(), this.optmize(params.optimize);
164
- }
165
- optmize(params) {
166
- this.optmizeRender(null == params ? void 0 : params.skipRenderWithOutRange);
167
- }
168
- optmizeRender(skipRenderWithOutRange = !0) {
169
- skipRenderWithOutRange && (this._skipRender = this.window.isVisible() ? 0 : 1, this.window.onVisibleChange((visible => {
170
- visible ? (this.dirtyBounds && this.dirtyBounds.setValue(0, 0, this._viewBox.width(), this._viewBox.height()),
171
- this._skipRender > 1 && this.renderNextFrame(), this._skipRender = 0) : this._skipRender = 1;
172
- })));
173
- }
174
- getTimeline() {
175
- return this.timeline;
157
+ this.supportInteractiveLayer = !1 !== params.interactiveLayer;
176
158
  }
177
159
  get3dOptions(options) {
178
160
  const {center: center = {
@@ -269,14 +251,6 @@ export class Stage extends Group {
269
251
  plugin.deactivate(this.pluginService);
270
252
  })));
271
253
  }
272
- enableHtmlAttribute(container) {
273
- this.htmlAttribute || (this.htmlAttribute = container, this.pluginService.register(new HtmlAttributePlugin));
274
- }
275
- disableHtmlAttribute() {
276
- this.htmlAttribute && (this.htmlAttribute = !1, this.pluginService.findPluginsByName("HtmlAttributePlugin").forEach((plugin => {
277
- plugin.deactivate(this.pluginService);
278
- })));
279
- }
280
254
  tryUpdateAABBBounds() {
281
255
  const viewBox = this._viewBox;
282
256
  return this._AABBBounds.setValue(viewBox.x1, viewBox.y1, viewBox.x2, viewBox.y2),
@@ -303,14 +277,14 @@ export class Stage extends Group {
303
277
  }
304
278
  tryInitInteractiveLayer() {
305
279
  this.supportInteractiveLayer && !this.interactiveLayer && (this.interactiveLayer = this.createLayer(),
306
- this.interactiveLayer.name = "_builtin_interactive", this.nextFrameRenderLayerSet.add(this.interactiveLayer));
280
+ this.interactiveLayer.name = "_builtin_interactive");
307
281
  }
308
282
  clearViewBox(color) {
309
283
  this.window.clearViewBox(this._viewBox, color);
310
284
  }
311
285
  render(layers, params) {
312
- this.ticker.start(), this.timeline.resume(), this._skipRender || (this.lastRenderparams = params,
313
- this.hooks.beforeRender.call(this), (layers || this).forEach(((layer, i) => {
286
+ this.ticker.start(), this.lastRenderparams = params, this.hooks.beforeRender.call(this),
287
+ (layers || this).forEach(((layer, i) => {
314
288
  layer.render({
315
289
  renderService: this.renderService,
316
290
  background: layer === this.defaultLayer ? this.background : void 0,
@@ -318,8 +292,7 @@ export class Stage extends Group {
318
292
  }, Object.assign({
319
293
  renderStyle: this.renderStyle
320
294
  }, params));
321
- })), this.combineLayersToWindow(), this.nextFrameRenderLayerSet.clear(), this.hooks.afterRender.call(this)),
322
- this._skipRender && this._skipRender++;
295
+ })), this.combineLayersToWindow(), this.nextFrameRenderLayerSet.clear(), this.hooks.afterRender.call(this);
323
296
  }
324
297
  combineLayersToWindow() {
325
298
  this.forEach(((layer, i) => {
@@ -343,7 +316,7 @@ export class Stage extends Group {
343
316
  })));
344
317
  }
345
318
  _doRenderInThisFrame() {
346
- this.timeline.resume(), this.ticker.start(), this.nextFrameRenderLayerSet.size && !this._skipRender && (this.hooks.beforeRender.call(this),
319
+ this.nextFrameRenderLayerSet.size && (this.ticker.start(), this.hooks.beforeRender.call(this),
347
320
  this.forEach((layer => {
348
321
  this.nextFrameRenderLayerSet.has(layer) && layer.render({
349
322
  renderService: this.renderService,
@@ -352,8 +325,7 @@ export class Stage extends Group {
352
325
  }, Object.assign({
353
326
  renderStyle: this.renderStyle
354
327
  }, this.lastRenderparams || {}));
355
- })), this.combineLayersToWindow(), this.hooks.afterRender.call(this), this.nextFrameRenderLayerSet.clear()),
356
- this._skipRender && this._skipRender++;
328
+ })), this.combineLayersToWindow(), this.hooks.afterRender.call(this), this.nextFrameRenderLayerSet.clear());
357
329
  }
358
330
  resizeWindow(w, h, rerender = !0) {
359
331
  this.window.resize(w, h), rerender && this.render();
@@ -427,36 +399,31 @@ export class Stage extends Group {
427
399
  }));
428
400
  }));
429
401
  }
430
- renderToNewWindow(fullImage = !0, viewBox) {
402
+ renderToNewWindow(fullImage = !0) {
431
403
  const window = container.get(VWindow);
432
- if (fullImage) window.create({
404
+ return fullImage ? window.create({
433
405
  width: this.viewWidth,
434
406
  height: this.viewHeight,
435
407
  dpr: this.window.dpr,
436
408
  canvasControled: !0,
437
409
  offscreen: !0,
438
410
  title: ""
439
- }); else {
440
- const width = viewBox ? viewBox.width() : Math.min(this.viewWidth, this.window.width - this.x), height = viewBox ? viewBox.height() : Math.min(this.viewHeight, this.window.height - this.y);
441
- window.create({
442
- width: width,
443
- height: height,
444
- dpr: this.window.dpr,
445
- canvasControled: !0,
446
- offscreen: !0,
447
- title: ""
448
- });
449
- }
450
- const x = viewBox ? -viewBox.x1 : 0, y = viewBox ? -viewBox.y1 : 0;
451
- return this.renderTo(window, {
452
- x: x,
453
- y: y,
454
- width: viewBox ? viewBox.x2 : window.width,
455
- height: viewBox ? viewBox.y2 : window.height
411
+ }) : window.create({
412
+ width: Math.min(this.viewWidth, this.window.width - this.x),
413
+ height: Math.min(this.viewHeight, this.window.height - this.y),
414
+ dpr: this.window.dpr,
415
+ canvasControled: !0,
416
+ offscreen: !0,
417
+ title: ""
418
+ }), this.renderTo(window, {
419
+ x: 0,
420
+ y: 0,
421
+ width: window.width,
422
+ height: window.height
456
423
  }), window;
457
424
  }
458
- toCanvas(fullImage = !0, viewBox) {
459
- const c = this.renderToNewWindow(fullImage, viewBox).getNativeHandler();
425
+ toCanvas(fullImage = !0) {
426
+ const c = this.renderToNewWindow(fullImage).getNativeHandler();
460
427
  return c.nativeCanv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AAI,CAAC,iBAAiB,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;QAC1D,MAAM,CAAC,GAAG,MAAM,CAAC,gBAAgB,EAAE,CAAC;QACpC,IAAI,CAAC,CAAC,YAAY,EAAE;YAClB,OAAO,CAAC,CAAC,YAAY,CAAC;SACvB;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,SAAS,CAAC,IAAa;QACrB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;QACpB,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;IACnC,CAAC;IAED,SAAS;QACP,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;CACF","file":"stage.js","sourcesContent":["import type { IAABBBounds, IBounds, IBoundsLike, IMatrix } from '@visactor/vutils';\nimport { AABBBounds, Bounds, Point } from '@visactor/vutils';\nimport type {\n IGraphic,\n IGroup,\n IExportType,\n IStage,\n IStageParams,\n ILayer,\n IColor,\n IGlobal,\n IOption3D,\n ICamera,\n vec3,\n IDirectionLight,\n ITicker,\n IRenderService,\n IPickerService,\n IPluginService,\n ISyncHook,\n IDrawContext,\n IWindow,\n IPlugin,\n IContributionProvider,\n ILayerService,\n ITimeline,\n IOptimizeType\n} from '../interface';\nimport { VWindow } from './window';\nimport type { Layer } from './layer';\nimport { EventSystem } from '../event';\nimport { container } from '../container';\nimport { RenderService } from '../render';\nimport { Group, Theme } from '../graphic';\nimport { PickerService } from '../picker/picker-service';\nimport { PluginService } from '../plugins/constants';\nimport { AutoRenderPlugin } from '../plugins/builtin-plugin/auto-render-plugin';\nimport { ViewTransform3dPlugin } from '../plugins/builtin-plugin/3dview-transform-plugin';\nimport { IncrementalAutoRenderPlugin } from '../plugins/builtin-plugin/incremental-auto-render-plugin';\nimport { HtmlAttributePlugin } from '../plugins/builtin-plugin/html-attribute-plugin';\nimport { DirtyBoundsPlugin } from '../plugins/builtin-plugin/dirty-bounds-plugin';\nimport { FlexLayoutPlugin } from '../plugins/builtin-plugin/flex-layout-plugin';\nimport { defaultTicker } from '../animate/default-ticker';\nimport { SyncHook } from '../tapable';\nimport { DirectionalLight } from './light';\nimport { OrthoCamera } from './camera';\nimport { VGlobal } from '../constants';\nimport { LayerService } from './constants';\nimport { DefaultTimeline } from '../animate';\n\nconst DefaultConfig = {\n WIDTH: 500,\n HEIGHT: 500,\n X: 0,\n Y: 0,\n BACKGROUND: 'white'\n};\n\n/**\n * Stage是一个舞台或一个视口,并不直接对应一个或多个Canvas,逻辑上和Canvas无关\n *\n * 1. Stage对应一个Canvas的整体,Stage的宽高即为Canvas的宽高\n * 2. Stage小于Canvas,Stage作为Canvas某个区域的视口,只管理这个区域\n * 3. 多图层时Stage的多个图层对应多个Canvas\n *\n * 原生环境下Stage可以拥有一个Window或者使用Window的一块区域\n *\n * 【注】如果希望获取完整的Canvas或窗口或者调整窗口信息,请使用Window模块\n */\nexport class Stage extends Group implements IStage {\n declare parent: IStage | null;\n\n protected _viewBox: AABBBounds;\n private _background: string | IColor;\n private _subView: boolean; // 是否是存在子视图\n protected nextFrameRenderLayerSet: Set<Layer>;\n protected willNextFrameRender: boolean;\n protected _cursor: string;\n renderCount: number;\n dirtyBounds: IBounds | null;\n option3d?: IOption3D;\n declare light?: IDirectionLight;\n declare camera?: ICamera;\n declare renderStyle?: string;\n\n declare hooks: {\n beforeRender: ISyncHook<[IStage]>;\n afterRender: ISyncHook<[IStage]>;\n };\n\n set viewBox(b: IBoundsLike) {\n this._viewBox.setValue(b.x1, b.y1, b.x2, b.y2);\n }\n get viewBox(): AABBBounds {\n return this._viewBox;\n }\n\n get x(): number {\n return this._viewBox.x1;\n }\n set x(x: number) {\n this._viewBox.translate(x - this._viewBox.x1, 0);\n }\n get y(): number {\n return this._viewBox.y1;\n }\n set y(y: number) {\n this._viewBox.translate(0, y - this._viewBox.y1);\n }\n get width(): number {\n return this.window.width;\n }\n set width(w: number) {\n this.resize(w, this.height);\n }\n get viewWidth(): number {\n return this._viewBox.width();\n }\n set viewWidth(w: number) {\n this.resizeView(w, this.viewHeight);\n }\n get viewHeight(): number {\n return this._viewBox.height();\n }\n set viewHeight(h: number) {\n this.resizeView(this.viewWidth, h);\n }\n get height(): number {\n return this.window.height;\n }\n set height(h: number) {\n this.resize(this.width, h);\n }\n get dpr(): number {\n return this.window.dpr;\n }\n set dpr(r: number) {\n this.setDpr(r);\n }\n get background(): string | IColor {\n return this._background ?? DefaultConfig.BACKGROUND;\n }\n set background(b: string | IColor) {\n this._background = b;\n }\n get defaultLayer(): ILayer {\n return this.at(0) as unknown as ILayer;\n }\n\n ticker: ITicker;\n\n autoRender: boolean;\n _enableLayout: boolean;\n htmlAttribute: boolean | string | any;\n increaseAutoRender: boolean;\n view3dTranform: boolean;\n readonly window: IWindow;\n private readonly global: IGlobal;\n readonly renderService: IRenderService;\n readonly pickerService: IPickerService;\n readonly pluginService: IPluginService;\n readonly layerService: ILayerService;\n private readonly eventSystem?: EventSystem;\n\n protected _beforeRender?: (stage: IStage) => void;\n protected _afterRender?: (stage: IStage) => void;\n protected _skipRender?: number;\n protected _afterNextRenderCbs?: ((stage: IStage) => void)[];\n protected lastRenderparams?: Partial<IDrawContext>;\n\n protected interactiveLayer?: ILayer;\n protected supportInteractiveLayer: boolean;\n protected timeline: ITimeline;\n\n declare params: Partial<IStageParams>;\n\n /**\n * 所有属性都具有默认值。\n * Canvas为字符串或者Canvas元素,那么默认图层就会绑定到这个Canvas上\n * 如果不传入Canvas,那么会新建一个Canvas,用户可以通过Window模块管理这个Canvas\n * 1. 如果没有传入宽高,那么默认为canvas宽高,如果传入了宽高则stage使用传入宽高作为视口宽高\n * @param params\n */\n constructor(params: Partial<IStageParams>) {\n super({});\n this.params = params;\n this.theme = new Theme();\n this.hooks = {\n beforeRender: new SyncHook(['stage']),\n afterRender: new SyncHook(['stage'])\n };\n this.global = container.get<IGlobal>(VGlobal);\n this.window = container.get<IWindow>(VWindow);\n this.renderService = container.get<IRenderService>(RenderService);\n this.pickerService = container.get<IPickerService>(PickerService);\n this.pluginService = container.get<IPluginService>(PluginService);\n this.layerService = container.get<ILayerService>(LayerService);\n this.pluginService.active(this, params);\n\n this.window.create({\n width: params.width,\n height: params.height,\n container: params.container,\n dpr: params.dpr || this.global.devicePixelRatio,\n canvasControled: params.canvasControled !== false,\n title: params.title || '',\n canvas: params.canvas\n });\n\n this._viewBox = new AABBBounds();\n if (params.viewBox) {\n this._viewBox.setValue(params.viewBox.x1, params.viewBox.y1, params.viewBox.x2, params.viewBox.y2);\n } else {\n this._viewBox.setValue(0, 0, this.width, this.height);\n }\n\n this.renderCount = 0;\n\n // // 没有传入xy就默认为0\n // this._x = params.x ?? DefaultConfig.X;\n // this._y = params.y ?? DefaultConfig.Y;\n // // 没有传入view的宽高则默认为window的宽高\n // this._viewWidth = params.viewWidth ?? this.window.width;\n // this._viewHeight = params.viewHeight ?? this.window.height;\n this._subView = !(this._viewBox.width() === this.width && this._viewBox.height() === this.height);\n // this._AABBBounds.set(this._x, this._y, this._viewWidth + this._x, this._viewHeight + this._y);\n // 背景色默认为纯白色\n this._background = params.background ?? DefaultConfig.BACKGROUND;\n\n // 创建一个默认layer图层\n // this.appendChild(new Layer(this, this.global, this.window, { main: true }));\n this.appendChild(this.layerService.createLayer(this, { main: true }));\n\n this.nextFrameRenderLayerSet = new Set();\n this.willNextFrameRender = false;\n this.stage = this;\n this.renderStyle = params.renderStyle;\n\n if (this.global.supportEvent) {\n this.eventSystem = new EventSystem({\n targetElement: this.window,\n resolution: this.window.dpr || this.global.devicePixelRatio,\n rootNode: this as any,\n global: this.global,\n viewport: {\n viewBox: this._viewBox,\n get x(): number {\n return this.viewBox.x1;\n },\n get y(): number {\n return this.viewBox.y1;\n },\n get width(): number {\n return this.viewBox.width();\n },\n get height(): number {\n return this.viewBox.height();\n }\n }\n });\n }\n\n // this.autoRender = params.autoRender;\n if (params.autoRender) {\n this.enableAutoRender();\n }\n // 默认不开启dirtyBounds\n if (params.disableDirtyBounds === false) {\n this.enableDirtyBounds();\n }\n\n if (params.enableHtmlAttribute) {\n this.enableHtmlAttribute(params.enableHtmlAttribute);\n }\n\n params.enableLayout && this.enableLayout();\n this.hooks.beforeRender.tap('constructor', this.beforeRender);\n this.hooks.afterRender.tap('constructor', this.afterRender);\n this._beforeRender = params.beforeRender;\n this._afterRender = params.afterRender;\n this.ticker = params.ticker || defaultTicker;\n this.supportInteractiveLayer = params.interactiveLayer !== false;\n this.timeline = new DefaultTimeline();\n this.ticker.addTimeline(this.timeline);\n this.timeline.pause();\n this.optmize(params.optimize);\n }\n\n // 优化策略\n optmize(params?: IOptimizeType) {\n this.optmizeRender(params?.skipRenderWithOutRange);\n }\n\n // 优化渲染\n protected optmizeRender(skipRenderWithOutRange: boolean = true) {\n if (!skipRenderWithOutRange) {\n return;\n }\n // 不在视口内的时候,跳过渲染\n this._skipRender = this.window.isVisible() ? 0 : 1;\n this.window.onVisibleChange(visible => {\n if (visible) {\n if (this.dirtyBounds) {\n this.dirtyBounds.setValue(0, 0, this._viewBox.width(), this._viewBox.height());\n }\n if (this._skipRender > 1) {\n this.renderNextFrame();\n }\n this._skipRender = 0;\n } else {\n this._skipRender = 1;\n }\n });\n }\n\n getTimeline() {\n return this.timeline;\n }\n\n get3dOptions(options: IOption3D) {\n const {\n center = { x: this.width / 2, y: this.height / 2, z: 0, dx: 0, dy: 0, dz: 0 },\n light = {},\n alpha = 0,\n beta = 0,\n camera,\n fieldRatio = 1,\n fieldDepth\n } = options;\n\n return {\n ...options,\n center,\n light,\n alpha,\n beta,\n camera,\n fieldRatio,\n fieldDepth\n };\n }\n\n set3dOptions(options: IOption3D) {\n this.option3d = options;\n const options3d = this.get3dOptions(options);\n const { light, center, camera, alpha, beta, fieldRatio, fieldDepth } = options3d;\n const { dir = [1, 1, -1], color = 'white', ambient } = light;\n\n const centerX = (center.x ?? this.width / 2) + (center.dx ?? 0);\n const centerY = (center.y ?? this.height / 2) + (center.dy ?? 0);\n const centerZ = (center.z ?? 0) + (center.dz ?? 0);\n const centerVec3: vec3 = [centerX, centerY, centerZ];\n const z = 1;\n let cameraX = 0;\n let cameraY = 0;\n let cameraZ = 0;\n if (!camera) {\n cameraX = Math.sin(alpha) + centerX;\n cameraY = Math.sin(beta) + centerY;\n cameraZ = Math.cos(alpha) * Math.cos(beta) * z;\n }\n\n this.light = new DirectionalLight(dir, color, ambient);\n const cameraParams = {\n left: 0,\n right: this.width,\n top: 0,\n bottom: this.height,\n fieldRatio: fieldRatio,\n fieldDepth,\n viewParams: {\n pos: [cameraX, cameraY, cameraZ] as vec3,\n center: centerVec3,\n up: [0, 1, 0] as vec3\n }\n };\n if (this.camera) {\n this.camera.params = cameraParams;\n } else {\n this.camera = new OrthoCamera(cameraParams);\n }\n\n if (options.enableView3dTransform) {\n this.enableView3dTransform();\n }\n }\n\n protected beforeRender = (stage: IStage) => {\n this._beforeRender && this._beforeRender(stage);\n };\n\n protected afterRender = (stage: IStage) => {\n this.renderCount++;\n this._afterRender && this._afterRender(stage);\n this._afterNextRenderCbs && this._afterNextRenderCbs.forEach(cb => cb(stage));\n this._afterNextRenderCbs = null;\n };\n\n setBeforeRender(cb: (stage: IStage) => void) {\n this._beforeRender = cb;\n }\n\n setAfterRender(cb: (stage: IStage) => void) {\n this._afterRender = cb;\n }\n\n afterNextRender(cb: (stage: IStage) => void) {\n if (!this._afterNextRenderCbs) {\n this._afterNextRenderCbs = [];\n }\n this._afterNextRenderCbs.push(cb);\n }\n\n enableView3dTransform() {\n if (this.view3dTranform) {\n return;\n }\n this.view3dTranform = true;\n this.pluginService.register(new ViewTransform3dPlugin());\n }\n\n disableView3dTranform() {\n if (!this.view3dTranform) {\n return;\n }\n this.view3dTranform = false;\n this.pluginService.findPluginsByName('ViewTransform3dPlugin').forEach(plugin => {\n plugin.deactivate(this.pluginService);\n });\n }\n\n enableAutoRender() {\n if (this.autoRender) {\n return;\n }\n this.autoRender = true;\n this.pluginService.register(new AutoRenderPlugin());\n }\n disableAutoRender() {\n if (!this.autoRender) {\n return;\n }\n this.autoRender = false;\n this.pluginService.findPluginsByName('AutoRenderPlugin').forEach(plugin => {\n plugin.deactivate(this.pluginService);\n });\n }\n enableIncrementalAutoRender() {\n if (this.increaseAutoRender) {\n return;\n }\n this.increaseAutoRender = true;\n this.pluginService.register(new IncrementalAutoRenderPlugin());\n }\n disableIncrementalAutoRender() {\n if (!this.increaseAutoRender) {\n return;\n }\n this.increaseAutoRender = false;\n this.pluginService.findPluginsByName('IncrementalAutoRenderPlugin').forEach(plugin => {\n plugin.deactivate(this.pluginService);\n });\n }\n enableDirtyBounds() {\n if (this.dirtyBounds) {\n return;\n }\n this.dirtyBounds = new Bounds();\n let plugin = this.pluginService.findPluginsByName('DirtyBoundsPlugin')[0];\n if (!plugin) {\n plugin = new DirtyBoundsPlugin();\n this.pluginService.register(plugin);\n }\n plugin.activate(this.pluginService);\n }\n disableDirtyBounds() {\n if (!this.dirtyBounds) {\n return;\n }\n this.dirtyBounds = null;\n this.pluginService.findPluginsByName('DirtyBoundsPlugin').forEach(plugin => {\n plugin.deactivate(this.pluginService);\n });\n }\n enableLayout() {\n if (this._enableLayout) {\n return;\n }\n this._enableLayout = true;\n this.pluginService.register(new FlexLayoutPlugin());\n }\n disableLayout() {\n if (!this._enableLayout) {\n return;\n }\n this._enableLayout = false;\n this.pluginService.findPluginsByName('FlexLayoutPlugin').forEach(plugin => {\n plugin.deactivate(this.pluginService);\n });\n }\n enableHtmlAttribute(container?: any) {\n if (this.htmlAttribute) {\n return;\n }\n this.htmlAttribute = container;\n this.pluginService.register(new HtmlAttributePlugin());\n }\n disableHtmlAttribute() {\n if (!this.htmlAttribute) {\n return;\n }\n this.htmlAttribute = false;\n this.pluginService.findPluginsByName('HtmlAttributePlugin').forEach(plugin => {\n plugin.deactivate(this.pluginService);\n });\n }\n\n // /**\n // * stage的appendChild,add\n // * @param node\n // * @returns\n // */\n // appendChild<T extends Node>(node: T): T | null {\n // const layer = this.at(0);\n // if (!layer) {\n // return null;\n // }\n // return layer.appendChild<T>(node);\n // }\n\n protected tryUpdateAABBBounds(): AABBBounds {\n const viewBox = this._viewBox;\n this._AABBBounds.setValue(viewBox.x1, viewBox.y1, viewBox.x2, viewBox.y2);\n return this._AABBBounds;\n }\n\n combineLayer(ILayer1: ILayer, ILayer2: ILayer): ILayer {\n throw new Error('暂不支持');\n }\n // 如果传入CanvasId,如果存在相同Id,说明这两个图层使用相同的Canvas绘制\n // 但需要注意的是依然是两个图层(用于解决Table嵌入ChartSpace不影响Table的绘制)\n createLayer(canvasId?: string): ILayer {\n // 创建一个默认layer图层\n const layer = this.layerService.createLayer(this, {\n main: false,\n canvasId\n });\n this.appendChild(layer);\n return layer;\n // const layer = new Layer(this, this.global, this.window, {\n // main: false,\n // canvasId\n // });\n // this.appendChild(layer);\n // return layer;\n }\n sortLayer(cb: (ILayer1: ILayer, layer2: ILayer) => number): void {\n const children = this.children;\n children.sort(cb);\n this.removeAllChild();\n children.forEach(c => {\n this.appendChild(c);\n });\n }\n removeLayer(ILayerId: number): ILayer | false {\n return this.removeChild(this.findChildByUid(ILayerId) as IGraphic) as ILayer;\n }\n tryInitInteractiveLayer() {\n // TODO:顺序可能会存在问题\n // 支持交互层,且没有创建过,那就创建\n if (this.supportInteractiveLayer && !this.interactiveLayer) {\n this.interactiveLayer = this.createLayer();\n this.interactiveLayer.name = '_builtin_interactive';\n this.nextFrameRenderLayerSet.add(this.interactiveLayer as any); // to be fixed\n }\n // this.interactiveLayer.afterDraw(l => {\n // l.removeAllChild();\n // });\n }\n\n clearViewBox(color?: string) {\n this.window.clearViewBox(this._viewBox, color);\n }\n\n render(layers?: ILayer[], params?: Partial<IDrawContext>): void {\n this.ticker.start();\n this.timeline.resume();\n if (!this._skipRender) {\n this.lastRenderparams = params;\n this.hooks.beforeRender.call(this);\n (layers || this).forEach<ILayer>((layer, i) => {\n layer.render(\n {\n renderService: this.renderService,\n background: layer === this.defaultLayer ? this.background : undefined,\n updateBounds: !!this.dirtyBounds\n },\n { renderStyle: this.renderStyle, ...params }\n );\n });\n this.combineLayersToWindow();\n this.nextFrameRenderLayerSet.clear();\n this.hooks.afterRender.call(this);\n }\n this._skipRender && this._skipRender++;\n }\n\n protected combineLayersToWindow() {\n this.forEach<ILayer>((layer, i) => {\n layer.combineTo(this.window, {\n clear: i === 0,\n x: this.x,\n y: this.y,\n width: this.viewWidth,\n height: this.viewHeight,\n renderService: this.renderService,\n background: layer === this.defaultLayer ? this.background : undefined,\n updateBounds: !!this.dirtyBounds\n });\n });\n }\n\n renderNextFrame(layers?: ILayer[]): void {\n // 性能优化,避免重复add\n if (this.nextFrameRenderLayerSet.size !== this.childrenCount) {\n (layers || this).forEach<ILayer>((layer: any) => {\n this.nextFrameRenderLayerSet.add(layer);\n });\n }\n if (!this.willNextFrameRender) {\n this.willNextFrameRender = true;\n this.global.getRequestAnimationFrame()(() => {\n this._doRenderInThisFrame(), (this.willNextFrameRender = false);\n });\n }\n }\n\n _doRenderInThisFrame() {\n this.timeline.resume();\n this.ticker.start();\n if (this.nextFrameRenderLayerSet.size && !this._skipRender) {\n this.hooks.beforeRender.call(this);\n this.forEach((layer: Layer) => {\n if (this.nextFrameRenderLayerSet.has(layer)) {\n layer.render(\n {\n renderService: this.renderService,\n background: layer === this.defaultLayer ? this.background : undefined,\n updateBounds: !!this.dirtyBounds\n },\n { renderStyle: this.renderStyle, ...(this.lastRenderparams || {}) }\n );\n }\n });\n this.combineLayersToWindow();\n this.hooks.afterRender.call(this);\n this.nextFrameRenderLayerSet.clear();\n }\n this._skipRender && this._skipRender++;\n }\n\n resizeWindow(w: number, h: number, rerender: boolean = true) {\n this.window.resize(w, h);\n rerender && this.render();\n }\n\n /**\n * 语法糖,如果viewBox和window宽高一样的话,那么会同时缩放window和viewBox\n * @param w\n * @param h\n * @param rerender\n */\n resize(w: number, h: number, rerender: boolean = true): void {\n this.window.resize(w, h);\n this.forEachChildren<ILayer>(c => {\n c.resize(w, h);\n });\n // 如果不是子图的stage,那么认为用户也想要resize view\n if (!this._subView) {\n this.viewBox.setValue(this.viewBox.x1, this.viewBox.y1, this.viewBox.x1 + w, this.viewBox.y1 + h);\n }\n // 设置camera\n // this.camera && (this.camera.params = { ...this.camera.params, right: this.width, bottom: this.height });\n this.camera && this.option3d && this.set3dOptions(this.option3d);\n rerender && this.render();\n }\n resizeView(w: number, h: number, rerender: boolean = true) {\n this.viewBox.setValue(this.viewBox.x1, this.viewBox.y1, this.viewBox.x1 + w, this.viewBox.y1 + h);\n this.forEachChildren<ILayer>(c => {\n c.resizeView(w, h);\n });\n // 设置camera\n this.camera && (this.camera.params = { ...this.camera.params, right: this.width, bottom: this.height });\n rerender && this.render();\n }\n setViewBox(viewBox: IBoundsLike, rerender: boolean): void;\n setViewBox(x: number, y: number, w: number, h: number, rerender: boolean): void;\n setViewBox(x: number | IBoundsLike, y: number | boolean, w?: number, h?: number, rerender?: boolean): void {\n let isRerender: boolean = true;\n\n if (typeof x === 'object') {\n this.viewBox.setValue(x.x1, x.y1, x.x2, x.y2);\n if (y === false) {\n isRerender = false;\n }\n } else {\n this.viewBox.setValue(x, y as number, x + w, (y as number) + h);\n\n if (rerender === false) {\n isRerender = false;\n }\n }\n\n this.forEachChildren<ILayer>(c => {\n c.resizeView(this.viewBox.width(), this.viewBox.height());\n });\n isRerender && this.render();\n }\n setDpr(dpr: number, rerender: boolean = true): void {\n // this.window.setDpr(dpr);\n this.forEachChildren<ILayer>(c => {\n c.setDpr(dpr);\n });\n\n rerender && this.render();\n }\n setOrigin(x: number, y: number): void {\n throw new Error('暂不支持');\n }\n export(type: IExportType): HTMLCanvasElement | ImageData {\n throw new Error('暂不支持');\n }\n pick(x: number, y: number): { graphic: IGraphic | null; group: IGroup | null } | false {\n // 暂时不提供layer的pick\n const result = this.pickerService.pick(this.children as unknown as IGraphic[], new Point(x, y), {\n bounds: this.AABBBounds\n });\n if (result?.graphic || result?.group) {\n return result;\n }\n return false;\n }\n\n // 动画相关\n startAnimate(t: number): void {\n throw new Error('暂不支持');\n }\n setToFrame(t: number): void {\n throw new Error('暂不支持');\n }\n\n release() {\n super.release();\n this.eventSystem && this.eventSystem.release();\n this.pluginService.release();\n this.forEach(layer => {\n layer.release();\n });\n this.interactiveLayer && this.interactiveLayer.release();\n this.window.release();\n }\n\n setStage(stage?: IStage) {\n return;\n // this.stage = this;\n // this.forEachChildren(item => {\n // (item as Layer).setStage(this);\n // });\n }\n\n /**\n * 添加dirty区域,会修改参数b\n * @param b\n * @param matrix\n */\n dirty(b: IBounds, matrix?: IMatrix) {\n if (matrix) {\n b.transformWithMatrix(matrix);\n }\n if (this.dirtyBounds.empty()) {\n this.dirtyBounds.setValue(b.x1, b.y1, b.x2, b.y2);\n }\n this.dirtyBounds.union(b);\n }\n\n getLayer(name: string): undefined | ILayer {\n const layer = this.children.filter(layer => layer.name === name);\n return layer[0] as ILayer;\n }\n\n renderTo(window: IWindow, params: { x: number; y: number; width: number; height: number }) {\n this.forEachChildren<ILayer>((layer, i) => {\n layer.drawTo(window, {\n ...params,\n renderService: this.renderService,\n background: layer === this.defaultLayer ? this.background : undefined,\n clear: i === 0, // 第一个layer需要clear\n updateBounds: !!this.dirtyBounds\n });\n });\n }\n\n /**\n * 渲染到新的window上去\n * @param fullImage 是否是全量的image,因为可能之前的window有一部分场景树超过window的帧缓冲了\n * @returns\n */\n renderToNewWindow(fullImage: boolean = true, viewBox?: IAABBBounds): IWindow {\n const window = container.get<IWindow>(VWindow);\n if (fullImage) {\n window.create({\n width: this.viewWidth,\n height: this.viewHeight,\n dpr: this.window.dpr,\n canvasControled: true,\n offscreen: true,\n title: ''\n });\n } else {\n const width = viewBox ? viewBox.width() : Math.min(this.viewWidth, this.window.width - this.x);\n const height = viewBox ? viewBox.height() : Math.min(this.viewHeight, this.window.height - this.y);\n window.create({\n width,\n height,\n dpr: this.window.dpr,\n canvasControled: true,\n offscreen: true,\n title: ''\n });\n }\n\n const x = viewBox ? -viewBox.x1 : 0;\n const y = viewBox ? -viewBox.y1 : 0;\n this.renderTo(window, {\n x,\n y,\n width: viewBox ? viewBox.x2 : window.width,\n height: viewBox ? viewBox.y2 : window.height\n });\n return window;\n }\n\n toCanvas(fullImage: boolean = true, viewBox?: IAABBBounds): HTMLCanvasElement | null {\n const window = this.renderToNewWindow(fullImage, viewBox);\n const c = window.getNativeHandler();\n if (c.nativeCanvas) {\n return c.nativeCanvas;\n }\n return null;\n }\n\n setCursor(mode?: string): void {\n this._cursor = mode;\n this.eventSystem.setCursor(mode);\n }\n\n getCursor() {\n return this._cursor;\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/core/stage.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAyB7D,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAEnC,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,8CAA8C,CAAC;AAChF,OAAO,EAAE,qBAAqB,EAAE,MAAM,mDAAmD,CAAC;AAC1F,OAAO,EAAE,2BAA2B,EAAE,MAAM,0DAA0D,CAAC;AACvG,OAAO,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;AAClF,OAAO,EAAE,gBAAgB,EAAE,MAAM,8CAA8C,CAAC;AAChF,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,M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,EAAE,CAAC;QACpC,IAAI,CAAC,CAAC,YAAY,EAAE;YAClB,OAAO,CAAC,CAAC,YAAY,CAAC;SACvB;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,SAAS,CAAC,IAAa;QACrB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;QACpB,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;IACnC,CAAC;IAED,SAAS;QACP,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;CACF","file":"stage.js","sourcesContent":["import type { IBounds, IBoundsLike, IMatrix } from '@visactor/vutils';\nimport { AABBBounds, Bounds, Point } from '@visactor/vutils';\nimport type {\n IGraphic,\n IGroup,\n IExportType,\n IStage,\n IStageParams,\n ILayer,\n IColor,\n IGlobal,\n IOption3D,\n ICamera,\n vec3,\n IDirectionLight,\n ITicker,\n IRenderService,\n IPickerService,\n IPluginService,\n ISyncHook,\n IDrawContext,\n IWindow,\n IPlugin,\n IContributionProvider,\n ILayerService\n} from '../interface';\nimport { VWindow } from './window';\nimport type { Layer } from './layer';\nimport { EventSystem } from '../event';\nimport { container } from '../container';\nimport { RenderService } from '../render';\nimport { Group, Theme } from '../graphic';\nimport { PickerService } from '../picker/picker-service';\nimport { PluginService } from '../plugins/constants';\nimport { AutoRenderPlugin } from '../plugins/builtin-plugin/auto-render-plugin';\nimport { ViewTransform3dPlugin } from '../plugins/builtin-plugin/3dview-transform-plugin';\nimport { IncrementalAutoRenderPlugin } from '../plugins/builtin-plugin/incremental-auto-render-plugin';\nimport { DirtyBoundsPlugin } from '../plugins/builtin-plugin/dirty-bounds-plugin';\nimport { FlexLayoutPlugin } from '../plugins/builtin-plugin/flex-layout-plugin';\nimport { defaultTicker } from '../animate/default-ticker';\nimport { SyncHook } from '../tapable';\nimport { DirectionalLight } from './light';\nimport { OrthoCamera } from './camera';\nimport { VGlobal } from '../constants';\nimport { LayerService } from './constants';\n\nconst DefaultConfig = {\n WIDTH: 500,\n HEIGHT: 500,\n X: 0,\n Y: 0,\n BACKGROUND: 'white'\n};\n\n/**\n * Stage是一个舞台或一个视口,并不直接对应一个或多个Canvas,逻辑上和Canvas无关\n *\n * 1. Stage对应一个Canvas的整体,Stage的宽高即为Canvas的宽高\n * 2. Stage小于Canvas,Stage作为Canvas某个区域的视口,只管理这个区域\n * 3. 多图层时Stage的多个图层对应多个Canvas\n *\n * 原生环境下Stage可以拥有一个Window或者使用Window的一块区域\n *\n * 【注】如果希望获取完整的Canvas或窗口或者调整窗口信息,请使用Window模块\n */\nexport class Stage extends Group implements IStage {\n declare parent: IStage | null;\n\n // protected _x: number;\n // protected _y: number;\n // // 窗口的宽高\n // private _width: number;\n // private _height: number;\n // 视口的宽高\n // private _viewWidth: number;\n // private _viewHeight: number;\n protected _viewBox: AABBBounds;\n private _background: string | IColor;\n private _subView: boolean; // 是否是存在子视图\n protected nextFrameRenderLayerSet: Set<Layer>;\n protected willNextFrameRender: boolean;\n protected _cursor: string;\n renderCount: number;\n dirtyBounds: IBounds | null;\n option3d?: IOption3D;\n declare light?: IDirectionLight;\n declare camera?: ICamera;\n declare renderStyle?: string;\n\n declare hooks: {\n beforeRender: ISyncHook<[IStage]>;\n afterRender: ISyncHook<[IStage]>;\n };\n\n set viewBox(b: IBoundsLike) {\n this._viewBox.setValue(b.x1, b.y1, b.x2, b.y2);\n }\n get viewBox(): AABBBounds {\n return this._viewBox;\n }\n\n get x(): number {\n return this._viewBox.x1;\n }\n set x(x: number) {\n this._viewBox.translate(x - this._viewBox.x1, 0);\n }\n get y(): number {\n return this._viewBox.y1;\n }\n set y(y: number) {\n this._viewBox.translate(0, y - this._viewBox.y1);\n }\n get width(): number {\n return this.window.width;\n }\n set width(w: number) {\n this.resize(w, this.height);\n }\n get viewWidth(): number {\n return this._viewBox.width();\n }\n set viewWidth(w: number) {\n this.resizeView(w, this.viewHeight);\n }\n get viewHeight(): number {\n return this._viewBox.height();\n }\n set viewHeight(h: number) {\n this.resizeView(this.viewWidth, h);\n }\n get height(): number {\n return this.window.height;\n }\n set height(h: number) {\n this.resize(this.width, h);\n }\n get dpr(): number {\n return this.window.dpr;\n }\n set dpr(r: number) {\n this.setDpr(r);\n }\n get background(): string | IColor {\n return this._background ?? DefaultConfig.BACKGROUND;\n }\n set background(b: string | IColor) {\n this._background = b;\n }\n get defaultLayer(): ILayer {\n return this.at(0) as unknown as ILayer;\n }\n\n ticker: ITicker;\n\n autoRender: boolean;\n _enableLayout: boolean;\n increaseAutoRender: boolean;\n view3dTranform: boolean;\n readonly window: IWindow;\n private readonly global: IGlobal;\n readonly renderService: IRenderService;\n readonly pickerService: IPickerService;\n readonly pluginService: IPluginService;\n readonly layerService: ILayerService;\n private readonly eventSystem?: EventSystem;\n\n protected _beforeRender?: (stage: IStage) => void;\n protected _afterRender?: (stage: IStage) => void;\n protected _afterNextRenderCbs?: ((stage: IStage) => void)[];\n protected lastRenderparams?: Partial<IDrawContext>;\n\n protected interactiveLayer?: ILayer;\n protected supportInteractiveLayer: boolean;\n\n /**\n * 所有属性都具有默认值。\n * Canvas为字符串或者Canvas元素,那么默认图层就会绑定到这个Canvas上\n * 如果不传入Canvas,那么会新建一个Canvas,用户可以通过Window模块管理这个Canvas\n * 1. 如果没有传入宽高,那么默认为canvas宽高,如果传入了宽高则stage使用传入宽高作为视口宽高\n * @param params\n */\n constructor(params: Partial<IStageParams>) {\n super({});\n this.theme = new Theme();\n this.hooks = {\n beforeRender: new SyncHook(['stage']),\n afterRender: new SyncHook(['stage'])\n };\n this.global = container.get<IGlobal>(VGlobal);\n this.window = container.get<IWindow>(VWindow);\n this.renderService = container.get<IRenderService>(RenderService);\n this.pickerService = container.get<IPickerService>(PickerService);\n this.pluginService = container.get<IPluginService>(PluginService);\n this.layerService = container.get<ILayerService>(LayerService);\n this.pluginService.active(this, params);\n\n this.window.create({\n width: params.width,\n height: params.height,\n container: params.container,\n dpr: params.dpr || this.global.devicePixelRatio,\n canvasControled: params.canvasControled !== false,\n title: params.title || '',\n canvas: params.canvas\n });\n\n this._viewBox = new AABBBounds();\n if (params.viewBox) {\n this._viewBox.setValue(params.viewBox.x1, params.viewBox.y1, params.viewBox.x2, params.viewBox.y2);\n } else {\n this._viewBox.setValue(0, 0, this.width, this.height);\n }\n\n this.renderCount = 0;\n\n // // 没有传入xy就默认为0\n // this._x = params.x ?? DefaultConfig.X;\n // this._y = params.y ?? DefaultConfig.Y;\n // // 没有传入view的宽高则默认为window的宽高\n // this._viewWidth = params.viewWidth ?? this.window.width;\n // this._viewHeight = params.viewHeight ?? this.window.height;\n this._subView = !(this._viewBox.width() === this.width && this._viewBox.height() === this.height);\n // this._AABBBounds.set(this._x, this._y, this._viewWidth + this._x, this._viewHeight + this._y);\n // 背景色默认为纯白色\n this._background = params.background ?? DefaultConfig.BACKGROUND;\n\n // 创建一个默认layer图层\n // this.appendChild(new Layer(this, this.global, this.window, { main: true }));\n this.appendChild(this.layerService.createLayer(this, { main: true }));\n\n this.nextFrameRenderLayerSet = new Set();\n this.willNextFrameRender = false;\n this.stage = this;\n this.renderStyle = params.renderStyle;\n\n if (this.global.supportEvent) {\n this.eventSystem = new EventSystem({\n targetElement: this.window,\n resolution: this.window.dpr || this.global.devicePixelRatio,\n rootNode: this as any,\n global: this.global,\n viewport: {\n viewBox: this._viewBox,\n get x(): number {\n return this.viewBox.x1;\n },\n get y(): number {\n return this.viewBox.y1;\n },\n get width(): number {\n return this.viewBox.width();\n },\n get height(): number {\n return this.viewBox.height();\n }\n }\n });\n }\n\n // this.autoRender = params.autoRender;\n if (params.autoRender) {\n this.enableAutoRender();\n }\n // 默认不开启dirtyBounds\n if (params.disableDirtyBounds === false) {\n this.enableDirtyBounds();\n }\n\n params.enableLayout && this.enableLayout();\n this.hooks.beforeRender.tap('constructor', this.beforeRender);\n this.hooks.afterRender.tap('constructor', this.afterRender);\n this._beforeRender = params.beforeRender;\n this._afterRender = params.afterRender;\n this.ticker = params.ticker || defaultTicker;\n this.supportInteractiveLayer = params.interactiveLayer !== false;\n }\n\n get3dOptions(options: IOption3D) {\n const {\n center = { x: this.width / 2, y: this.height / 2, z: 0, dx: 0, dy: 0, dz: 0 },\n light = {},\n alpha = 0,\n beta = 0,\n camera,\n fieldRatio = 1,\n fieldDepth\n } = options;\n\n return {\n ...options,\n center,\n light,\n alpha,\n beta,\n camera,\n fieldRatio,\n fieldDepth\n };\n }\n\n set3dOptions(options: IOption3D) {\n this.option3d = options;\n const options3d = this.get3dOptions(options);\n const { light, center, camera, alpha, beta, fieldRatio, fieldDepth } = options3d;\n const { dir = [1, 1, -1], color = 'white', ambient } = light;\n\n const centerX = (center.x ?? this.width / 2) + (center.dx ?? 0);\n const centerY = (center.y ?? this.height / 2) + (center.dy ?? 0);\n const centerZ = (center.z ?? 0) + (center.dz ?? 0);\n const centerVec3: vec3 = [centerX, centerY, centerZ];\n const z = 1;\n let cameraX = 0;\n let cameraY = 0;\n let cameraZ = 0;\n if (!camera) {\n cameraX = Math.sin(alpha) + centerX;\n cameraY = Math.sin(beta) + centerY;\n cameraZ = Math.cos(alpha) * Math.cos(beta) * z;\n }\n\n this.light = new DirectionalLight(dir, color, ambient);\n const cameraParams = {\n left: 0,\n right: this.width,\n top: 0,\n bottom: this.height,\n fieldRatio: fieldRatio,\n fieldDepth,\n viewParams: {\n pos: [cameraX, cameraY, cameraZ] as vec3,\n center: centerVec3,\n up: [0, 1, 0] as vec3\n }\n };\n if (this.camera) {\n this.camera.params = cameraParams;\n } else {\n this.camera = new OrthoCamera(cameraParams);\n }\n\n if (options.enableView3dTransform) {\n this.enableView3dTransform();\n }\n }\n\n protected beforeRender = (stage: IStage) => {\n this._beforeRender && this._beforeRender(stage);\n };\n\n protected afterRender = (stage: IStage) => {\n this.renderCount++;\n this._afterRender && this._afterRender(stage);\n this._afterNextRenderCbs && this._afterNextRenderCbs.forEach(cb => cb(stage));\n this._afterNextRenderCbs = null;\n };\n\n setBeforeRender(cb: (stage: IStage) => void) {\n this._beforeRender = cb;\n }\n\n setAfterRender(cb: (stage: IStage) => void) {\n this._afterRender = cb;\n }\n\n afterNextRender(cb: (stage: IStage) => void) {\n if (!this._afterNextRenderCbs) {\n this._afterNextRenderCbs = [];\n }\n this._afterNextRenderCbs.push(cb);\n }\n\n enableView3dTransform() {\n if (this.view3dTranform) {\n return;\n }\n this.view3dTranform = true;\n this.pluginService.register(new ViewTransform3dPlugin());\n }\n\n disableView3dTranform() {\n if (!this.view3dTranform) {\n return;\n }\n this.view3dTranform = false;\n this.pluginService.findPluginsByName('ViewTransform3dPlugin').forEach(plugin => {\n plugin.deactivate(this.pluginService);\n });\n }\n\n enableAutoRender() {\n if (this.autoRender) {\n return;\n }\n this.autoRender = true;\n this.pluginService.register(new AutoRenderPlugin());\n }\n disableAutoRender() {\n if (!this.autoRender) {\n return;\n }\n this.autoRender = false;\n this.pluginService.findPluginsByName('AutoRenderPlugin').forEach(plugin => {\n plugin.deactivate(this.pluginService);\n });\n }\n enableIncrementalAutoRender() {\n if (this.increaseAutoRender) {\n return;\n }\n this.increaseAutoRender = true;\n this.pluginService.register(new IncrementalAutoRenderPlugin());\n }\n disableIncrementalAutoRender() {\n if (!this.increaseAutoRender) {\n return;\n }\n this.increaseAutoRender = false;\n this.pluginService.findPluginsByName('IncrementalAutoRenderPlugin').forEach(plugin => {\n plugin.deactivate(this.pluginService);\n });\n }\n enableDirtyBounds() {\n if (this.dirtyBounds) {\n return;\n }\n this.dirtyBounds = new Bounds();\n let plugin = this.pluginService.findPluginsByName('DirtyBoundsPlugin')[0];\n if (!plugin) {\n plugin = new DirtyBoundsPlugin();\n this.pluginService.register(plugin);\n }\n plugin.activate(this.pluginService);\n }\n disableDirtyBounds() {\n if (!this.dirtyBounds) {\n return;\n }\n this.dirtyBounds = null;\n this.pluginService.findPluginsByName('DirtyBoundsPlugin').forEach(plugin => {\n plugin.deactivate(this.pluginService);\n });\n }\n enableLayout() {\n if (this._enableLayout) {\n return;\n }\n this._enableLayout = true;\n this.pluginService.register(new FlexLayoutPlugin());\n }\n disableLayout() {\n if (!this._enableLayout) {\n return;\n }\n this._enableLayout = false;\n this.pluginService.findPluginsByName('FlexLayoutPlugin').forEach(plugin => {\n plugin.deactivate(this.pluginService);\n });\n }\n\n // /**\n // * stage的appendChild,add\n // * @param node\n // * @returns\n // */\n // appendChild<T extends Node>(node: T): T | null {\n // const layer = this.at(0);\n // if (!layer) {\n // return null;\n // }\n // return layer.appendChild<T>(node);\n // }\n\n protected tryUpdateAABBBounds(): AABBBounds {\n const viewBox = this._viewBox;\n this._AABBBounds.setValue(viewBox.x1, viewBox.y1, viewBox.x2, viewBox.y2);\n return this._AABBBounds;\n }\n\n combineLayer(ILayer1: ILayer, ILayer2: ILayer): ILayer {\n throw new Error('暂不支持');\n }\n // 如果传入CanvasId,如果存在相同Id,说明这两个图层使用相同的Canvas绘制\n // 但需要注意的是依然是两个图层(用于解决Table嵌入ChartSpace不影响Table的绘制)\n createLayer(canvasId?: string): ILayer {\n // 创建一个默认layer图层\n const layer = this.layerService.createLayer(this, {\n main: false,\n canvasId\n });\n this.appendChild(layer);\n return layer;\n // const layer = new Layer(this, this.global, this.window, {\n // main: false,\n // canvasId\n // });\n // this.appendChild(layer);\n // return layer;\n }\n sortLayer(cb: (ILayer1: ILayer, layer2: ILayer) => number): void {\n const children = this.children;\n children.sort(cb);\n this.removeAllChild();\n children.forEach(c => {\n this.appendChild(c);\n });\n }\n removeLayer(ILayerId: number): ILayer | false {\n return this.removeChild(this.findChildByUid(ILayerId) as IGraphic) as ILayer;\n }\n tryInitInteractiveLayer() {\n // TODO:顺序可能会存在问题\n // 支持交互层,且没有创建过,那就创建\n if (this.supportInteractiveLayer && !this.interactiveLayer) {\n this.interactiveLayer = this.createLayer();\n this.interactiveLayer.name = '_builtin_interactive';\n }\n // this.interactiveLayer.afterDraw(l => {\n // l.removeAllChild();\n // });\n }\n\n clearViewBox(color?: string) {\n this.window.clearViewBox(this._viewBox, color);\n }\n\n render(layers?: ILayer[], params?: Partial<IDrawContext>): void {\n this.ticker.start();\n this.lastRenderparams = params;\n this.hooks.beforeRender.call(this);\n (layers || this).forEach<ILayer>((layer, i) => {\n layer.render(\n {\n renderService: this.renderService,\n background: layer === this.defaultLayer ? this.background : undefined,\n updateBounds: !!this.dirtyBounds\n },\n { renderStyle: this.renderStyle, ...params }\n );\n });\n this.combineLayersToWindow();\n this.nextFrameRenderLayerSet.clear();\n this.hooks.afterRender.call(this);\n }\n\n protected combineLayersToWindow() {\n this.forEach<ILayer>((layer, i) => {\n layer.combineTo(this.window, {\n clear: i === 0,\n x: this.x,\n y: this.y,\n width: this.viewWidth,\n height: this.viewHeight,\n renderService: this.renderService,\n background: layer === this.defaultLayer ? this.background : undefined,\n updateBounds: !!this.dirtyBounds\n });\n });\n }\n\n renderNextFrame(layers?: ILayer[]): void {\n // 性能优化,避免重复add\n if (this.nextFrameRenderLayerSet.size !== this.childrenCount) {\n (layers || this).forEach<ILayer>((layer: any) => {\n this.nextFrameRenderLayerSet.add(layer);\n });\n }\n if (!this.willNextFrameRender) {\n this.willNextFrameRender = true;\n this.global.getRequestAnimationFrame()(() => {\n this._doRenderInThisFrame(), (this.willNextFrameRender = false);\n });\n }\n }\n\n _doRenderInThisFrame() {\n if (this.nextFrameRenderLayerSet.size) {\n this.ticker.start();\n this.hooks.beforeRender.call(this);\n this.forEach((layer: Layer) => {\n if (this.nextFrameRenderLayerSet.has(layer)) {\n layer.render(\n {\n renderService: this.renderService,\n background: layer === this.defaultLayer ? this.background : undefined,\n updateBounds: !!this.dirtyBounds\n },\n { renderStyle: this.renderStyle, ...(this.lastRenderparams || {}) }\n );\n }\n });\n this.combineLayersToWindow();\n this.hooks.afterRender.call(this);\n this.nextFrameRenderLayerSet.clear();\n }\n }\n\n resizeWindow(w: number, h: number, rerender: boolean = true) {\n this.window.resize(w, h);\n rerender && this.render();\n }\n\n /**\n * 语法糖,如果viewBox和window宽高一样的话,那么会同时缩放window和viewBox\n * @param w\n * @param h\n * @param rerender\n */\n resize(w: number, h: number, rerender: boolean = true): void {\n this.window.resize(w, h);\n this.forEachChildren<ILayer>(c => {\n c.resize(w, h);\n });\n // 如果不是子图的stage,那么认为用户也想要resize view\n if (!this._subView) {\n this.viewBox.setValue(this.viewBox.x1, this.viewBox.y1, this.viewBox.x1 + w, this.viewBox.y1 + h);\n }\n // 设置camera\n // this.camera && (this.camera.params = { ...this.camera.params, right: this.width, bottom: this.height });\n this.camera && this.option3d && this.set3dOptions(this.option3d);\n rerender && this.render();\n }\n resizeView(w: number, h: number, rerender: boolean = true) {\n this.viewBox.setValue(this.viewBox.x1, this.viewBox.y1, this.viewBox.x1 + w, this.viewBox.y1 + h);\n this.forEachChildren<ILayer>(c => {\n c.resizeView(w, h);\n });\n // 设置camera\n this.camera && (this.camera.params = { ...this.camera.params, right: this.width, bottom: this.height });\n rerender && this.render();\n }\n setViewBox(viewBox: IBoundsLike, rerender: boolean): void;\n setViewBox(x: number, y: number, w: number, h: number, rerender: boolean): void;\n setViewBox(x: number | IBoundsLike, y: number | boolean, w?: number, h?: number, rerender?: boolean): void {\n let isRerender: boolean = true;\n\n if (typeof x === 'object') {\n this.viewBox.setValue(x.x1, x.y1, x.x2, x.y2);\n if (y === false) {\n isRerender = false;\n }\n } else {\n this.viewBox.setValue(x, y as number, x + w, (y as number) + h);\n\n if (rerender === false) {\n isRerender = false;\n }\n }\n\n this.forEachChildren<ILayer>(c => {\n c.resizeView(this.viewBox.width(), this.viewBox.height());\n });\n isRerender && this.render();\n }\n setDpr(dpr: number, rerender: boolean = true): void {\n // this.window.setDpr(dpr);\n this.forEachChildren<ILayer>(c => {\n c.setDpr(dpr);\n });\n\n rerender && this.render();\n }\n setOrigin(x: number, y: number): void {\n throw new Error('暂不支持');\n }\n export(type: IExportType): HTMLCanvasElement | ImageData {\n throw new Error('暂不支持');\n }\n pick(x: number, y: number): { graphic: IGraphic | null; group: IGroup | null } | false {\n // 暂时不提供layer的pick\n const result = this.pickerService.pick(this.children as unknown as IGraphic[], new Point(x, y), {\n bounds: this.AABBBounds\n });\n if (result?.graphic || result?.group) {\n return result;\n }\n return false;\n }\n\n // 动画相关\n startAnimate(t: number): void {\n throw new Error('暂不支持');\n }\n setToFrame(t: number): void {\n throw new Error('暂不支持');\n }\n\n release() {\n super.release();\n this.eventSystem && this.eventSystem.release();\n this.pluginService.release();\n this.forEach(layer => {\n layer.release();\n });\n this.interactiveLayer && this.interactiveLayer.release();\n this.window.release();\n }\n\n setStage(stage?: IStage) {\n return;\n // this.stage = this;\n // this.forEachChildren(item => {\n // (item as Layer).setStage(this);\n // });\n }\n\n /**\n * 添加dirty区域,会修改参数b\n * @param b\n * @param matrix\n */\n dirty(b: IBounds, matrix?: IMatrix) {\n if (matrix) {\n b.transformWithMatrix(matrix);\n }\n if (this.dirtyBounds.empty()) {\n this.dirtyBounds.setValue(b.x1, b.y1, b.x2, b.y2);\n }\n this.dirtyBounds.union(b);\n }\n\n getLayer(name: string): undefined | ILayer {\n const layer = this.children.filter(layer => layer.name === name);\n return layer[0] as ILayer;\n }\n\n renderTo(window: IWindow, params: { x: number; y: number; width: number; height: number }) {\n this.forEachChildren<ILayer>((layer, i) => {\n layer.drawTo(window, {\n ...params,\n renderService: this.renderService,\n background: layer === this.defaultLayer ? this.background : undefined,\n clear: i === 0, // 第一个layer需要clear\n updateBounds: !!this.dirtyBounds\n });\n });\n }\n\n /**\n * 渲染到新的window上去\n * @param fullImage 是否是全量的image,因为可能之前的window有一部分场景树超过window的帧缓冲了\n * @returns\n */\n renderToNewWindow(fullImage: boolean = true): IWindow {\n const window = container.get<IWindow>(VWindow);\n if (fullImage) {\n window.create({\n width: this.viewWidth,\n height: this.viewHeight,\n dpr: this.window.dpr,\n canvasControled: true,\n offscreen: true,\n title: ''\n });\n } else {\n window.create({\n width: Math.min(this.viewWidth, this.window.width - this.x),\n height: Math.min(this.viewHeight, this.window.height - this.y),\n dpr: this.window.dpr,\n canvasControled: true,\n offscreen: true,\n title: ''\n });\n }\n\n this.renderTo(window, {\n x: 0,\n y: 0,\n width: window.width,\n height: window.height\n });\n return window;\n }\n\n toCanvas(fullImage: boolean = true): HTMLCanvasElement | null {\n const window = this.renderToNewWindow(fullImage);\n const c = window.getNativeHandler();\n if (c.nativeCanvas) {\n return c.nativeCanvas;\n }\n return null;\n }\n\n setCursor(mode?: string): void {\n this._cursor = mode;\n this.eventSystem.setCursor(mode);\n }\n\n getCursor() {\n return this._cursor;\n }\n}\n"]}
@@ -45,10 +45,4 @@ export declare class DefaultWindow implements IWindow {
45
45
  getBoundingClientRect(): IDomRectLike;
46
46
  getContainer(): HTMLElement | any;
47
47
  clearViewBox(viewBox: IBoundsLike, color?: string): void;
48
- isVisible(bbox?: IBoundsLike): boolean;
49
- onVisibleChange(cb: (currentVisible: boolean) => void): void;
50
- getTopLeft(baseWindow?: boolean): {
51
- top: number;
52
- left: number;
53
- };
54
48
  }
package/es/core/window.js CHANGED
@@ -56,7 +56,7 @@ let DefaultWindow = class {
56
56
  const global = this.global;
57
57
  if (!global.env || this.actived) return;
58
58
  container.getNamed(WindowHandlerContribution, global.env).configure(this, global),
59
- this.actived = !0, this._handler;
59
+ this.actived = !0;
60
60
  }
61
61
  get style() {
62
62
  return this._handler.getStyle();
@@ -112,15 +112,6 @@ let DefaultWindow = class {
112
112
  clearViewBox(viewBox, color) {
113
113
  this._handler.clearViewBox(viewBox, color);
114
114
  }
115
- isVisible(bbox) {
116
- return this._handler.isVisible(bbox);
117
- }
118
- onVisibleChange(cb) {
119
- return this._handler.onVisibleChange(cb);
120
- }
121
- getTopLeft(baseWindow) {
122
- return this._handler.getTopLeft(baseWindow);
123
- }
124
115
  };
125
116
 
126
117
  __decorate([ postConstruct(), __metadata("design:type", Function), __metadata("design:paramtypes", []), __metadata("design:returntype", void 0) ], DefaultWindow.prototype, "postInit", null),
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/core/window.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;A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Q,CAAC,qBAAqB,EAAE,CAAC;IAC/C,CAAC;IAED,YAAY;QACV,OAAO,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC;IACjC,CAAC;IAED,YAAY,CAAC,OAAoB,EAAE,KAAc;QAC/C,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;IAC7C,CAAC;IAED,SAAS,CAAC,IAAkB;QAC1B,OAAO,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;IACvC,CAAC;IAED,eAAe,CAAC,EAAqC;QACnD,OAAO,IAAI,CAAC,QAAQ,CAAC,eAAe,CAAC,EAAE,CAAC,CAAC;IAC3C,CAAC;IAED,UAAU,CAAC,UAAoB;QAC7B,OAAO,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;IAC9C,CAAC;CACF,CAAA;AAhIC;IAAC,aAAa,EAAE;;;;6CAMf;AA7DU,aAAa;IADzB,UAAU,EAAE;IAmDR,WAAA,MAAM,CAAC,OAAO,CAAC,CAAA;;GAlDP,aAAa,CAuLzB;SAvLY,aAAa","file":"window.js","sourcesContent":["import { inject, injectable, postConstruct } from 'inversify';\nimport type { IBoundsLike } from '@visactor/vutils';\nimport { Generator } from '../common/generator';\nimport type {\n ICanvas,\n IContext2d,\n IDomRectLike,\n IGlobal,\n IWindow,\n IWindowHandlerContribution,\n IWindowParams\n} from '../interface';\nimport { container } from '../container';\nimport { SyncHook } from '../tapable';\nimport { VGlobal } from '../constants';\n\nexport const VWindow = Symbol.for('VWindow');\n\nexport const WindowHandlerContribution = Symbol.for('WindowHandlerContribution');\n\n/**\n * 窗口\n * 对于浏览器,就是管理某个Stage影响的Canvas\n * 对于原生,就是管理这个系统窗口\n */\n@injectable()\nexport class DefaultWindow implements IWindow {\n protected _width: number;\n protected _height: number;\n protected _handler: IWindowHandlerContribution;\n\n hooks = {\n onChange: new SyncHook<[number, number, number, number]>(['x', 'y', 'width', 'height'])\n };\n\n // 父窗口(容器),对于浏览器来说就是container dom\n declare parent: Window;\n // 窗口的大小\n get width(): number {\n if (this._handler) {\n const wh = this._handler.getWH();\n return (this._width = wh.width);\n }\n return this._width;\n }\n get height(): number {\n if (this._handler) {\n const wh = this._handler.getWH();\n return (this._height = wh.height);\n }\n return this._height;\n }\n // 窗口的位置\n // declare x: number;\n // declare y: number;\n declare _uid: number;\n // 窗口操作配置\n declare resizable: boolean;\n declare minHeight: number;\n declare minWidth: number;\n declare maxHeight: number;\n declare maxWidth: number;\n // 窗口配置\n declare title: string;\n\n /* 浏览器环境配置 */\n // 这是主体canvas,对于单图层来说就是绘图canvas\n // 对于多图层画布来说,就是用户传入的或者默认的一个canvas\n declare mainCanvas: ICanvas;\n declare layerCanvas: ICanvas[];\n declare actived: boolean;\n get dpr(): number {\n return this._handler.getDpr();\n }\n\n constructor(\n @inject(VGlobal) public readonly global: IGlobal // @inject(ContributionProvider) // @named(WindowHandlerContribution) // protected readonly contributions: ContributionProvider<IWindowHandlerContribution>\n ) {\n this._uid = Generator.GenAutoIncrementId();\n }\n\n @postConstruct()\n protected postInit() {\n this.global.hooks.onSetEnv.tap('window', () => {\n this.active();\n });\n this.active();\n }\n\n protected active() {\n const global = this.global;\n if (!global.env || this.actived) {\n return;\n }\n const handler = container.getNamed<IWindowHandlerContribution>(WindowHandlerContribution, global.env);\n handler.configure(this, global);\n // this.contributions.getContributions().forEach((handlerContribution) => {\n // handlerContribution.configure(this, this.global);\n // });\n this.actived = true;\n this._handler;\n }\n\n get style(): CSSStyleDeclaration | Record<string, any> {\n return this._handler.getStyle();\n }\n\n set style(style: CSSStyleDeclaration | Record<string, any>) {\n this._handler.setStyle(style);\n }\n\n create(params: IWindowParams): void {\n // 通过handler创建窗口\n this._handler.createWindow(params);\n\n // 使用window的wh\n const windowWH = this._handler.getWH();\n this._width = windowWH.width;\n this._height = windowWH.height;\n // 使用window的xy\n // const windowXY = this._handler.getXY();\n // this.x = windowXY.x;\n // this.y = windowXY.y;\n // 使用window的title\n this.title = this._handler.getTitle();\n this.resizable = true;\n }\n\n setWindowHandler(handler: IWindowHandlerContribution) {\n this._handler = handler;\n }\n\n setDpr(dpr: number): void {\n return this._handler.setDpr(dpr);\n }\n resize(w: number, h: number): void {\n return this._handler.resizeWindow(w, h);\n }\n configure(): void {\n throw new Error('暂不支持');\n }\n release(): void {\n return this._handler.releaseWindow();\n }\n getContext(): IContext2d {\n return this._handler.getContext();\n }\n getNativeHandler(): ICanvas {\n return this._handler.getNativeHandler();\n }\n getImageBuffer(type?: string): any {\n if (!this._handler.getImageBuffer) {\n return null;\n }\n return this._handler.getImageBuffer(type);\n }\n\n addEventListener<K extends keyof DocumentEventMap>(\n type: K,\n listener: (this: Document, ev: DocumentEventMap[K]) => any,\n options?: boolean | AddEventListenerOptions\n ): void;\n addEventListener(\n type: string,\n listener: EventListenerOrEventListenerObject,\n options?: boolean | AddEventListenerOptions\n ): void {\n return this._handler.addEventListener(type, listener, options);\n }\n removeEventListener<K extends keyof DocumentEventMap>(\n type: K,\n listener: (this: Document, ev: DocumentEventMap[K]) => any,\n options?: boolean | EventListenerOptions\n ): void;\n removeEventListener(\n type: string,\n listener: EventListenerOrEventListenerObject,\n options?: boolean | EventListenerOptions\n ): void {\n return this._handler.removeEventListener(type, listener, options);\n }\n\n dispatchEvent(event: any): boolean {\n return this._handler.dispatchEvent(event);\n }\n\n getBoundingClientRect(): IDomRectLike {\n return this._handler.getBoundingClientRect();\n }\n\n getContainer(): HTMLElement | any {\n return this._handler.container;\n }\n\n clearViewBox(viewBox: IBoundsLike, color?: string) {\n this._handler.clearViewBox(viewBox, color);\n }\n\n isVisible(bbox?: IBoundsLike): boolean {\n return this._handler.isVisible(bbox);\n }\n\n onVisibleChange(cb: (currentVisible: boolean) => void) {\n return this._handler.onVisibleChange(cb);\n }\n\n getTopLeft(baseWindow?: boolean): { top: number; left: number } {\n return this._handler.getTopLeft(baseWindow);\n }\n}\n"]}
1
+ {"version":3,"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C,aAAa,CAAC,KAAK,CAAC,CAAC;IAC5C,CAAC;IAED,qBAAqB;QACnB,OAAO,IAAI,CAAC,QAAQ,CAAC,qBAAqB,EAAE,CAAC;IAC/C,CAAC;IAED,YAAY;QACV,OAAO,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC;IACjC,CAAC;IAED,YAAY,CAAC,OAAoB,EAAE,KAAc;QAC/C,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;IAC7C,CAAC;CACF,CAAA;AAnHC;IAAC,aAAa,EAAE;;;;6CAMf;AA7DU,aAAa;IADzB,UAAU,EAAE;IAmDR,WAAA,MAAM,CAAC,OAAO,CAAC,CAAA;;GAlDP,aAAa,CA0KzB;SA1KY,aAAa","file":"window.js","sourcesContent":["import { inject, injectable, postConstruct } from 'inversify';\nimport type { IBoundsLike } from '@visactor/vutils';\nimport { Generator } from '../common/generator';\nimport type {\n ICanvas,\n IContext2d,\n IDomRectLike,\n IGlobal,\n IWindow,\n IWindowHandlerContribution,\n IWindowParams\n} from '../interface';\nimport { container } from '../container';\nimport { SyncHook } from '../tapable';\nimport { VGlobal } from '../constants';\n\nexport const VWindow = Symbol.for('VWindow');\n\nexport const WindowHandlerContribution = Symbol.for('WindowHandlerContribution');\n\n/**\n * 窗口\n * 对于浏览器,就是管理某个Stage影响的Canvas\n * 对于原生,就是管理这个系统窗口\n */\n@injectable()\nexport class DefaultWindow implements IWindow {\n protected _width: number;\n protected _height: number;\n protected _handler: IWindowHandlerContribution;\n\n hooks = {\n onChange: new SyncHook<[number, number, number, number]>(['x', 'y', 'width', 'height'])\n };\n\n // 父窗口(容器),对于浏览器来说就是container dom\n declare parent: Window;\n // 窗口的大小\n get width(): number {\n if (this._handler) {\n const wh = this._handler.getWH();\n return (this._width = wh.width);\n }\n return this._width;\n }\n get height(): number {\n if (this._handler) {\n const wh = this._handler.getWH();\n return (this._height = wh.height);\n }\n return this._height;\n }\n // 窗口的位置\n // declare x: number;\n // declare y: number;\n declare _uid: number;\n // 窗口操作配置\n declare resizable: boolean;\n declare minHeight: number;\n declare minWidth: number;\n declare maxHeight: number;\n declare maxWidth: number;\n // 窗口配置\n declare title: string;\n\n /* 浏览器环境配置 */\n // 这是主体canvas,对于单图层来说就是绘图canvas\n // 对于多图层画布来说,就是用户传入的或者默认的一个canvas\n declare mainCanvas: ICanvas;\n declare layerCanvas: ICanvas[];\n declare actived: boolean;\n get dpr(): number {\n return this._handler.getDpr();\n }\n\n constructor(\n @inject(VGlobal) public readonly global: IGlobal // @inject(ContributionProvider) // @named(WindowHandlerContribution) // protected readonly contributions: ContributionProvider<IWindowHandlerContribution>\n ) {\n this._uid = Generator.GenAutoIncrementId();\n }\n\n @postConstruct()\n protected postInit() {\n this.global.hooks.onSetEnv.tap('window', () => {\n this.active();\n });\n this.active();\n }\n\n protected active() {\n const global = this.global;\n if (!global.env || this.actived) {\n return;\n }\n const handler = container.getNamed<IWindowHandlerContribution>(WindowHandlerContribution, global.env);\n handler.configure(this, global);\n // this.contributions.getContributions().forEach((handlerContribution) => {\n // handlerContribution.configure(this, this.global);\n // });\n this.actived = true;\n }\n\n get style(): CSSStyleDeclaration | Record<string, any> {\n return this._handler.getStyle();\n }\n\n set style(style: CSSStyleDeclaration | Record<string, any>) {\n this._handler.setStyle(style);\n }\n\n create(params: IWindowParams): void {\n // 通过handler创建窗口\n this._handler.createWindow(params);\n\n // 使用window的wh\n const windowWH = this._handler.getWH();\n this._width = windowWH.width;\n this._height = windowWH.height;\n // 使用window的xy\n // const windowXY = this._handler.getXY();\n // this.x = windowXY.x;\n // this.y = windowXY.y;\n // 使用window的title\n this.title = this._handler.getTitle();\n this.resizable = true;\n }\n\n setWindowHandler(handler: IWindowHandlerContribution) {\n this._handler = handler;\n }\n\n setDpr(dpr: number): void {\n return this._handler.setDpr(dpr);\n }\n resize(w: number, h: number): void {\n return this._handler.resizeWindow(w, h);\n }\n configure(): void {\n throw new Error('暂不支持');\n }\n release(): void {\n return this._handler.releaseWindow();\n }\n getContext(): IContext2d {\n return this._handler.getContext();\n }\n getNativeHandler(): ICanvas {\n return this._handler.getNativeHandler();\n }\n getImageBuffer(type?: string): any {\n if (!this._handler.getImageBuffer) {\n return null;\n }\n return this._handler.getImageBuffer(type);\n }\n\n addEventListener<K extends keyof DocumentEventMap>(\n type: K,\n listener: (this: Document, ev: DocumentEventMap[K]) => any,\n options?: boolean | AddEventListenerOptions\n ): void;\n addEventListener(\n type: string,\n listener: EventListenerOrEventListenerObject,\n options?: boolean | AddEventListenerOptions\n ): void {\n return this._handler.addEventListener(type, listener, options);\n }\n removeEventListener<K extends keyof DocumentEventMap>(\n type: K,\n listener: (this: Document, ev: DocumentEventMap[K]) => any,\n options?: boolean | EventListenerOptions\n ): void;\n removeEventListener(\n type: string,\n listener: EventListenerOrEventListenerObject,\n options?: boolean | EventListenerOptions\n ): void {\n return this._handler.removeEventListener(type, listener, options);\n }\n\n dispatchEvent(event: any): boolean {\n return this._handler.dispatchEvent(event);\n }\n\n getBoundingClientRect(): IDomRectLike {\n return this._handler.getBoundingClientRect();\n }\n\n getContainer(): HTMLElement | any {\n return this._handler.container;\n }\n\n clearViewBox(viewBox: IBoundsLike, color?: string) {\n this._handler.clearViewBox(viewBox, color);\n }\n}\n"]}
@@ -6,7 +6,7 @@ export function arrow2Left(ctx, r, transX, transY) {
6
6
 
7
7
  export class Arrow2LeftSymbol {
8
8
  constructor() {
9
- this.type = "arrow2Left", this.pathStr = "M 0.25 -0.5 L -0.25 0 l 0.25 0.5";
9
+ this.type = "arrow2Left", this.pathStr = "M 0.25 -0.5 L -0.25 0 l 0.5 0.5";
10
10
  }
11
11
  draw(ctx, size, transX, transY) {
12
12
  return arrow2Left(ctx, size / 4, transX, transY);