@visactor/vrender-core 1.0.0-alpha.5 → 1.0.0-alpha.7

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 (284) hide show
  1. package/cjs/animate/config.d.ts +0 -1
  2. package/cjs/animate/config.js +1 -5
  3. package/cjs/animate/config.js.map +1 -1
  4. package/cjs/application.d.ts +2 -1
  5. package/cjs/application.js.map +1 -1
  6. package/cjs/color-string/interpolate.js +5 -2
  7. package/cjs/color-string/interpolate.js.map +1 -1
  8. package/cjs/common/canvas-utils.js +6 -3
  9. package/cjs/common/canvas-utils.js.map +1 -1
  10. package/cjs/common/custom-path2d.js +2 -2
  11. package/cjs/common/custom-path2d.js.map +1 -1
  12. package/cjs/common/morphing-utils.js +32 -124
  13. package/cjs/common/morphing-utils.js.map +1 -1
  14. package/cjs/common/segment/index.js +3 -0
  15. package/cjs/common/segment/index.js.map +1 -1
  16. package/cjs/common/segment/step.d.ts +6 -0
  17. package/cjs/common/segment/step.js +19 -2
  18. package/cjs/common/segment/step.js.map +1 -1
  19. package/cjs/common/shape/arc.d.ts +1 -1
  20. package/cjs/common/shape/arc.js +7 -3
  21. package/cjs/common/shape/arc.js.map +1 -1
  22. package/cjs/common/split-path.js +1 -1
  23. package/cjs/common/split-path.js.map +1 -1
  24. package/cjs/common/utils.d.ts +0 -2
  25. package/cjs/common/utils.js +4 -8
  26. package/cjs/common/utils.js.map +1 -1
  27. package/cjs/core/stage.d.ts +2 -1
  28. package/cjs/core/stage.js +4 -3
  29. package/cjs/core/stage.js.map +1 -1
  30. package/cjs/graphic/arc.d.ts +1 -2
  31. package/cjs/graphic/arc.js +4 -3
  32. package/cjs/graphic/arc.js.map +1 -1
  33. package/cjs/graphic/area.d.ts +1 -2
  34. package/cjs/graphic/area.js +5 -2
  35. package/cjs/graphic/area.js.map +1 -1
  36. package/cjs/graphic/circle.d.ts +1 -2
  37. package/cjs/graphic/circle.js +7 -3
  38. package/cjs/graphic/circle.js.map +1 -1
  39. package/cjs/graphic/config.d.ts +2 -1
  40. package/cjs/graphic/config.js +10 -3
  41. package/cjs/graphic/config.js.map +1 -1
  42. package/cjs/graphic/constants.d.ts +1 -0
  43. package/cjs/graphic/constants.js +4 -3
  44. package/cjs/graphic/constants.js.map +1 -1
  45. package/cjs/graphic/graphic-service/graphic-module.js +1 -2
  46. package/cjs/graphic/graphic-service/graphic-module.js.map +1 -1
  47. package/cjs/graphic/graphic.d.ts +7 -1
  48. package/cjs/graphic/graphic.js +27 -19
  49. package/cjs/graphic/graphic.js.map +1 -1
  50. package/cjs/graphic/group.js +14 -7
  51. package/cjs/graphic/group.js.map +1 -1
  52. package/cjs/graphic/image.js +2 -1
  53. package/cjs/graphic/image.js.map +1 -1
  54. package/cjs/graphic/index.d.ts +1 -0
  55. package/cjs/graphic/index.js +8 -8
  56. package/cjs/graphic/index.js.map +1 -1
  57. package/cjs/graphic/line.d.ts +1 -2
  58. package/cjs/graphic/line.js +7 -2
  59. package/cjs/graphic/line.js.map +1 -1
  60. package/cjs/graphic/path.js +2 -1
  61. package/cjs/graphic/path.js.map +1 -1
  62. package/cjs/graphic/polygon.js +2 -1
  63. package/cjs/graphic/polygon.js.map +1 -1
  64. package/cjs/graphic/rect.js +7 -3
  65. package/cjs/graphic/rect.js.map +1 -1
  66. package/cjs/graphic/richtext/icon.d.ts +1 -1
  67. package/cjs/graphic/richtext/icon.js.map +1 -1
  68. package/cjs/graphic/richtext.js +3 -2
  69. package/cjs/graphic/richtext.js.map +1 -1
  70. package/cjs/graphic/star.d.ts +52 -0
  71. package/cjs/graphic/star.js +78 -0
  72. package/cjs/graphic/star.js.map +1 -0
  73. package/cjs/graphic/symbol.js +3 -1
  74. package/cjs/graphic/symbol.js.map +1 -1
  75. package/cjs/graphic/text.js +1 -0
  76. package/cjs/graphic/text.js.map +1 -1
  77. package/cjs/graphic/theme.js +2 -0
  78. package/cjs/graphic/theme.js.map +1 -1
  79. package/cjs/index.d.ts +2 -0
  80. package/cjs/index.js +7 -6
  81. package/cjs/index.js.map +1 -1
  82. package/cjs/interface/animation/animate.d.ts +17 -0
  83. package/cjs/interface/animation/animate.js.map +1 -1
  84. package/cjs/interface/common.d.ts +1 -1
  85. package/cjs/interface/common.js.map +1 -1
  86. package/cjs/interface/contribution.d.ts +2 -0
  87. package/cjs/interface/contribution.js.map +1 -1
  88. package/cjs/interface/graphic/index.d.ts +1 -0
  89. package/cjs/interface/graphic/index.js +3 -2
  90. package/cjs/interface/graphic/index.js.map +1 -1
  91. package/cjs/interface/graphic/star.d.ts +12 -0
  92. package/cjs/interface/graphic/star.js +6 -0
  93. package/cjs/interface/graphic/star.js.map +1 -0
  94. package/cjs/interface/graphic/theme.d.ts +3 -0
  95. package/cjs/interface/graphic/theme.js.map +1 -1
  96. package/cjs/interface/graphic.d.ts +11 -0
  97. package/cjs/interface/graphic.js.map +1 -1
  98. package/cjs/interface/render.d.ts +1 -0
  99. package/cjs/interface/render.js.map +1 -1
  100. package/cjs/interface/stage.d.ts +2 -0
  101. package/cjs/interface/stage.js.map +1 -1
  102. package/cjs/modules.d.ts +2 -1
  103. package/cjs/modules.js +4 -3
  104. package/cjs/modules.js.map +1 -1
  105. package/cjs/plugins/builtin-plugin/auto-render-plugin.js +9 -8
  106. package/cjs/plugins/builtin-plugin/auto-render-plugin.js.map +1 -1
  107. package/cjs/plugins/builtin-plugin/dirty-bounds-plugin.js +14 -11
  108. package/cjs/plugins/builtin-plugin/dirty-bounds-plugin.js.map +1 -1
  109. package/cjs/plugins/builtin-plugin/flex-layout-plugin.js +13 -10
  110. package/cjs/plugins/builtin-plugin/flex-layout-plugin.js.map +1 -1
  111. package/cjs/plugins/builtin-plugin/html-attribute-plugin.js +0 -1
  112. package/cjs/plugins/builtin-plugin/html-attribute-plugin.js.map +1 -1
  113. package/cjs/plugins/builtin-plugin/incremental-auto-render-plugin.js +8 -5
  114. package/cjs/plugins/builtin-plugin/incremental-auto-render-plugin.js.map +1 -1
  115. package/cjs/register/register-star.d.ts +1 -0
  116. package/cjs/register/register-star.js +14 -0
  117. package/cjs/register/register-star.js.map +1 -0
  118. package/cjs/render/contributions/render/area-render.js +2 -2
  119. package/cjs/render/contributions/render/area-render.js.map +1 -1
  120. package/cjs/render/contributions/render/contributions/constants.d.ts +1 -0
  121. package/cjs/render/contributions/render/contributions/constants.js +3 -2
  122. package/cjs/render/contributions/render/contributions/constants.js.map +1 -1
  123. package/cjs/render/contributions/render/contributions/index.d.ts +1 -0
  124. package/cjs/render/contributions/render/contributions/index.js +2 -2
  125. package/cjs/render/contributions/render/contributions/index.js.map +1 -1
  126. package/cjs/render/contributions/render/contributions/star-contribution-render.d.ts +2 -0
  127. package/cjs/render/contributions/render/contributions/star-contribution-render.js +11 -0
  128. package/cjs/render/contributions/render/contributions/star-contribution-render.js.map +1 -0
  129. package/cjs/render/contributions/render/line-render.js +1 -1
  130. package/cjs/render/contributions/render/line-render.js.map +1 -1
  131. package/cjs/render/contributions/render/star-module.d.ts +2 -0
  132. package/cjs/render/contributions/render/star-module.js +15 -0
  133. package/cjs/render/contributions/render/star-module.js.map +1 -0
  134. package/cjs/render/contributions/render/star-render.d.ts +10 -0
  135. package/cjs/render/contributions/render/star-render.js +54 -0
  136. package/cjs/render/contributions/render/star-render.js.map +1 -0
  137. package/cjs/render/contributions/render/symbol.d.ts +1 -0
  138. package/cjs/render/contributions/render/symbol.js +2 -2
  139. package/cjs/render/contributions/render/symbol.js.map +1 -1
  140. package/cjs/render/render-service.d.ts +1 -1
  141. package/cjs/render/render-service.js.map +1 -1
  142. package/dist/index.es.js +12340 -12134
  143. package/es/animate/config.d.ts +0 -1
  144. package/es/animate/config.js +0 -5
  145. package/es/animate/config.js.map +1 -1
  146. package/es/application.d.ts +2 -1
  147. package/es/application.js.map +1 -1
  148. package/es/color-string/interpolate.js +4 -1
  149. package/es/color-string/interpolate.js.map +1 -1
  150. package/es/common/canvas-utils.js +6 -3
  151. package/es/common/canvas-utils.js.map +1 -1
  152. package/es/common/custom-path2d.js +2 -2
  153. package/es/common/custom-path2d.js.map +1 -1
  154. package/es/common/morphing-utils.js +29 -124
  155. package/es/common/morphing-utils.js.map +1 -1
  156. package/es/common/segment/index.js +4 -1
  157. package/es/common/segment/index.js.map +1 -1
  158. package/es/common/segment/step.d.ts +6 -0
  159. package/es/common/segment/step.js +13 -0
  160. package/es/common/segment/step.js.map +1 -1
  161. package/es/common/shape/arc.d.ts +1 -1
  162. package/es/common/shape/arc.js +7 -3
  163. package/es/common/shape/arc.js.map +1 -1
  164. package/es/common/split-path.js +1 -1
  165. package/es/common/split-path.js.map +1 -1
  166. package/es/common/utils.d.ts +0 -2
  167. package/es/common/utils.js +0 -4
  168. package/es/common/utils.js.map +1 -1
  169. package/es/core/stage.d.ts +2 -1
  170. package/es/core/stage.js +5 -2
  171. package/es/core/stage.js.map +1 -1
  172. package/es/graphic/arc.d.ts +1 -2
  173. package/es/graphic/arc.js +4 -3
  174. package/es/graphic/arc.js.map +1 -1
  175. package/es/graphic/area.d.ts +1 -2
  176. package/es/graphic/area.js +5 -2
  177. package/es/graphic/area.js.map +1 -1
  178. package/es/graphic/circle.d.ts +1 -2
  179. package/es/graphic/circle.js +6 -3
  180. package/es/graphic/circle.js.map +1 -1
  181. package/es/graphic/config.d.ts +2 -1
  182. package/es/graphic/config.js +11 -2
  183. package/es/graphic/config.js.map +1 -1
  184. package/es/graphic/constants.d.ts +1 -0
  185. package/es/graphic/constants.js +2 -0
  186. package/es/graphic/constants.js.map +1 -1
  187. package/es/graphic/graphic-service/graphic-module.js +1 -1
  188. package/es/graphic/graphic-service/graphic-module.js.map +1 -1
  189. package/es/graphic/graphic.d.ts +7 -1
  190. package/es/graphic/graphic.js +28 -18
  191. package/es/graphic/graphic.js.map +1 -1
  192. package/es/graphic/group.js +15 -8
  193. package/es/graphic/group.js.map +1 -1
  194. package/es/graphic/image.js +2 -1
  195. package/es/graphic/image.js.map +1 -1
  196. package/es/graphic/index.d.ts +1 -0
  197. package/es/graphic/index.js +2 -0
  198. package/es/graphic/index.js.map +1 -1
  199. package/es/graphic/line.d.ts +1 -2
  200. package/es/graphic/line.js +7 -2
  201. package/es/graphic/line.js.map +1 -1
  202. package/es/graphic/path.js +2 -1
  203. package/es/graphic/path.js.map +1 -1
  204. package/es/graphic/polygon.js +2 -1
  205. package/es/graphic/polygon.js.map +1 -1
  206. package/es/graphic/rect.js +7 -3
  207. package/es/graphic/rect.js.map +1 -1
  208. package/es/graphic/richtext/icon.d.ts +1 -1
  209. package/es/graphic/richtext/icon.js.map +1 -1
  210. package/es/graphic/richtext.js +3 -2
  211. package/es/graphic/richtext.js.map +1 -1
  212. package/es/graphic/star.d.ts +52 -0
  213. package/es/graphic/star.js +82 -0
  214. package/es/graphic/star.js.map +1 -0
  215. package/es/graphic/symbol.js +3 -1
  216. package/es/graphic/symbol.js.map +1 -1
  217. package/es/graphic/text.js +1 -0
  218. package/es/graphic/text.js.map +1 -1
  219. package/es/graphic/theme.js +3 -1
  220. package/es/graphic/theme.js.map +1 -1
  221. package/es/index.d.ts +2 -0
  222. package/es/index.js +4 -0
  223. package/es/index.js.map +1 -1
  224. package/es/interface/animation/animate.d.ts +17 -0
  225. package/es/interface/animation/animate.js.map +1 -1
  226. package/es/interface/common.d.ts +1 -1
  227. package/es/interface/common.js.map +1 -1
  228. package/es/interface/contribution.d.ts +2 -0
  229. package/es/interface/contribution.js.map +1 -1
  230. package/es/interface/graphic/index.d.ts +1 -0
  231. package/es/interface/graphic/index.js +2 -0
  232. package/es/interface/graphic/index.js.map +1 -1
  233. package/es/interface/graphic/star.d.ts +12 -0
  234. package/es/interface/graphic/star.js +2 -0
  235. package/es/interface/graphic/star.js.map +1 -0
  236. package/es/interface/graphic/theme.d.ts +3 -0
  237. package/es/interface/graphic/theme.js.map +1 -1
  238. package/es/interface/graphic.d.ts +11 -0
  239. package/es/interface/graphic.js.map +1 -1
  240. package/es/interface/render.d.ts +1 -0
  241. package/es/interface/render.js.map +1 -1
  242. package/es/interface/stage.d.ts +2 -0
  243. package/es/interface/stage.js.map +1 -1
  244. package/es/modules.d.ts +2 -1
  245. package/es/modules.js +6 -0
  246. package/es/modules.js.map +1 -1
  247. package/es/plugins/builtin-plugin/auto-render-plugin.js +8 -8
  248. package/es/plugins/builtin-plugin/auto-render-plugin.js.map +1 -1
  249. package/es/plugins/builtin-plugin/dirty-bounds-plugin.js +13 -12
  250. package/es/plugins/builtin-plugin/dirty-bounds-plugin.js.map +1 -1
  251. package/es/plugins/builtin-plugin/flex-layout-plugin.js +12 -11
  252. package/es/plugins/builtin-plugin/flex-layout-plugin.js.map +1 -1
  253. package/es/plugins/builtin-plugin/html-attribute-plugin.js +0 -1
  254. package/es/plugins/builtin-plugin/html-attribute-plugin.js.map +1 -1
  255. package/es/plugins/builtin-plugin/incremental-auto-render-plugin.js +8 -5
  256. package/es/plugins/builtin-plugin/incremental-auto-render-plugin.js.map +1 -1
  257. package/es/register/register-star.d.ts +1 -0
  258. package/es/register/register-star.js +8 -0
  259. package/es/register/register-star.js.map +1 -0
  260. package/es/render/contributions/render/area-render.js +2 -2
  261. package/es/render/contributions/render/area-render.js.map +1 -1
  262. package/es/render/contributions/render/contributions/constants.d.ts +1 -0
  263. package/es/render/contributions/render/contributions/constants.js +2 -0
  264. package/es/render/contributions/render/contributions/constants.js.map +1 -1
  265. package/es/render/contributions/render/contributions/index.d.ts +1 -0
  266. package/es/render/contributions/render/contributions/index.js +2 -0
  267. package/es/render/contributions/render/contributions/index.js.map +1 -1
  268. package/es/render/contributions/render/contributions/star-contribution-render.d.ts +2 -0
  269. package/es/render/contributions/render/contributions/star-contribution-render.js +8 -0
  270. package/es/render/contributions/render/contributions/star-contribution-render.js.map +1 -0
  271. package/es/render/contributions/render/line-render.js +1 -1
  272. package/es/render/contributions/render/line-render.js.map +1 -1
  273. package/es/render/contributions/render/star-module.d.ts +2 -0
  274. package/es/render/contributions/render/star-module.js +13 -0
  275. package/es/render/contributions/render/star-module.js.map +1 -0
  276. package/es/render/contributions/render/star-render.d.ts +10 -0
  277. package/es/render/contributions/render/star-render.js +59 -0
  278. package/es/render/contributions/render/star-render.js.map +1 -0
  279. package/es/render/contributions/render/symbol.d.ts +1 -0
  280. package/es/render/contributions/render/symbol.js +2 -0
  281. package/es/render/contributions/render/symbol.js.map +1 -1
  282. package/es/render/render-service.d.ts +1 -1
  283. package/es/render/render-service.js.map +1 -1
  284. package/package.json +4 -4
@@ -26,7 +26,8 @@ class Circle extends graphic_1.Graphic {
26
26
  this.updatePathProxyAABBBounds(aabbBounds) || (full ? this.updateCircleAABBBoundsImprecise(attribute, circleTheme, aabbBounds) : this.updateCircleAABBBoundsAccurate(attribute, circleTheme, aabbBounds));
27
27
  const {tb1: tb1, tb2: tb2} = application_1.application.graphicService.updateTempAABBBounds(aabbBounds);
28
28
  return (0, common_outer_boder_bounds_1.updateBoundsOfCommonOuterBorder)(attribute, circleTheme, tb1),
29
- aabbBounds.union(tb1), tb1.setValue(tb2.x1, tb2.y1, tb2.x2, tb2.y2), application_1.application.graphicService.transformAABBBounds(attribute, aabbBounds, circleTheme, !1, this),
29
+ aabbBounds.union(tb1), tb1.setValue(tb2.x1, tb2.y1, tb2.x2, tb2.y2), this.widthWithoutTransform = aabbBounds.x2 - aabbBounds.x1,
30
+ this.heightWithoutTransform = aabbBounds.y2 - aabbBounds.y1, application_1.application.graphicService.transformAABBBounds(attribute, aabbBounds, circleTheme, !1, this),
30
31
  aabbBounds;
31
32
  }
32
33
  updateCircleAABBBoundsImprecise(attribute, circleTheme, aabbBounds) {
@@ -46,8 +47,11 @@ class Circle extends graphic_1.Graphic {
46
47
  }
47
48
  toCustomPath() {
48
49
  var _a, _b, _c;
49
- const attribute = this.attribute, radius = null !== (_a = attribute.radius) && void 0 !== _a ? _a : this.getDefaultAttribute("radius"), startAngle = null !== (_b = attribute.startAngle) && void 0 !== _b ? _b : this.getDefaultAttribute("startAngle"), endAngle = null !== (_c = attribute.endAngle) && void 0 !== _c ? _c : this.getDefaultAttribute("endAngle"), path = new custom_path2d_1.CustomPath2D;
50
- return path.arc(0, 0, radius, startAngle, endAngle), path;
50
+ let path = super.toCustomPath();
51
+ if (path) return path;
52
+ const attribute = this.attribute, radius = null !== (_a = attribute.radius) && void 0 !== _a ? _a : this.getDefaultAttribute("radius"), startAngle = null !== (_b = attribute.startAngle) && void 0 !== _b ? _b : this.getDefaultAttribute("startAngle"), endAngle = null !== (_c = attribute.endAngle) && void 0 !== _c ? _c : this.getDefaultAttribute("endAngle");
53
+ return path = new custom_path2d_1.CustomPath2D, path.arc(0, 0, radius, startAngle, endAngle),
54
+ path;
51
55
  }
52
56
  clone() {
53
57
  return new Circle(Object.assign({}, this.attribute));
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/graphic/circle.ts"],"names":[],"mappings":";;;AAAA,6CAAkE;AAElE,uCAAiF;AACjF,2DAAuD;AACvD,2CAA+C;AAC/C,mCAAmC;AACnC,gDAA6C;AAC7C,2CAAiD;AACjD,2FAA8F;AAE9F,MAAM,qBAAqB,GAAG,CAAC,QAAQ,EAAE,YAAY,EAAE,UAAU,EAAE,GAAG,gCAAsB,CAAC,CAAC;AAM9F,MAAa,MAAO,SAAQ,iBAAgC;IAK1D,YAAY,SAAkC,EAAE,MAAM,EAAE,CAAC,EAAE;QACzD,KAAK,CAAC,MAAM,CAAC,CAAC;QALhB,SAAI,GAAa,QAAQ,CAAC;QAMxB,IAAI,CAAC,UAAU,GAAG,8BAAkB,CAAC;IACvC,CAAC;IAED,OAAO;QACL,OAAO,KAAK,CAAC,OAAO,EAAE,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;IAC5C,CAAC;IACO,QAAQ;QACd,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC;QACxD,OAAO,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,IAAI,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,IAAI,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC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AAC,CAAC;QAE7C,OAAO,IAAI,CAAC;IACd,CAAC;IAED,KAAK;QACH,OAAO,IAAI,MAAM,mBAAM,IAAI,CAAC,SAAS,EAAG,CAAC;IAC3C,CAAC;IAED,oBAAoB;QAClB,OAAO,MAAM,CAAC,mBAAmB,CAAC;IACpC,CAAC;;AAxGH,wBAyGC;AAtGQ,0BAAmB,GAAG,6BAAmB,CAAC;AAwGnD,SAAgB,YAAY,CAAC,UAAmC;IAC9D,OAAO,IAAI,MAAM,CAAC,UAAU,CAAC,CAAC;AAChC,CAAC;AAFD,oCAEC","file":"circle.js","sourcesContent":["import { epsilon, pi2, type IAABBBounds } from '@visactor/vutils';\nimport type { ICircle, ICircleGraphicAttribute } from '../interface/graphic/circle';\nimport { Graphic, GRAPHIC_UPDATE_TAG_KEY, NOWORK_ANIMATE_ATTR } from './graphic';\nimport { CustomPath2D } from '../common/custom-path2d';\nimport { circleBounds } from '../common/utils';\nimport { getTheme } from './theme';\nimport { application } from '../application';\nimport { CIRCLE_NUMBER_TYPE } from './constants';\nimport { updateBoundsOfCommonOuterBorder } from './graphic-service/common-outer-boder-bounds';\n\nconst CIRCLE_UPDATE_TAG_KEY = ['radius', 'startAngle', 'endAngle', ...GRAPHIC_UPDATE_TAG_KEY];\n\n/**\n * 圆形图元\n * 默认顺时针绘制\n */\nexport class Circle extends Graphic<ICircleGraphicAttribute> implements ICircle {\n type: 'circle' = 'circle';\n\n static NOWORK_ANIMATE_ATTR = NOWORK_ANIMATE_ATTR;\n\n constructor(params: ICircleGraphicAttribute = { radius: 1 }) {\n super(params);\n this.numberType = CIRCLE_NUMBER_TYPE;\n }\n\n isValid(): boolean {\n return super.isValid() && this._isValid();\n }\n private _isValid(): boolean {\n const { startAngle, endAngle, radius } = this.attribute;\n return this._validNumber(startAngle) && this._validNumber(endAngle) && this._validNumber(radius);\n }\n\n getGraphicTheme(): Required<ICircleGraphicAttribute> {\n return getTheme(this).circle;\n }\n\n protected updateAABBBounds(\n attribute: ICircleGraphicAttribute,\n circleTheme: Required<ICircleGraphicAttribute>,\n aabbBounds: IAABBBounds,\n full?: boolean\n ) {\n if (!this.updatePathProxyAABBBounds(aabbBounds)) {\n full\n ? this.updateCircleAABBBoundsImprecise(attribute, circleTheme, aabbBounds)\n : this.updateCircleAABBBoundsAccurate(attribute, circleTheme, aabbBounds);\n }\n\n const { tb1, tb2 } = application.graphicService.updateTempAABBBounds(aabbBounds);\n\n updateBoundsOfCommonOuterBorder(attribute, circleTheme, tb1);\n aabbBounds.union(tb1);\n tb1.setValue(tb2.x1, tb2.y1, tb2.x2, tb2.y2);\n\n application.graphicService.transformAABBBounds(attribute, aabbBounds, circleTheme, false, this);\n\n return aabbBounds;\n }\n\n protected updateCircleAABBBoundsImprecise(\n attribute: ICircleGraphicAttribute,\n circleTheme: Required<ICircleGraphicAttribute>,\n aabbBounds: IAABBBounds\n ): IAABBBounds {\n const { radius = circleTheme.radius } = attribute;\n aabbBounds.set(-radius, -radius, radius, radius);\n\n return aabbBounds;\n }\n protected updateCircleAABBBoundsAccurate(\n attribute: ICircleGraphicAttribute,\n circleTheme: Required<ICircleGraphicAttribute>,\n aabbBounds: IAABBBounds\n ): IAABBBounds {\n const {\n startAngle = circleTheme.startAngle,\n endAngle = circleTheme.endAngle,\n radius = circleTheme.radius\n } = attribute;\n\n if (endAngle - startAngle > pi2 - epsilon) {\n aabbBounds.set(-radius, -radius, radius, radius);\n } else {\n circleBounds(startAngle, endAngle, radius, aabbBounds);\n }\n\n return aabbBounds;\n }\n\n protected needUpdateTags(keys: string[]): boolean {\n return super.needUpdateTags(keys, CIRCLE_UPDATE_TAG_KEY);\n }\n protected needUpdateTag(key: string): boolean {\n return super.needUpdateTag(key, CIRCLE_UPDATE_TAG_KEY);\n }\n\n toCustomPath() {\n const x = 0;\n const y = 0;\n\n const attribute = this.attribute;\n const radius = attribute.radius ?? this.getDefaultAttribute('radius');\n const startAngle = attribute.startAngle ?? this.getDefaultAttribute('startAngle');\n const endAngle = attribute.endAngle ?? this.getDefaultAttribute('endAngle');\n\n const path = new CustomPath2D();\n\n path.arc(x, y, radius, startAngle, endAngle);\n\n return path;\n }\n\n clone() {\n return new Circle({ ...this.attribute });\n }\n\n getNoWorkAnimateAttr(): Record<string, number> {\n return Circle.NOWORK_ANIMATE_ATTR;\n }\n}\n\nexport function createCircle(attributes: ICircleGraphicAttribute): ICircle {\n return new Circle(attributes);\n}\n\n// addAttributeToPrototype(DefaultCircleStyle, Circle, PURE_STYLE_KEY);\n"]}
1
+ {"version":3,"sources":["../src/graphic/circle.ts"],"names":[],"mappings":";;;AAAA,6CAAkE;AAElE,uCAAiF;AACjF,2DAAuD;AACvD,2CAA+C;AAC/C,mCAAmC;AACnC,gDAA6C;AAC7C,2CAAiD;AACjD,2FAA8F;AAE9F,MAAM,qBAAqB,GAAG,CAAC,QAAQ,EAAE,YAAY,EAAE,UAAU,EAAE,GAAG,gCAAsB,CAAC,CAAC;AAM9F,MAAa,MAAO,SAAQ,iBAAgC;IAK1D,YAAY,SAAkC,EAAE,MAAM,EAAE,CAAC,EAAE;QACzD,KAAK,CAAC,MAAM,CAAC,CAAC;QALhB,SAAI,GAAa,QAAQ,CAAC;QAMxB,IAAI,CAAC,UAAU,GAAG,8BAAkB,CAAC;IACvC,CAAC;IAED,OAAO;QACL,OAAO,KAAK,CAAC,OAAO,EAAE,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;IAC5C,CAAC;IACO,QAAQ;QACd,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC;QACxD,OAAO,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,IAAI,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,IAAI,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;IACnG,CAAC;IAED,eAAe;QACb,OAAO,IAAA,gBAAQ,EAAC,IAAI,CAAC,CAAC,MAAM,CAAC;IAC/B,CAAC;IAES,gBAAgB,C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AAU,CAAC,CAAC;QAE5E,IAAI,GAAG,IAAI,4BAAY,EAAE,CAAC;QAE1B,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,CAAC,CAAC;QAE7C,OAAO,IAAI,CAAC;IACd,CAAC;IAED,KAAK;QACH,OAAO,IAAI,MAAM,mBAAM,IAAI,CAAC,SAAS,EAAG,CAAC;IAC3C,CAAC;IAED,oBAAoB;QAClB,OAAO,MAAM,CAAC,mBAAmB,CAAC;IACpC,CAAC;;AA/GH,wBAgHC;AA7GQ,0BAAmB,GAAG,6BAAmB,CAAC;AA+GnD,SAAgB,YAAY,CAAC,UAAmC;IAC9D,OAAO,IAAI,MAAM,CAAC,UAAU,CAAC,CAAC;AAChC,CAAC;AAFD,oCAEC","file":"circle.js","sourcesContent":["import { epsilon, pi2, type IAABBBounds } from '@visactor/vutils';\nimport type { ICircle, ICircleGraphicAttribute } from '../interface/graphic/circle';\nimport { Graphic, GRAPHIC_UPDATE_TAG_KEY, NOWORK_ANIMATE_ATTR } from './graphic';\nimport { CustomPath2D } from '../common/custom-path2d';\nimport { circleBounds } from '../common/utils';\nimport { getTheme } from './theme';\nimport { application } from '../application';\nimport { CIRCLE_NUMBER_TYPE } from './constants';\nimport { updateBoundsOfCommonOuterBorder } from './graphic-service/common-outer-boder-bounds';\n\nconst CIRCLE_UPDATE_TAG_KEY = ['radius', 'startAngle', 'endAngle', ...GRAPHIC_UPDATE_TAG_KEY];\n\n/**\n * 圆形图元\n * 默认顺时针绘制\n */\nexport class Circle extends Graphic<ICircleGraphicAttribute> implements ICircle {\n type: 'circle' = 'circle';\n\n static NOWORK_ANIMATE_ATTR = NOWORK_ANIMATE_ATTR;\n\n constructor(params: ICircleGraphicAttribute = { radius: 1 }) {\n super(params);\n this.numberType = CIRCLE_NUMBER_TYPE;\n }\n\n isValid(): boolean {\n return super.isValid() && this._isValid();\n }\n private _isValid(): boolean {\n const { startAngle, endAngle, radius } = this.attribute;\n return this._validNumber(startAngle) && this._validNumber(endAngle) && this._validNumber(radius);\n }\n\n getGraphicTheme(): Required<ICircleGraphicAttribute> {\n return getTheme(this).circle;\n }\n\n protected updateAABBBounds(\n attribute: ICircleGraphicAttribute,\n circleTheme: Required<ICircleGraphicAttribute>,\n aabbBounds: IAABBBounds,\n full?: boolean\n ) {\n if (!this.updatePathProxyAABBBounds(aabbBounds)) {\n full\n ? this.updateCircleAABBBoundsImprecise(attribute, circleTheme, aabbBounds)\n : this.updateCircleAABBBoundsAccurate(attribute, circleTheme, aabbBounds);\n }\n\n const { tb1, tb2 } = application.graphicService.updateTempAABBBounds(aabbBounds);\n\n updateBoundsOfCommonOuterBorder(attribute, circleTheme, tb1);\n aabbBounds.union(tb1);\n tb1.setValue(tb2.x1, tb2.y1, tb2.x2, tb2.y2);\n\n this.widthWithoutTransform = aabbBounds.x2 - aabbBounds.x1;\n this.heightWithoutTransform = aabbBounds.y2 - aabbBounds.y1;\n\n application.graphicService.transformAABBBounds(attribute, aabbBounds, circleTheme, false, this);\n\n return aabbBounds;\n }\n\n protected updateCircleAABBBoundsImprecise(\n attribute: ICircleGraphicAttribute,\n circleTheme: Required<ICircleGraphicAttribute>,\n aabbBounds: IAABBBounds\n ): IAABBBounds {\n const { radius = circleTheme.radius } = attribute;\n aabbBounds.set(-radius, -radius, radius, radius);\n\n return aabbBounds;\n }\n protected updateCircleAABBBoundsAccurate(\n attribute: ICircleGraphicAttribute,\n circleTheme: Required<ICircleGraphicAttribute>,\n aabbBounds: IAABBBounds\n ): IAABBBounds {\n const {\n startAngle = circleTheme.startAngle,\n endAngle = circleTheme.endAngle,\n radius = circleTheme.radius\n } = attribute;\n\n if (endAngle - startAngle > pi2 - epsilon) {\n aabbBounds.set(-radius, -radius, radius, radius);\n } else {\n circleBounds(startAngle, endAngle, radius, aabbBounds);\n }\n\n return aabbBounds;\n }\n\n protected needUpdateTags(keys: string[]): boolean {\n return super.needUpdateTags(keys, CIRCLE_UPDATE_TAG_KEY);\n }\n protected needUpdateTag(key: string): boolean {\n return super.needUpdateTag(key, CIRCLE_UPDATE_TAG_KEY);\n }\n\n toCustomPath() {\n let path = super.toCustomPath();\n if (path) {\n return path;\n }\n const x = 0;\n const y = 0;\n\n const attribute = this.attribute;\n const radius = attribute.radius ?? this.getDefaultAttribute('radius');\n const startAngle = attribute.startAngle ?? this.getDefaultAttribute('startAngle');\n const endAngle = attribute.endAngle ?? this.getDefaultAttribute('endAngle');\n\n path = new CustomPath2D();\n\n path.arc(x, y, radius, startAngle, endAngle);\n\n return path;\n }\n\n clone() {\n return new Circle({ ...this.attribute });\n }\n\n getNoWorkAnimateAttr(): Record<string, number> {\n return Circle.NOWORK_ANIMATE_ATTR;\n }\n}\n\nexport function createCircle(attributes: ICircleGraphicAttribute): ICircle {\n return new Circle(attributes);\n}\n\n// addAttributeToPrototype(DefaultCircleStyle, Circle, PURE_STYLE_KEY);\n"]}
@@ -1,4 +1,4 @@
1
- import { type IArcGraphicAttribute, type IAreaGraphicAttribute, type IGraphicAttribute, type ICircleGraphicAttribute, type IFillStyle, type IGlyphGraphicAttribute, type IGroupGraphicAttribute, type IImageGraphicAttribute, type ILineGraphicAttribute, type IPathGraphicAttribute, type IPolygonGraphicAttribute, type IRect3dGraphicAttribute, type IRectGraphicAttribute, type IStrokeStyle, type IGraphicStyle, type ISymbolGraphicAttribute, type ITextAttribute, type ITextGraphicAttribute, type IRichTextGraphicAttribute, type ITransform, type IRichTextIconGraphicAttribute, type IConnectedStyle, type ILayout, type IDebugType, type IPickStyle } from '../interface';
1
+ import { type IArcGraphicAttribute, type IAreaGraphicAttribute, type IGraphicAttribute, type ICircleGraphicAttribute, type IFillStyle, type IGlyphGraphicAttribute, type IGroupGraphicAttribute, type IImageGraphicAttribute, type ILineGraphicAttribute, type IPathGraphicAttribute, type IPolygonGraphicAttribute, type IRect3dGraphicAttribute, type IRectGraphicAttribute, type IStrokeStyle, type IGraphicStyle, type ISymbolGraphicAttribute, type ITextAttribute, type ITextGraphicAttribute, type IRichTextGraphicAttribute, type ITransform, type IRichTextIconGraphicAttribute, type IStarGraphicAttribute, type IConnectedStyle, type ILayout, type IDebugType, type IPickStyle } from '../interface';
2
2
  export declare const DefaultLayout: ILayout;
3
3
  export declare const DefaultTransform: ITransform;
4
4
  export declare const DefaultFillStyle: IFillStyle;
@@ -19,6 +19,7 @@ export declare const DefaultGlyphAttribute: Required<IGlyphGraphicAttribute>;
19
19
  export declare const DefaultLineAttribute: Required<ILineGraphicAttribute>;
20
20
  export declare const DefaultPathAttribute: Required<IPathGraphicAttribute>;
21
21
  export declare const DefaultPolygonAttribute: Required<IPolygonGraphicAttribute>;
22
+ export declare const DefaultStarAttribute: Required<IStarGraphicAttribute>;
22
23
  export declare const DefaultRectAttribute: Required<IRectGraphicAttribute>;
23
24
  export declare const DefaultRect3dAttribute: Required<IRect3dGraphicAttribute>;
24
25
  export declare const DefaultSymbolAttribute: Required<ISymbolGraphicAttribute>;
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: !0
5
- }), exports.DefaultRichTextIconAttribute = exports.DefaultImageAttribute = exports.DefaultRichTextAttribute = exports.DefaultTextAttribute = exports.DefaultSymbolAttribute = exports.DefaultRect3dAttribute = exports.DefaultRectAttribute = exports.DefaultPolygonAttribute = exports.DefaultPathAttribute = exports.DefaultLineAttribute = exports.DefaultGlyphAttribute = exports.DefaultGroupAttribute = exports.DefaultCircleAttribute = exports.DefaultAreaAttribute = exports.DefaultArcAttribute = exports.rewriteProto = exports.addAttributeToPrototype = exports.DefaultAttribute = exports.DefaultDebugAttribute = exports.DefaultConnectAttribute = exports.DefaultStyle = exports.DefaultPickStyle = exports.DefaultTextStyle = exports.DefaultStrokeStyle = exports.DefaultFillStyle = exports.DefaultTransform = exports.DefaultLayout = void 0;
5
+ }), exports.DefaultRichTextIconAttribute = exports.DefaultImageAttribute = exports.DefaultRichTextAttribute = exports.DefaultTextAttribute = exports.DefaultSymbolAttribute = exports.DefaultRect3dAttribute = exports.DefaultRectAttribute = exports.DefaultStarAttribute = exports.DefaultPolygonAttribute = exports.DefaultPathAttribute = exports.DefaultLineAttribute = exports.DefaultGlyphAttribute = exports.DefaultGroupAttribute = exports.DefaultCircleAttribute = exports.DefaultAreaAttribute = exports.DefaultArcAttribute = exports.rewriteProto = exports.addAttributeToPrototype = exports.DefaultAttribute = exports.DefaultDebugAttribute = exports.DefaultConnectAttribute = exports.DefaultStyle = exports.DefaultPickStyle = exports.DefaultTextStyle = exports.DefaultStrokeStyle = exports.DefaultFillStyle = exports.DefaultTransform = exports.DefaultLayout = void 0;
6
6
 
7
7
  const vutils_1 = require("@visactor/vutils"), custom_path2d_1 = require("../common/custom-path2d"), interface_1 = require("../interface");
8
8
 
@@ -122,7 +122,8 @@ exports.DefaultStrokeStyle = Object.assign({
122
122
  filter: "",
123
123
  cursor: null,
124
124
  html: null,
125
- react: null
125
+ react: null,
126
+ vue: null
126
127
  }, exports.DefaultFillStyle), exports.DefaultStrokeStyle), exports.DefaultLayout), exports.DefaultPickStyle),
127
128
  exports.DefaultConnectAttribute = {
128
129
  connectedType: "none",
@@ -155,7 +156,8 @@ exports.DefaultConnectAttribute = {
155
156
  overflow: "hidden",
156
157
  shadowPickMode: "graphic",
157
158
  keepStrokeScale: !1,
158
- clipConfig: null
159
+ clipConfig: null,
160
+ roughStyle: null
159
161
  }, exports.DefaultDebugAttribute), exports.DefaultStyle), exports.DefaultTransform),
160
162
  exports.addAttributeToPrototype = addAttributeToPrototype, exports.rewriteProto = rewriteProto,
161
163
  exports.DefaultArcAttribute = Object.assign(Object.assign({}, exports.DefaultAttribute), {
@@ -221,6 +223,11 @@ exports.DefaultArcAttribute = Object.assign(Object.assign({}, exports.DefaultAtt
221
223
  points: [],
222
224
  cornerRadius: 0,
223
225
  closePath: !0
226
+ }), exports.DefaultStarAttribute = Object.assign(Object.assign({}, exports.DefaultAttribute), {
227
+ width: 100,
228
+ height: 100,
229
+ spikes: 5,
230
+ thickness: .5
224
231
  }), exports.DefaultRectAttribute = Object.assign(Object.assign({}, exports.DefaultAttribute), {
225
232
  width: 0,
226
233
  height: 0,
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/graphic/config.ts"],"names":[],"mappings":";;;AACA,6CAAuD;AACvD,2DAAuD;AACvD,4CA+BsB;AAET,QAAA,aAAa,GAAY;IACpC,SAAS,EAAE,MAAM;CAClB,CAAC;AAEW,QAAA,gBAAgB,GAAe;IAC1C,CAAC,EAAE,CAAC;IACJ,CAAC,EAAE,CAAC;IACJ,CAAC,EAAE,CAAC;IACJ,EAAE,EAAE,CAAC;IACL,EAAE,EAAE,CAAC;IACL,EAAE,EAAE,CAAC;IACL,OAAO,EAAE,CAAC;IACV,OAAO,EAAE,CAAC;IACV,MAAM,EAAE,CAAC;IACT,MAAM,EAAE,CAAC;IACT,MAAM,EAAE,CAAC;IACT,KAAK,EAAE,CAAC;IACR,KAAK,EAAE,CAAC;IACR,IAAI,EAAE,CAAC;IACP,WAAW,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;IACnB,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;IACd,QAAQ,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;IAChB,UAAU,EAAE,IAAI,eAAM,EAAE;CACzB,CAAC;AAEW,QAAA,gBAAgB,GAAe;IAC1C,WAAW,EAAE,CAAC;IACd,IAAI,EAAE,KAAK;IACX,UAAU,EAAE,CAAC;IACb,WAAW,EAAE,OAAO;IACpB,aAAa,EAAE,CAAC;IAChB,aAAa,EAAE,CAAC;CACjB,CAAC;AAEF,MAAM,YAAY,GAAsD;IACtE,aAAa,EAAE,CAAC;IAChB,QAAQ,EAAE,EAAE;IACZ,cAAc,EAAE,CAAC;IACjB,SAAS,EAAE,CAAC;IACZ,OAAO,EAAE,MAAM;IACf,QAAQ,EAAE,OAAO;IACjB,UAAU,EAAE,EAAE;IACd,kBAAkB,EAAE,CAAC;IACrB,MAAM,EAAE,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,CAAC,EACnB,SAAS,EAAE,MAAM,EACjB,YAAY,EAAE,QAAQ,EACtB,SAAS,EAAE,YAAY,EACvB,MAAM,EAAE,CAAC,EACT,EAAE,EAAE,EAAE,EAEN,KAAK,EAAE,EAAE,EACT,MAAM,EAAE,EAAE,EACV,cAAc,EAAE,0BAA0B,EAC1C,qBAAqB,EAAE,CAAC,EACxB,gBAAgB,EAAE,KAAK,EACvB,uBAAuB,EAAE,CAAC,EAC1B,gBAAgB,EAAE,CAAC,EACnB,OAAO,EAAE,CAAC,IACV","file":"config.js","sourcesContent":["// 存放公共属性\nimport { Logger, Matrix, pi2 } from '@visactor/vutils';\nimport { CustomPath2D } from '../common/custom-path2d';\nimport {\n type IArcGraphicAttribute,\n type IAreaGraphicAttribute,\n type IGraphicAttribute,\n type ICircleGraphicAttribute,\n type IFillStyle,\n type IGlyphGraphicAttribute,\n type IGroupGraphicAttribute,\n type IImageGraphicAttribute,\n type ILineGraphicAttribute,\n type IPathGraphicAttribute,\n type IPolygonGraphicAttribute,\n type IRect3dGraphicAttribute,\n type IRectGraphicAttribute,\n type IStrokeStyle,\n type IGraphicStyle,\n type ISymbolGraphicAttribute,\n type ITextAttribute,\n type ITextGraphicAttribute,\n type IRichTextGraphicAttribute,\n type ITransform,\n type RichTextWordBreak,\n type RichTextVerticalDirection,\n type RichTextGlobalAlignType,\n type RichTextGlobalBaselineType,\n type IRichTextIconGraphicAttribute,\n type IConnectedStyle,\n type ILayout,\n type IDebugType,\n type IPickStyle,\n MeasureModeEnum\n} from '../interface';\n\nexport const DefaultLayout: ILayout = {\n alignSelf: 'auto'\n};\n\nexport const DefaultTransform: ITransform = {\n x: 0,\n y: 0,\n z: 0,\n dx: 0,\n dy: 0,\n dz: 0,\n scrollX: 0,\n scrollY: 0,\n scaleX: 1,\n scaleY: 1,\n scaleZ: 1,\n angle: 0,\n alpha: 0,\n beta: 0,\n scaleCenter: [0, 0],\n anchor: [0, 0],\n anchor3d: [0, 0],\n postMatrix: new Matrix()\n};\n\nexport const DefaultFillStyle: IFillStyle = {\n fillOpacity: 1,\n fill: false,\n shadowBlur: 0,\n shadowColor: 'black',\n shadowOffsetX: 0,\n shadowOffsetY: 0\n};\n\nconst commonStroke: Omit<IStrokeStyle, 'outerBorder' | 'innerBorder'> = {\n strokeOpacity: 1,\n lineDash: [],\n lineDashOffset: 0,\n lineWidth: 1,\n lineCap: 'butt',\n lineJoin: 'miter',\n miterLimit: 10,\n strokeBoundsBuffer: 2,\n stroke: false\n};\n\nexport const DefaultStrokeStyle: IStrokeStyle = {\n outerBorder: { ...commonStroke, distance: 0 },\n innerBorder: { ...commonStroke, distance: 0 },\n ...commonStroke\n};\n\nexport const DefaultTextStyle: Required<ITextAttribute> = {\n text: '',\n maxLineWidth: Infinity,\n maxWidth: Infinity,\n textAlign: 'left',\n textBaseline: 'alphabetic',\n fontSize: 16,\n // @ts-ignore\n fontFamily: `PingFang SC,Microsoft Yahei,system-ui,-apple-system,segoe ui,\n Roboto,Helvetica,Arial,sans-serif, apple color emoji,segoe ui emoji,segoe ui symbol`,\n fontWeight: '',\n ellipsis: '…',\n fontVariant: '',\n fontStyle: '',\n lineHeight: undefined,\n underline: 0,\n lineThrough: 0,\n scaleIn3d: false,\n direction: 'horizontal',\n wordBreak: 'break-all',\n ignoreBuf: false,\n verticalMode: 0,\n wrap: false,\n whiteSpace: 'no-wrap',\n heightLimit: Infinity,\n lineClamp: Infinity,\n suffixPosition: 'end',\n underlineDash: [],\n underlineOffset: 0,\n disableAutoClipedPoptip: undefined,\n measureMode: MeasureModeEnum.fontBounding,\n keepCenterInLine: false\n};\n\nexport const DefaultPickStyle: IPickStyle = {\n pickStrokeBuffer: 0\n};\n\nexport const DefaultStyle: IGraphicStyle = {\n forceBoundsWidth: undefined,\n forceBoundsHeight: undefined,\n opacity: 1,\n background: null,\n autoAnimateTexture: false,\n textureRatio: 1,\n textureOptions: null,\n backgroundOpacity: 1,\n backgroundCornerRadius: 0,\n texture: null,\n textureColor: 'black',\n textureSize: 10,\n texturePadding: 2,\n backgroundMode: 'no-repeat',\n backgroundFit: true,\n backgroundKeepAspectRatio: false,\n backgroundClip: true,\n backgroundScale: 1,\n backgroundOffsetX: 0,\n backgroundOffsetY: 0,\n blur: 0,\n filter: '',\n cursor: null,\n html: null,\n react: null,\n ...DefaultFillStyle,\n ...DefaultStrokeStyle,\n ...DefaultLayout,\n ...DefaultPickStyle\n};\n\nexport const DefaultConnectAttribute: Required<IConnectedStyle> = {\n connectedType: 'none',\n // connectedStyle: {\n // stroke: DefaultStrokeStyle.stroke,\n // strokeOpacity: DefaultStrokeStyle.strokeOpacity,\n // lineDash: DefaultStrokeStyle.lineDash,\n // lineDashOffset: DefaultStrokeStyle.lineDashOffset,\n // lineCap: DefaultStrokeStyle.lineCap,\n // lineJoin: DefaultStrokeStyle.lineJoin,\n // lineWidth: DefaultStrokeStyle.lineWidth,\n // fill: DefaultFillStyle.fill,\n // fillOpacity: DefaultFillStyle.fillOpacity\n // },\n connectedStyle: {}, // 默认全都继承父属性\n connectedX: NaN,\n connectedY: NaN\n} as IConnectedStyle;\n\nexport const DefaultDebugAttribute: Required<IDebugType> = {\n _debug_bounds: false\n};\n\nexport const DefaultAttribute: Required<IGraphicAttribute> = {\n strokeSeg: null,\n renderable: true,\n pickable: true,\n shadowGraphic: undefined,\n childrenPickable: true,\n fillPickable: true,\n strokePickable: true,\n visible: true,\n zIndex: 0,\n layout: null,\n boundsPadding: 0,\n fillStrokeOrder: 0,\n renderStyle: 'default',\n pickMode: 'accurate',\n customPickShape: null,\n boundsMode: 'accurate',\n keepDirIn3d: true,\n shadowRootIdx: 1,\n globalZIndex: 1,\n globalCompositeOperation: '',\n overflow: 'hidden',\n shadowPickMode: 'graphic',\n keepStrokeScale: false,\n clipConfig: null,\n ...DefaultDebugAttribute,\n ...DefaultStyle,\n ...DefaultTransform\n};\n\nexport function addAttributeToPrototype(obj: Record<string, any>, c: any, keys: string[]) {\n keys.forEach(key => {\n c.prototype[key] = obj[key];\n });\n}\nexport function rewriteProto(obj: Record<string, any>, c: Record<string, any>) {\n Object.setPrototypeOf(obj, c);\n}\n\nexport const DefaultArcAttribute: Required<IArcGraphicAttribute> = {\n ...DefaultAttribute,\n startAngle: 0,\n endAngle: pi2,\n innerRadius: 0,\n outerRadius: 1,\n innerPadding: 0,\n outerPadding: 0,\n cornerRadius: 0,\n padRadius: 0,\n padAngle: 0,\n cap: false,\n forceShowCap: false\n};\n\nexport const DefaultAreaAttribute: Required<IAreaGraphicAttribute> = {\n ...DefaultAttribute,\n ...DefaultConnectAttribute,\n points: [],\n segments: [],\n curveType: 'linear',\n clipRange: 1,\n closePath: false,\n curveTension: 1\n};\n\nexport const DefaultCircleAttribute: Required<ICircleGraphicAttribute> = {\n ...DefaultAttribute,\n radius: 1,\n startAngle: 0,\n endAngle: pi2\n};\n\nexport const DefaultGroupAttribute: Required<IGroupGraphicAttribute> = {\n ...DefaultAttribute,\n width: 0,\n height: 0,\n cornerRadius: 0,\n path: [],\n clip: false,\n visibleAll: true,\n display: 'relative',\n flexDirection: 'row',\n flexWrap: 'wrap',\n justifyContent: 'flex-start',\n alignItems: 'flex-start',\n alignContent: 'flex-start',\n baseOpacity: 1,\n cornerType: 'round'\n // 默认是0,不需要主题\n // drawMode: 0\n} as any;\n\nexport const DefaultGlyphAttribute: Required<IGlyphGraphicAttribute> = {\n ...DefaultAttribute,\n path: '',\n width: 0,\n height: 0,\n cornerRadius: 0,\n clip: false\n};\n\nexport const DefaultLineAttribute: Required<ILineGraphicAttribute> = {\n ...DefaultAttribute,\n ...DefaultConnectAttribute,\n points: [],\n segments: [],\n curveType: 'linear',\n clipRange: 1,\n clipRangeByDimension: 'default',\n closePath: false,\n curveTension: 1\n};\n\nexport const DefaultPathAttribute: Required<IPathGraphicAttribute> = {\n ...DefaultAttribute,\n path: new CustomPath2D(),\n fillStrokeOrder: 1,\n clipRange: 1,\n customPath: () => {\n Logger.getInstance().warn('空函数');\n }\n};\n\nexport const DefaultPolygonAttribute: Required<IPolygonGraphicAttribute> = {\n ...DefaultAttribute,\n points: [],\n cornerRadius: 0,\n closePath: true\n};\n\nexport const DefaultRectAttribute: Required<IRectGraphicAttribute> = {\n ...DefaultAttribute,\n width: 0,\n height: 0,\n x1: 0,\n y1: 0,\n strokeBoundsBuffer: 0,\n cornerRadius: 0,\n cornerType: 'round'\n};\n\nexport const DefaultRect3dAttribute: Required<IRect3dGraphicAttribute> = {\n ...DefaultAttribute,\n width: 0,\n height: 0,\n x1: 0,\n y1: 0,\n cornerRadius: 0,\n length: 0,\n cornerType: 'round'\n};\n\nexport const DefaultSymbolAttribute: Required<ISymbolGraphicAttribute> = {\n ...DefaultAttribute,\n symbolType: 'circle',\n size: 10, // 外接**正方形**的边长\n keepDirIn3d: true,\n clipRange: 1\n};\n\nexport const DefaultTextAttribute: Required<ITextGraphicAttribute> = {\n ...DefaultAttribute,\n ...DefaultTextStyle,\n strokeBoundsBuffer: 0,\n keepDirIn3d: true\n};\n\nexport const DefaultRichTextAttribute: Required<IRichTextGraphicAttribute> = {\n ...DefaultAttribute,\n ...DefaultTextStyle,\n upgradeAttrs: null,\n editable: false,\n editOptions: null,\n ascentDescentMode: 'actual',\n width: 300,\n height: 300,\n ellipsis: true,\n wordBreak: 'break-word' as RichTextWordBreak,\n verticalDirection: 'top' as RichTextVerticalDirection,\n textAlign: 'left' as RichTextGlobalAlignType,\n textBaseline: 'top' as RichTextGlobalBaselineType,\n layoutDirection: 'horizontal',\n textConfig: [],\n disableAutoWrapLine: false,\n maxHeight: undefined,\n maxWidth: undefined,\n singleLine: false\n};\n\nexport const DefaultImageAttribute: Required<IImageGraphicAttribute> = {\n repeatX: 'no-repeat',\n repeatY: 'no-repeat',\n image: '',\n width: 0,\n height: 0,\n maxWidth: 500,\n maxHeight: 500,\n ...DefaultAttribute,\n fill: true,\n cornerRadius: 0,\n cornerType: 'round'\n};\n\nexport const DefaultRichTextIconAttribute: Required<IRichTextIconGraphicAttribute> = {\n ...DefaultImageAttribute,\n backgroundShowMode: 'never',\n backgroundWidth: 0,\n backgroundHeight: 0,\n textAlign: 'left',\n textBaseline: 'middle',\n direction: 'horizontal',\n margin: 0,\n id: '',\n\n width: 20,\n height: 20,\n backgroundFill: 'rgba(101, 117, 168, 0.1)',\n backgroundFillOpacity: 1,\n backgroundStroke: false,\n backgroundStrokeOpacity: 1,\n backgroundRadius: 4,\n opacity: 1\n};\n"]}
1
+ {"version":3,"sources":["../src/graphic/config.ts"],"names":[],"mappings":";;;AACA,6CAAuD;AACvD,2DAAuD;AACvD,4CAgCsB;AAET,QAAA,aAAa,GAAY;IACpC,SAAS,EAAE,MAAM;CAClB,CAAC;AAEW,QAAA,gBAAgB,GAAe;IAC1C,CAAC,EAAE,CAAC;IACJ,CAAC,EAAE,CAAC;IACJ,CAAC,EAAE,CAAC;IACJ,EAAE,EAAE,CAAC;IACL,EAAE,EAAE,CAAC;IACL,EAAE,EAAE,CAAC;IACL,OAAO,EAAE,CAAC;IACV,OAAO,EAAE,CAAC;IACV,MAAM,EAAE,CAAC;IACT,MAAM,EAAE,CAAC;IACT,MAAM,EAAE,CAAC;IACT,KAAK,EAAE,CAAC;IACR,KAAK,EAAE,CAAC;IACR,IAAI,EAAE,CAAC;IACP,WAAW,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;IACnB,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;IACd,QAAQ,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;IAChB,UAAU,EAAE,IAAI,eAAM,EAAE;CACzB,CAAC;AAEW,QAAA,gBAAgB,GAAe;IAC1C,WAAW,EAAE,CAAC;IACd,IAAI,EAAE,KAAK;IACX,UAAU,EAAE,CAAC;IACb,WAAW,EAAE,OAAO;IACpB,aAAa,EAAE,CAAC;IAChB,aAAa,EAAE,CAAC;CACjB,CAAC;AAEF,MAAM,YAAY,GAAsD;IACtE,aAAa,EAAE,CAAC;IAChB,QAAQ,EAAE,EAAE;IACZ,cAAc,EAAE,CAAC;IACjB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AW,EACpB,KAAK,EAAE,EAAE,EACT,KAAK,EAAE,CAAC,EACR,MAAM,EAAE,CAAC,EACT,QAAQ,EAAE,GAAG,EACb,SAAS,EAAE,GAAG,IACX,wBAAgB,KACnB,IAAI,EAAE,IAAI,EACV,YAAY,EAAE,CAAC,EACf,UAAU,EAAE,OAAO,IACnB;AAEW,QAAA,4BAA4B,mCACpC,6BAAqB,KACxB,kBAAkB,EAAE,OAAO,EAC3B,eAAe,EAAE,CAAC,EAClB,gBAAgB,EAAE,CAAC,EACnB,SAAS,EAAE,MAAM,EACjB,YAAY,EAAE,QAAQ,EACtB,SAAS,EAAE,YAAY,EACvB,MAAM,EAAE,CAAC,EACT,EAAE,EAAE,EAAE,EAEN,KAAK,EAAE,EAAE,EACT,MAAM,EAAE,EAAE,EACV,cAAc,EAAE,0BAA0B,EAC1C,qBAAqB,EAAE,CAAC,EACxB,gBAAgB,EAAE,KAAK,EACvB,uBAAuB,EAAE,CAAC,EAC1B,gBAAgB,EAAE,CAAC,EACnB,OAAO,EAAE,CAAC,IACV","file":"config.js","sourcesContent":["// 存放公共属性\nimport { Logger, Matrix, pi2 } from '@visactor/vutils';\nimport { CustomPath2D } from '../common/custom-path2d';\nimport {\n type IArcGraphicAttribute,\n type IAreaGraphicAttribute,\n type IGraphicAttribute,\n type ICircleGraphicAttribute,\n type IFillStyle,\n type IGlyphGraphicAttribute,\n type IGroupGraphicAttribute,\n type IImageGraphicAttribute,\n type ILineGraphicAttribute,\n type IPathGraphicAttribute,\n type IPolygonGraphicAttribute,\n type IRect3dGraphicAttribute,\n type IRectGraphicAttribute,\n type IStrokeStyle,\n type IGraphicStyle,\n type ISymbolGraphicAttribute,\n type ITextAttribute,\n type ITextGraphicAttribute,\n type IRichTextGraphicAttribute,\n type ITransform,\n type RichTextWordBreak,\n type RichTextVerticalDirection,\n type RichTextGlobalAlignType,\n type RichTextGlobalBaselineType,\n type IRichTextIconGraphicAttribute,\n type IStarGraphicAttribute,\n type IConnectedStyle,\n type ILayout,\n type IDebugType,\n type IPickStyle,\n MeasureModeEnum\n} from '../interface';\n\nexport const DefaultLayout: ILayout = {\n alignSelf: 'auto'\n};\n\nexport const DefaultTransform: ITransform = {\n x: 0,\n y: 0,\n z: 0,\n dx: 0,\n dy: 0,\n dz: 0,\n scrollX: 0,\n scrollY: 0,\n scaleX: 1,\n scaleY: 1,\n scaleZ: 1,\n angle: 0,\n alpha: 0,\n beta: 0,\n scaleCenter: [0, 0],\n anchor: [0, 0],\n anchor3d: [0, 0],\n postMatrix: new Matrix()\n};\n\nexport const DefaultFillStyle: IFillStyle = {\n fillOpacity: 1,\n fill: false,\n shadowBlur: 0,\n shadowColor: 'black',\n shadowOffsetX: 0,\n shadowOffsetY: 0\n};\n\nconst commonStroke: Omit<IStrokeStyle, 'outerBorder' | 'innerBorder'> = {\n strokeOpacity: 1,\n lineDash: [],\n lineDashOffset: 0,\n lineWidth: 1,\n lineCap: 'butt',\n lineJoin: 'miter',\n miterLimit: 10,\n strokeBoundsBuffer: 2,\n stroke: false\n};\n\nexport const DefaultStrokeStyle: IStrokeStyle = {\n outerBorder: { ...commonStroke, distance: 0 },\n innerBorder: { ...commonStroke, distance: 0 },\n ...commonStroke\n};\n\nexport const DefaultTextStyle: Required<ITextAttribute> = {\n text: '',\n maxLineWidth: Infinity,\n maxWidth: Infinity,\n textAlign: 'left',\n textBaseline: 'alphabetic',\n fontSize: 16,\n // @ts-ignore\n fontFamily: `PingFang SC,Microsoft Yahei,system-ui,-apple-system,segoe ui,\n Roboto,Helvetica,Arial,sans-serif, apple color emoji,segoe ui emoji,segoe ui symbol`,\n fontWeight: '',\n ellipsis: '…',\n fontVariant: '',\n fontStyle: '',\n lineHeight: undefined,\n underline: 0,\n lineThrough: 0,\n scaleIn3d: false,\n direction: 'horizontal',\n wordBreak: 'break-all',\n ignoreBuf: false,\n verticalMode: 0,\n wrap: false,\n whiteSpace: 'no-wrap',\n heightLimit: Infinity,\n lineClamp: Infinity,\n suffixPosition: 'end',\n underlineDash: [],\n underlineOffset: 0,\n disableAutoClipedPoptip: undefined,\n measureMode: MeasureModeEnum.fontBounding,\n keepCenterInLine: false\n};\n\nexport const DefaultPickStyle: IPickStyle = {\n pickStrokeBuffer: 0\n};\n\nexport const DefaultStyle: IGraphicStyle = {\n forceBoundsWidth: undefined,\n forceBoundsHeight: undefined,\n opacity: 1,\n background: null,\n autoAnimateTexture: false,\n textureRatio: 1,\n textureOptions: null,\n backgroundOpacity: 1,\n backgroundCornerRadius: 0,\n texture: null,\n textureColor: 'black',\n textureSize: 10,\n texturePadding: 2,\n backgroundMode: 'no-repeat',\n backgroundFit: true,\n backgroundKeepAspectRatio: false,\n backgroundClip: true,\n backgroundScale: 1,\n backgroundOffsetX: 0,\n backgroundOffsetY: 0,\n blur: 0,\n filter: '',\n cursor: null,\n html: null,\n react: null,\n vue: null,\n ...DefaultFillStyle,\n ...DefaultStrokeStyle,\n ...DefaultLayout,\n ...DefaultPickStyle\n};\n\nexport const DefaultConnectAttribute: Required<IConnectedStyle> = {\n connectedType: 'none',\n // connectedStyle: {\n // stroke: DefaultStrokeStyle.stroke,\n // strokeOpacity: DefaultStrokeStyle.strokeOpacity,\n // lineDash: DefaultStrokeStyle.lineDash,\n // lineDashOffset: DefaultStrokeStyle.lineDashOffset,\n // lineCap: DefaultStrokeStyle.lineCap,\n // lineJoin: DefaultStrokeStyle.lineJoin,\n // lineWidth: DefaultStrokeStyle.lineWidth,\n // fill: DefaultFillStyle.fill,\n // fillOpacity: DefaultFillStyle.fillOpacity\n // },\n connectedStyle: {}, // 默认全都继承父属性\n connectedX: NaN,\n connectedY: NaN\n} as IConnectedStyle;\n\nexport const DefaultDebugAttribute: Required<IDebugType> = {\n _debug_bounds: false\n};\n\nexport const DefaultAttribute: Required<IGraphicAttribute> = {\n strokeSeg: null,\n renderable: true,\n pickable: true,\n shadowGraphic: undefined,\n childrenPickable: true,\n fillPickable: true,\n strokePickable: true,\n visible: true,\n zIndex: 0,\n layout: null,\n boundsPadding: 0,\n fillStrokeOrder: 0,\n renderStyle: 'default',\n pickMode: 'accurate',\n customPickShape: null,\n boundsMode: 'accurate',\n keepDirIn3d: true,\n shadowRootIdx: 1,\n globalZIndex: 1,\n globalCompositeOperation: '',\n overflow: 'hidden',\n shadowPickMode: 'graphic',\n keepStrokeScale: false,\n clipConfig: null,\n roughStyle: null,\n ...DefaultDebugAttribute,\n ...DefaultStyle,\n ...DefaultTransform\n};\n\nexport function addAttributeToPrototype(obj: Record<string, any>, c: any, keys: string[]) {\n keys.forEach(key => {\n c.prototype[key] = obj[key];\n });\n}\nexport function rewriteProto(obj: Record<string, any>, c: Record<string, any>) {\n Object.setPrototypeOf(obj, c);\n}\n\nexport const DefaultArcAttribute: Required<IArcGraphicAttribute> = {\n ...DefaultAttribute,\n startAngle: 0,\n endAngle: pi2,\n innerRadius: 0,\n outerRadius: 1,\n innerPadding: 0,\n outerPadding: 0,\n cornerRadius: 0,\n padRadius: 0,\n padAngle: 0,\n cap: false,\n forceShowCap: false\n};\n\nexport const DefaultAreaAttribute: Required<IAreaGraphicAttribute> = {\n ...DefaultAttribute,\n ...DefaultConnectAttribute,\n points: [],\n segments: [],\n curveType: 'linear',\n clipRange: 1,\n closePath: false,\n curveTension: 1\n};\n\nexport const DefaultCircleAttribute: Required<ICircleGraphicAttribute> = {\n ...DefaultAttribute,\n radius: 1,\n startAngle: 0,\n endAngle: pi2\n};\n\nexport const DefaultGroupAttribute: Required<IGroupGraphicAttribute> = {\n ...DefaultAttribute,\n width: 0,\n height: 0,\n cornerRadius: 0,\n path: [],\n clip: false,\n visibleAll: true,\n display: 'relative',\n flexDirection: 'row',\n flexWrap: 'wrap',\n justifyContent: 'flex-start',\n alignItems: 'flex-start',\n alignContent: 'flex-start',\n baseOpacity: 1,\n cornerType: 'round'\n // 默认是0,不需要主题\n // drawMode: 0\n} as any;\n\nexport const DefaultGlyphAttribute: Required<IGlyphGraphicAttribute> = {\n ...DefaultAttribute,\n path: '',\n width: 0,\n height: 0,\n cornerRadius: 0,\n clip: false\n};\n\nexport const DefaultLineAttribute: Required<ILineGraphicAttribute> = {\n ...DefaultAttribute,\n ...DefaultConnectAttribute,\n points: [],\n segments: [],\n curveType: 'linear',\n clipRange: 1,\n clipRangeByDimension: 'default',\n closePath: false,\n curveTension: 1\n};\n\nexport const DefaultPathAttribute: Required<IPathGraphicAttribute> = {\n ...DefaultAttribute,\n path: new CustomPath2D(),\n fillStrokeOrder: 1,\n clipRange: 1,\n customPath: () => {\n Logger.getInstance().warn('空函数');\n }\n};\n\nexport const DefaultPolygonAttribute: Required<IPolygonGraphicAttribute> = {\n ...DefaultAttribute,\n points: [],\n cornerRadius: 0,\n closePath: true\n};\n\nexport const DefaultStarAttribute: Required<IStarGraphicAttribute> = {\n ...DefaultAttribute,\n width: 100,\n height: 100,\n spikes: 5,\n thickness: 0.5\n};\n\nexport const DefaultRectAttribute: Required<IRectGraphicAttribute> = {\n ...DefaultAttribute,\n width: 0,\n height: 0,\n x1: 0,\n y1: 0,\n strokeBoundsBuffer: 0,\n cornerRadius: 0,\n cornerType: 'round'\n};\n\nexport const DefaultRect3dAttribute: Required<IRect3dGraphicAttribute> = {\n ...DefaultAttribute,\n width: 0,\n height: 0,\n x1: 0,\n y1: 0,\n cornerRadius: 0,\n length: 0,\n cornerType: 'round'\n};\n\nexport const DefaultSymbolAttribute: Required<ISymbolGraphicAttribute> = {\n ...DefaultAttribute,\n symbolType: 'circle',\n size: 10, // 外接**正方形**的边长\n keepDirIn3d: true,\n clipRange: 1\n};\n\nexport const DefaultTextAttribute: Required<ITextGraphicAttribute> = {\n ...DefaultAttribute,\n ...DefaultTextStyle,\n strokeBoundsBuffer: 0,\n keepDirIn3d: true\n};\n\nexport const DefaultRichTextAttribute: Required<IRichTextGraphicAttribute> = {\n ...DefaultAttribute,\n ...DefaultTextStyle,\n upgradeAttrs: null,\n editable: false,\n editOptions: null,\n ascentDescentMode: 'actual',\n width: 300,\n height: 300,\n ellipsis: true,\n wordBreak: 'break-word' as RichTextWordBreak,\n verticalDirection: 'top' as RichTextVerticalDirection,\n textAlign: 'left' as RichTextGlobalAlignType,\n textBaseline: 'top' as RichTextGlobalBaselineType,\n layoutDirection: 'horizontal',\n textConfig: [],\n disableAutoWrapLine: false,\n maxHeight: undefined,\n maxWidth: undefined,\n singleLine: false\n};\n\nexport const DefaultImageAttribute: Required<IImageGraphicAttribute> = {\n repeatX: 'no-repeat',\n repeatY: 'no-repeat',\n image: '',\n width: 0,\n height: 0,\n maxWidth: 500,\n maxHeight: 500,\n ...DefaultAttribute,\n fill: true,\n cornerRadius: 0,\n cornerType: 'round'\n};\n\nexport const DefaultRichTextIconAttribute: Required<IRichTextIconGraphicAttribute> = {\n ...DefaultImageAttribute,\n backgroundShowMode: 'never',\n backgroundWidth: 0,\n backgroundHeight: 0,\n textAlign: 'left',\n textBaseline: 'middle',\n direction: 'horizontal',\n margin: 0,\n id: '',\n\n width: 20,\n height: 20,\n backgroundFill: 'rgba(101, 117, 168, 0.1)',\n backgroundFillOpacity: 1,\n backgroundStroke: false,\n backgroundStrokeOpacity: 1,\n backgroundRadius: 4,\n opacity: 1\n};\n"]}
@@ -12,6 +12,7 @@ export declare const PYRAMID3D_NUMBER_TYPE: number;
12
12
  export declare const RECT_NUMBER_TYPE: number;
13
13
  export declare const RECT3D_NUMBER_TYPE: number;
14
14
  export declare const RICHTEXT_NUMBER_TYPE: number;
15
+ export declare const STAR_NUMBER_TYPE: number;
15
16
  export declare const SYMBOL_NUMBER_TYPE: number;
16
17
  export declare const TEXT_NUMBER_TYPE: number;
17
18
  export declare const GraphicService: unique symbol;
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: !0
5
- }), exports.SVG_PARSE_ATTRIBUTE_MAP_KEYS = exports.SVG_PARSE_ATTRIBUTE_MAP = exports.SVG_ATTRIBUTE_MAP_KEYS = exports.SVG_ATTRIBUTE_MAP = exports.GraphicCreator = exports.GraphicService = exports.TEXT_NUMBER_TYPE = exports.SYMBOL_NUMBER_TYPE = exports.RICHTEXT_NUMBER_TYPE = exports.RECT3D_NUMBER_TYPE = exports.RECT_NUMBER_TYPE = exports.PYRAMID3D_NUMBER_TYPE = exports.POLYGON_NUMBER_TYPE = exports.PATH_NUMBER_TYPE = exports.LINE_NUMBER_TYPE = exports.IMAGE_NUMBER_TYPE = exports.GROUP_NUMBER_TYPE = exports.GLYPH_NUMBER_TYPE = exports.CIRCLE_NUMBER_TYPE = exports.AREA_NUMBER_TYPE = exports.ARC3D_NUMBER_TYPE = exports.ARC_NUMBER_TYPE = void 0;
5
+ }), exports.SVG_PARSE_ATTRIBUTE_MAP_KEYS = exports.SVG_PARSE_ATTRIBUTE_MAP = exports.SVG_ATTRIBUTE_MAP_KEYS = exports.SVG_ATTRIBUTE_MAP = exports.GraphicCreator = exports.GraphicService = exports.TEXT_NUMBER_TYPE = exports.SYMBOL_NUMBER_TYPE = exports.STAR_NUMBER_TYPE = exports.RICHTEXT_NUMBER_TYPE = exports.RECT3D_NUMBER_TYPE = exports.RECT_NUMBER_TYPE = exports.PYRAMID3D_NUMBER_TYPE = exports.POLYGON_NUMBER_TYPE = exports.PATH_NUMBER_TYPE = exports.LINE_NUMBER_TYPE = exports.IMAGE_NUMBER_TYPE = exports.GROUP_NUMBER_TYPE = exports.GLYPH_NUMBER_TYPE = exports.CIRCLE_NUMBER_TYPE = exports.AREA_NUMBER_TYPE = exports.ARC3D_NUMBER_TYPE = exports.ARC_NUMBER_TYPE = void 0;
6
6
 
7
7
  const tools_1 = require("./tools");
8
8
 
@@ -15,8 +15,9 @@ tools_1.genNumberType)(), exports.PATH_NUMBER_TYPE = (0, tools_1.genNumberType)(
15
15
  exports.POLYGON_NUMBER_TYPE = (0, tools_1.genNumberType)(), exports.PYRAMID3D_NUMBER_TYPE = (0,
16
16
  tools_1.genNumberType)(), exports.RECT_NUMBER_TYPE = (0, tools_1.genNumberType)(),
17
17
  exports.RECT3D_NUMBER_TYPE = (0, tools_1.genNumberType)(), exports.RICHTEXT_NUMBER_TYPE = (0,
18
- tools_1.genNumberType)(), exports.SYMBOL_NUMBER_TYPE = (0, tools_1.genNumberType)(),
19
- exports.TEXT_NUMBER_TYPE = (0, tools_1.genNumberType)(), exports.GraphicService = Symbol.for("GraphicService"),
18
+ tools_1.genNumberType)(), exports.STAR_NUMBER_TYPE = (0, tools_1.genNumberType)(),
19
+ exports.SYMBOL_NUMBER_TYPE = (0, tools_1.genNumberType)(), exports.TEXT_NUMBER_TYPE = (0,
20
+ tools_1.genNumberType)(), exports.GraphicService = Symbol.for("GraphicService"),
20
21
  exports.GraphicCreator = Symbol.for("GraphicCreator"), exports.SVG_ATTRIBUTE_MAP = {
21
22
  "stroke-linecap": "lineCap",
22
23
  "stroke-linejoin": "lineJoin",
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/graphic/constants.ts"],"names":[],"mappings":";;;AAAA,mCAAwC;AAE3B,QAAA,eAAe,GAAG,IAAA,qBAAa,GAAE,CAAC;AAClC,QAAA,iBAAiB,GAAG,IAAA,qBAAa,GAAE,CAAC;AACpC,QAAA,gBAAgB,GAAG,IAAA,qBAAa,GAAE,CAAC;AACnC,QAAA,kBAAkB,GAAG,IAAA,qBAAa,GAAE,CAAC;AACrC,QAAA,iBAAiB,GAAG,IAAA,qBAAa,GAAE,CAAC;AACpC,QAAA,iBAAiB,GAAG,IAAA,qBAAa,GAAE,CAAC;AACpC,QAAA,iBAAiB,GAAG,IAAA,qBAAa,GAAE,CAAC;AACpC,QAAA,gBAAgB,GAAG,IAAA,qBAAa,GAAE,CAAC;AACnC,QAAA,gBAAgB,GAAG,IAAA,qBAAa,GAAE,CAAC;AACnC,QAAA,mBAAmB,GAAG,IAAA,qBAAa,GAAE,CAAC;AACtC,QAAA,qBAAqB,GAAG,IAAA,qBAAa,GAAE,CAAC;AACxC,QAAA,gBAAgB,GAAG,IAAA,qBAAa,GAAE,CAAC;AACnC,QAAA,kBAAkB,GAAG,IAAA,qBAAa,GAAE,CAAC;AACrC,QAAA,oBAAoB,GAAG,IAAA,qBAAa,GAAE,CAAC;AACvC,QAAA,kBAAkB,GAAG,IAAA,qBAAa,GAAE,CAAC;AACrC,QAAA,gBAAgB,GAAG,IAAA,qBAAa,GAAE,CAAC;AAEnC,QAAA,cAAc,GAAG,MAAM,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;AAC9C,QAAA,cAAc,GAAG,MAAM,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;AAE9C,QAAA,iBAAiB,GAAG;IAC/B,gBAAgB,EAAE,SAAS;IAC3B,iBAAiB,EAAE,UAAU;IAC7B,kBAAkB,EAAE,UAAU;IAC9B,mBAAmB,EAAE,gBAAgB;IACrC,cAAc,EAAE,WAAW;IAC3B,cAAc,EAAE,aAAa;IAC7B,gBAAgB,EAAE,eAAe;CAClC,CAAC;AAEW,QAAA,sBAAsB,GAAG,MAAM,CAAC,IAAI,CAAC,yBAAiB,CAAC,CAAC;AAExD,QAAA,uBAAuB,GAAG;IACrC,gBAAgB,EAAE,SAAS;IAC3B,iBAAiB,EAAE,UAAU;IAC7B,kBAAkB,EAAE,UAAU;IAC9B,mBAAmB,EAAE,gBAAgB;IACrC,cAAc,EAAE,WAAW;IAC3B,cAAc,EAAE,aAAa;IAC7B,gBAAgB,EAAE,eAAe;IACjC,MAAM,EAAE,QAAQ;IAChB,IAAI,EAAE,MAAM;CACb,CAAC;AAEW,QAAA,4BAA4B,GAAG,MAAM,CAAC,IAAI,CAAC,+BAAuB,CAAC,CAAC","file":"constants.js","sourcesContent":["import { genNumberType } from './tools';\n\nexport const ARC_NUMBER_TYPE = genNumberType();\nexport const ARC3D_NUMBER_TYPE = genNumberType();\nexport const AREA_NUMBER_TYPE = genNumberType();\nexport const CIRCLE_NUMBER_TYPE = genNumberType();\nexport const GLYPH_NUMBER_TYPE = genNumberType();\nexport const GROUP_NUMBER_TYPE = genNumberType();\nexport const IMAGE_NUMBER_TYPE = genNumberType();\nexport const LINE_NUMBER_TYPE = genNumberType();\nexport const PATH_NUMBER_TYPE = genNumberType();\nexport const POLYGON_NUMBER_TYPE = genNumberType();\nexport const PYRAMID3D_NUMBER_TYPE = genNumberType();\nexport const RECT_NUMBER_TYPE = genNumberType();\nexport const RECT3D_NUMBER_TYPE = genNumberType();\nexport const RICHTEXT_NUMBER_TYPE = genNumberType();\nexport const SYMBOL_NUMBER_TYPE = genNumberType();\nexport const TEXT_NUMBER_TYPE = genNumberType();\n\nexport const GraphicService = Symbol.for('GraphicService');\nexport const GraphicCreator = Symbol.for('GraphicCreator');\n\nexport const SVG_ATTRIBUTE_MAP = {\n 'stroke-linecap': 'lineCap',\n 'stroke-linejoin': 'lineJoin',\n 'stroke-dasharray': 'lineDash',\n 'stroke-dashoffset': 'lineDashOffset',\n 'stroke-width': 'lineWidth',\n 'fill-opacity': 'fillOpacity',\n 'stroke-opacity': 'strokeOpacity'\n};\n\nexport const SVG_ATTRIBUTE_MAP_KEYS = Object.keys(SVG_ATTRIBUTE_MAP);\n\nexport const SVG_PARSE_ATTRIBUTE_MAP = {\n 'stroke-linecap': 'lineCap',\n 'stroke-linejoin': 'lineJoin',\n 'stroke-dasharray': 'lineDash',\n 'stroke-dashoffset': 'lineDashOffset',\n 'stroke-width': 'lineWidth',\n 'fill-opacity': 'fillOpacity',\n 'stroke-opacity': 'strokeOpacity',\n stroke: 'stroke',\n fill: 'fill'\n};\n\nexport const SVG_PARSE_ATTRIBUTE_MAP_KEYS = Object.keys(SVG_PARSE_ATTRIBUTE_MAP);\n"]}
1
+ {"version":3,"sources":["../src/graphic/constants.ts"],"names":[],"mappings":";;;AAAA,mCAAwC;AAE3B,QAAA,eAAe,GAAG,IAAA,qBAAa,GAAE,CAAC;AAClC,QAAA,iBAAiB,GAAG,IAAA,qBAAa,GAAE,CAAC;AACpC,QAAA,gBAAgB,GAAG,IAAA,qBAAa,GAAE,CAAC;AACnC,QAAA,kBAAkB,GAAG,IAAA,qBAAa,GAAE,CAAC;AACrC,QAAA,i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AAgB;IACrC,cAAc,EAAE,WAAW;IAC3B,cAAc,EAAE,aAAa;IAC7B,gBAAgB,EAAE,eAAe;IACjC,MAAM,EAAE,QAAQ;IAChB,IAAI,EAAE,MAAM;CACb,CAAC;AAEW,QAAA,4BAA4B,GAAG,MAAM,CAAC,IAAI,CAAC,+BAAuB,CAAC,CAAC","file":"constants.js","sourcesContent":["import { genNumberType } from './tools';\n\nexport const ARC_NUMBER_TYPE = genNumberType();\nexport const ARC3D_NUMBER_TYPE = genNumberType();\nexport const AREA_NUMBER_TYPE = genNumberType();\nexport const CIRCLE_NUMBER_TYPE = genNumberType();\nexport const GLYPH_NUMBER_TYPE = genNumberType();\nexport const GROUP_NUMBER_TYPE = genNumberType();\nexport const IMAGE_NUMBER_TYPE = genNumberType();\nexport const LINE_NUMBER_TYPE = genNumberType();\nexport const PATH_NUMBER_TYPE = genNumberType();\nexport const POLYGON_NUMBER_TYPE = genNumberType();\nexport const PYRAMID3D_NUMBER_TYPE = genNumberType();\nexport const RECT_NUMBER_TYPE = genNumberType();\nexport const RECT3D_NUMBER_TYPE = genNumberType();\nexport const RICHTEXT_NUMBER_TYPE = genNumberType();\nexport const STAR_NUMBER_TYPE = genNumberType();\nexport const SYMBOL_NUMBER_TYPE = genNumberType();\nexport const TEXT_NUMBER_TYPE = genNumberType();\n\nexport const GraphicService = Symbol.for('GraphicService');\nexport const GraphicCreator = Symbol.for('GraphicCreator');\n\nexport const SVG_ATTRIBUTE_MAP = {\n 'stroke-linecap': 'lineCap',\n 'stroke-linejoin': 'lineJoin',\n 'stroke-dasharray': 'lineDash',\n 'stroke-dashoffset': 'lineDashOffset',\n 'stroke-width': 'lineWidth',\n 'fill-opacity': 'fillOpacity',\n 'stroke-opacity': 'strokeOpacity'\n};\n\nexport const SVG_ATTRIBUTE_MAP_KEYS = Object.keys(SVG_ATTRIBUTE_MAP);\n\nexport const SVG_PARSE_ATTRIBUTE_MAP = {\n 'stroke-linecap': 'lineCap',\n 'stroke-linejoin': 'lineJoin',\n 'stroke-dasharray': 'lineDash',\n 'stroke-dashoffset': 'lineDashOffset',\n 'stroke-width': 'lineWidth',\n 'fill-opacity': 'fillOpacity',\n 'stroke-opacity': 'strokeOpacity',\n stroke: 'stroke',\n fill: 'fill'\n};\n\nexport const SVG_PARSE_ATTRIBUTE_MAP_KEYS = Object.keys(SVG_PARSE_ATTRIBUTE_MAP);\n"]}
@@ -7,7 +7,6 @@ Object.defineProperty(exports, "__esModule", {
7
7
  const inversify_lite_1 = require("../../common/inversify-lite"), graphic_service_1 = require("./graphic-service"), constants_1 = require("../constants"), graphic_creator_1 = require("../graphic-creator");
8
8
 
9
9
  exports.default = new inversify_lite_1.ContainerModule((bind => {
10
- bind(constants_1.GraphicService).to(graphic_service_1.DefaultGraphicService).inSingletonScope(),
11
- bind(constants_1.GraphicCreator).toConstantValue(graphic_creator_1.graphicCreator);
10
+ bind(constants_1.GraphicService).to(graphic_service_1.DefaultGraphicService), bind(constants_1.GraphicCreator).toConstantValue(graphic_creator_1.graphicCreator);
12
11
  }));
13
12
  //# sourceMappingURL=graphic-module.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/graphic/graphic-service/graphic-module.ts"],"names":[],"mappings":";;AAAA,gEAA8D;AAE9D,uDAA0D;AAC1D,4CAA8D;AAC9D,wDAAoD;AAGpD,kBAAe,IAAI,gCAAe,CAAC,IAAI,CAAC,EAAE;IACxC,IAAI,CAAC,0BAAc,CAAC,CAAC,EAAE,CAAC,uCAAqB,CAAC,CAAC,gBAAgB,EAAE,CAAC;IAElE,IAAI,CAAC,0BAAc,CAAC,CAAC,eAAe,CAAC,gCAAc,CAAC,CAAC;AACvD,CAAC,CAAC,CAAC","file":"graphic-module.js","sourcesContent":["import { ContainerModule } from '../../common/inversify-lite';\n// import { DefaultTheme } from './default-theme';\nimport { DefaultGraphicService } from './graphic-service';\nimport { GraphicCreator, GraphicService } from '../constants';\nimport { graphicCreator } from '../graphic-creator';\n// import { DefaultThemeService, Theme, ThemeServce } from './theme-service';\n\nexport default new ContainerModule(bind => {\n bind(GraphicService).to(DefaultGraphicService).inSingletonScope();\n\n bind(GraphicCreator).toConstantValue(graphicCreator);\n});\n"]}
1
+ {"version":3,"sources":["../src/graphic/graphic-service/graphic-module.ts"],"names":[],"mappings":";;AAAA,gEAA8D;AAE9D,uDAA0D;AAC1D,4CAA8D;AAC9D,wDAAoD;AAGpD,kBAAe,IAAI,gCAAe,CAAC,IAAI,CAAC,EAAE;IACxC,IAAI,CAAC,0BAAc,CAAC,CAAC,EAAE,CAAC,uCAAqB,CAAC,CAAC;IAE/C,IAAI,CAAC,0BAAc,CAAC,CAAC,eAAe,CAAC,gCAAc,CAAC,CAAC;AACvD,CAAC,CAAC,CAAC","file":"graphic-module.js","sourcesContent":["import { ContainerModule } from '../../common/inversify-lite';\n// import { DefaultTheme } from './default-theme';\nimport { DefaultGraphicService } from './graphic-service';\nimport { GraphicCreator, GraphicService } from '../constants';\nimport { graphicCreator } from '../graphic-creator';\n// import { DefaultThemeService, Theme, ThemeServce } from './theme-service';\n\nexport default new ContainerModule(bind => {\n bind(GraphicService).to(DefaultGraphicService);\n\n bind(GraphicCreator).toConstantValue(graphicCreator);\n});\n"]}
@@ -61,6 +61,10 @@ export declare abstract class Graphic<T extends Partial<IGraphicAttribute> = Par
61
61
  glyphHost?: IGraphic<IGlyphGraphicAttribute>;
62
62
  _onSetStage?: (g: IGraphic, stage: IStage, layer: ILayer) => void;
63
63
  in3dMode?: boolean;
64
+ widthWithoutTransform?: number;
65
+ heightWithoutTransform?: number;
66
+ x1WithoutTransform?: number;
67
+ y1WithoutTransform?: number;
64
68
  protected _AABBBounds: IAABBBounds;
65
69
  get AABBBounds(): IAABBBounds;
66
70
  protected _OBBBounds?: IOBBBounds;
@@ -117,6 +121,7 @@ export declare abstract class Graphic<T extends Partial<IGraphicAttribute> = Par
117
121
  shouldUpdateShape(): boolean;
118
122
  clearUpdateShapeTag(): void;
119
123
  containsPoint(x: number, y: number, mode: IContainPointMode, picker?: IPickerService): boolean;
124
+ protected setWidthHeightWithoutTransform(aabbBounds: IAABBBounds): void;
120
125
  setAttributesAndPreventAnimate(params: Partial<T>, forceUpdateTag?: boolean, context?: ISetAttributeContext): void;
121
126
  setAttributes(params: Partial<T>, forceUpdateTag?: boolean, context?: ISetAttributeContext): void;
122
127
  _setAttributes(params: Partial<T>, forceUpdateTag?: boolean, context?: ISetAttributeContext): void;
@@ -161,7 +166,7 @@ export declare abstract class Graphic<T extends Partial<IGraphicAttribute> = Par
161
166
  protected needUpdateLayout(): boolean;
162
167
  protected getAnchor(anchor: [string | number, string | number], params: {
163
168
  b?: IAABBBounds;
164
- }): [number, number];
169
+ }, resetScale?: boolean): [number, number];
165
170
  protected doUpdateLocalMatrix(): void;
166
171
  protected doUpdateGlobalMatrix(): void;
167
172
  setStage(stage?: IStage, layer?: ILayer): void;
@@ -185,4 +190,5 @@ export declare abstract class Graphic<T extends Partial<IGraphicAttribute> = Par
185
190
  protected _emitCustomEvent(type: string, context?: any): void;
186
191
  abstract getNoWorkAnimateAttr(): Record<string, number>;
187
192
  abstract clone(): IGraphic<any>;
193
+ toCustomPath(): ICustomPath2D;
188
194
  }
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: !0
5
5
  }), exports.Graphic = exports.NOWORK_ANIMATE_ATTR = exports.GRAPHIC_UPDATE_TAG_KEY = exports.PURE_STYLE_KEY = void 0;
6
6
 
7
- const vutils_1 = require("@visactor/vutils"), vutils_2 = require("@visactor/vutils"), node_tree_1 = require("./node-tree"), event_1 = require("../event"), config_1 = require("./config"), application_1 = require("../application"), custom_path2d_1 = require("../common/custom-path2d"), loader_1 = require("../resource-loader/loader"), enums_1 = require("../common/enums"), bounds_context_1 = require("../common/bounds-context"), render_command_list_1 = require("../common/render-command-list"), utils_1 = require("../common/utils"), builtin_symbol_1 = require("./builtin-symbol"), xml_1 = require("../common/xml"), constants_1 = require("./constants"), config_2 = require("../animate/config"), _tempBounds = new vutils_2.AABBBounds, tempMatrix = new vutils_2.Matrix, tempBounds = new vutils_2.AABBBounds;
7
+ const vutils_1 = require("@visactor/vutils"), vutils_2 = require("@visactor/vutils"), node_tree_1 = require("./node-tree"), event_1 = require("../event"), config_1 = require("./config"), application_1 = require("../application"), custom_path2d_1 = require("../common/custom-path2d"), loader_1 = require("../resource-loader/loader"), enums_1 = require("../common/enums"), bounds_context_1 = require("../common/bounds-context"), render_command_list_1 = require("../common/render-command-list"), utils_1 = require("../common/utils"), builtin_symbol_1 = require("./builtin-symbol"), xml_1 = require("../common/xml"), constants_1 = require("./constants"), config_2 = require("../animate/config"), canvas_1 = require("../canvas"), _tempBounds = new vutils_2.AABBBounds, tempMatrix = new vutils_2.Matrix, tempBounds = new vutils_2.AABBBounds;
8
8
 
9
9
  exports.PURE_STYLE_KEY = [ "stroke", "opacity", "strokeOpacity", "lineDash", "lineDashOffset", "lineCap", "lineJoin", "miterLimit", "fill", "fillOpacity" ],
10
10
  exports.GRAPHIC_UPDATE_TAG_KEY = [ "lineWidth", "scaleX", "scaleY", "angle", "anchor", "visible" ];
@@ -96,12 +96,13 @@ class Graphic extends node_tree_1.Node {
96
96
  this._emitCustomEvent("animate-bind", animate);
97
97
  }
98
98
  tryUpdateAABBBounds() {
99
+ var _a, _b;
99
100
  const full = "imprecise" === this.attribute.boundsMode;
100
101
  if (!this.shouldUpdateAABBBounds()) return this._AABBBounds;
101
102
  if (!this.valid) return this._AABBBounds.clear(), this._AABBBounds;
102
- application_1.application.graphicService.beforeUpdateAABBBounds(this, this.stage, !0, this._AABBBounds);
103
+ null === (_a = this.stage) || void 0 === _a || _a.graphicService.beforeUpdateAABBBounds(this, this.stage, !0, this._AABBBounds);
103
104
  const bounds = this.doUpdateAABBBounds(full);
104
- return application_1.application.graphicService.afterUpdateAABBBounds(this, this.stage, this._AABBBounds, this, !0),
105
+ return null === (_b = this.stage) || void 0 === _b || _b.graphicService.afterUpdateAABBBounds(this, this.stage, this._AABBBounds, this, !0),
105
106
  "empty" === this.attribute.boundsMode && bounds.clear(), bounds;
106
107
  }
107
108
  tryUpdateOBBBounds() {
@@ -235,6 +236,9 @@ class Graphic extends node_tree_1.Node {
235
236
  y: y
236
237
  });
237
238
  }
239
+ setWidthHeightWithoutTransform(aabbBounds) {
240
+ this.widthWithoutTransform = aabbBounds.x2 - aabbBounds.x1, this.heightWithoutTransform = aabbBounds.y2 - aabbBounds.y1;
241
+ }
238
242
  setAttributesAndPreventAnimate(params, forceUpdateTag = !1, context) {
239
243
  this.setAttributes(params, forceUpdateTag, context), this.animates && this.animates.forEach((animate => {
240
244
  Object.keys(params).forEach((key => {
@@ -383,7 +387,8 @@ class Graphic extends node_tree_1.Node {
383
387
  return this;
384
388
  }
385
389
  onAttributeUpdate(context) {
386
- context && context.skipUpdateCallback || (application_1.application.graphicService.onAttributeUpdate(this),
390
+ var _a;
391
+ context && context.skipUpdateCallback || (null === (_a = this.stage) || void 0 === _a || _a.graphicService.onAttributeUpdate(this),
387
392
  this._emitCustomEvent("afterAttributeUpdate", context));
388
393
  }
389
394
  update(d) {
@@ -405,7 +410,7 @@ class Graphic extends node_tree_1.Node {
405
410
  keys.forEach((key => {
406
411
  noWorkAttrs[key] ? (noAnimateAttrs || (noAnimateAttrs = {}), noAnimateAttrs[key] = attrs[key]) : animateAttrs[key] = isClear && void 0 === attrs[key] ? this.getDefaultAttribute(key) : attrs[key];
407
412
  }));
408
- const stateAnimateConfig = null !== (_b = null !== (_a = this.context.stateAnimateConfig) && void 0 !== _a ? _a : this.stateAnimateConfig) && void 0 !== _b ? _b : config_2.DefaultStateAnimateConfig;
413
+ const stateAnimateConfig = null !== (_b = null !== (_a = this.context && this.context.stateAnimateConfig) && void 0 !== _a ? _a : this.stateAnimateConfig) && void 0 !== _b ? _b : config_2.DefaultStateAnimateConfig;
409
414
  this.applyAnimationState([ "state" ], [ {
410
415
  name: "state",
411
416
  animation: {
@@ -514,19 +519,12 @@ class Graphic extends node_tree_1.Node {
514
519
  needUpdateLayout() {
515
520
  return !!(this._updateTag & enums_1.UpdateTag.UPDATE_LAYOUT);
516
521
  }
517
- getAnchor(anchor, params) {
522
+ getAnchor(anchor, params, resetScale) {
518
523
  const _anchor = [ 0, 0 ], getBounds = () => {
519
524
  if (params.b) return params.b;
520
- const {scaleX: scaleX, scaleY: scaleY, angle: angle} = this.attribute;
521
- return tempBounds.copy(this._AABBBounds), this.setAttributes({
522
- scaleX: 1,
523
- scaleY: 1,
524
- angle: 0
525
- }), params.b = this.AABBBounds.clone(), this._AABBBounds.copy(tempBounds), this.setAttributes({
526
- scaleX: scaleX,
527
- scaleY: scaleY,
528
- angle: angle
529
- }), params.b;
525
+ const graphic = this.clone();
526
+ return graphic.attribute.angle = 0, graphic.attribute.scaleCenter = null, resetScale && (graphic.attribute.scaleX = 1,
527
+ graphic.attribute.scaleY = 1), params.b = graphic.AABBBounds, params.b;
530
528
  };
531
529
  if ("string" == typeof anchor[0]) {
532
530
  const ratio = parseFloat(anchor[0]) / 100, bounds = getBounds();
@@ -542,11 +540,11 @@ class Graphic extends node_tree_1.Node {
542
540
  const {x: x = config_1.DefaultTransform.x, y: y = config_1.DefaultTransform.y, scaleX: scaleX = config_1.DefaultTransform.scaleX, scaleY: scaleY = config_1.DefaultTransform.scaleY, angle: angle = config_1.DefaultTransform.angle, scaleCenter: scaleCenter, anchor: anchor, postMatrix: postMatrix} = this.attribute;
543
541
  let _anchor = [ 0, 0 ];
544
542
  const params = {};
545
- if (anchor && (_anchor = this.getAnchor(anchor, params)), !scaleCenter || 1 === scaleX && 1 === scaleY) (0,
543
+ if (anchor && angle && (_anchor = this.getAnchor(anchor, params)), !scaleCenter || 1 === scaleX && 1 === scaleY) (0,
546
544
  vutils_2.normalTransform)(this._transMatrix, this._transMatrix.reset(), x, y, scaleX, scaleY, angle, anchor && _anchor); else {
547
545
  const m = this._transMatrix;
548
546
  m.reset(), m.translate(_anchor[0], _anchor[1]), m.rotate(angle), m.translate(-_anchor[0], -_anchor[1]),
549
- m.translate(x, y), _anchor = this.getAnchor(scaleCenter, params), application_1.application.transformUtil.fromMatrix(m, m).scale(scaleX, scaleY, {
547
+ m.translate(x, y), _anchor = this.getAnchor(scaleCenter, params, !0), application_1.application.transformUtil.fromMatrix(m, m).scale(scaleX, scaleY, {
550
548
  x: _anchor[0],
551
549
  y: _anchor[1]
552
550
  });
@@ -565,6 +563,7 @@ class Graphic extends node_tree_1.Node {
565
563
  }
566
564
  }
567
565
  setStage(stage, layer) {
566
+ var _a;
568
567
  if (this.stage !== stage) {
569
568
  if (this.stage = stage, this.layer = layer, this.setStageToShadowRoot(stage, layer),
570
569
  this.animates && this.animates.size) {
@@ -573,7 +572,7 @@ class Graphic extends node_tree_1.Node {
573
572
  a.timeline.isGlobal && (a.setTimeline(timeline), timeline.addAnimate(a));
574
573
  }));
575
574
  }
576
- this._onSetStage && this._onSetStage(this, stage, layer), application_1.application.graphicService.onSetStage(this, stage);
575
+ this._onSetStage && this._onSetStage(this, stage, layer), null === (_a = this.stage) || void 0 === _a || _a.graphicService.onSetStage(this, stage);
577
576
  }
578
577
  }
579
578
  setStageToShadowRoot(stage, layer) {
@@ -667,6 +666,15 @@ class Graphic extends node_tree_1.Node {
667
666
  this.dispatchEvent(changeEvent);
668
667
  }
669
668
  }
669
+ toCustomPath() {
670
+ var _a, _b, _c;
671
+ const renderer = null === (_c = null === (_b = (null === (_a = this.stage) || void 0 === _a ? void 0 : _a.renderService) || application_1.application.renderService) || void 0 === _b ? void 0 : _b.drawContribution) || void 0 === _c ? void 0 : _c.getRenderContribution(this);
672
+ if (renderer) {
673
+ const context = new canvas_1.EmptyContext2d(null, 1);
674
+ return renderer.drawShape(this, context, 0, 0, {}, {}), context.path;
675
+ }
676
+ return null;
677
+ }
670
678
  }
671
679
 
672
680
  function backgroundNotImage(image) {