@visactor/vrender-core 1.0.0-alpha.6 → 1.0.0-alpha.8

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 (48) hide show
  1. package/cjs/core/stage.d.ts +2 -1
  2. package/cjs/core/stage.js +4 -3
  3. package/cjs/core/stage.js.map +1 -1
  4. package/cjs/graphic/graphic-service/graphic-module.js +1 -2
  5. package/cjs/graphic/graphic-service/graphic-module.js.map +1 -1
  6. package/cjs/graphic/graphic.js +7 -4
  7. package/cjs/graphic/graphic.js.map +1 -1
  8. package/cjs/graphic/group.js +14 -7
  9. package/cjs/graphic/group.js.map +1 -1
  10. package/cjs/interface/stage.d.ts +2 -0
  11. package/cjs/interface/stage.js.map +1 -1
  12. package/cjs/plugins/builtin-plugin/auto-render-plugin.js +9 -8
  13. package/cjs/plugins/builtin-plugin/auto-render-plugin.js.map +1 -1
  14. package/cjs/plugins/builtin-plugin/dirty-bounds-plugin.js +14 -11
  15. package/cjs/plugins/builtin-plugin/dirty-bounds-plugin.js.map +1 -1
  16. package/cjs/plugins/builtin-plugin/flex-layout-plugin.js +13 -10
  17. package/cjs/plugins/builtin-plugin/flex-layout-plugin.js.map +1 -1
  18. package/cjs/plugins/builtin-plugin/html-attribute-plugin.js +0 -1
  19. package/cjs/plugins/builtin-plugin/html-attribute-plugin.js.map +1 -1
  20. package/cjs/plugins/builtin-plugin/incremental-auto-render-plugin.js +8 -5
  21. package/cjs/plugins/builtin-plugin/incremental-auto-render-plugin.js.map +1 -1
  22. package/cjs/render/contributions/render/draw-contribution.js +1 -1
  23. package/cjs/render/contributions/render/draw-contribution.js.map +1 -1
  24. package/dist/index.es.js +95 -59
  25. package/es/core/stage.d.ts +2 -1
  26. package/es/core/stage.js +5 -2
  27. package/es/core/stage.js.map +1 -1
  28. package/es/graphic/graphic-service/graphic-module.js +1 -1
  29. package/es/graphic/graphic-service/graphic-module.js.map +1 -1
  30. package/es/graphic/graphic.js +7 -4
  31. package/es/graphic/graphic.js.map +1 -1
  32. package/es/graphic/group.js +15 -8
  33. package/es/graphic/group.js.map +1 -1
  34. package/es/interface/stage.d.ts +2 -0
  35. package/es/interface/stage.js.map +1 -1
  36. package/es/plugins/builtin-plugin/auto-render-plugin.js +8 -8
  37. package/es/plugins/builtin-plugin/auto-render-plugin.js.map +1 -1
  38. package/es/plugins/builtin-plugin/dirty-bounds-plugin.js +13 -12
  39. package/es/plugins/builtin-plugin/dirty-bounds-plugin.js.map +1 -1
  40. package/es/plugins/builtin-plugin/flex-layout-plugin.js +12 -11
  41. package/es/plugins/builtin-plugin/flex-layout-plugin.js.map +1 -1
  42. package/es/plugins/builtin-plugin/html-attribute-plugin.js +0 -1
  43. package/es/plugins/builtin-plugin/html-attribute-plugin.js.map +1 -1
  44. package/es/plugins/builtin-plugin/incremental-auto-render-plugin.js +8 -5
  45. package/es/plugins/builtin-plugin/incremental-auto-render-plugin.js.map +1 -1
  46. package/es/render/contributions/render/draw-contribution.js +1 -1
  47. package/es/render/contributions/render/draw-contribution.js.map +1 -1
  48. package/package.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/graphic/graphic.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EACL,UAAU,EACV,MAAM,EACN,eAAe,EACf,KAAK,EACL,KAAK,EAEL,QAAQ,EACR,UAAU,EACV,QAAQ,EACR,QAAQ,EACT,MAAM,kBAAkB,CAAC;AAY1B,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAanC,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EA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,cAAc,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;YAC5C,QAAQ,CAAC,SAAS,CAAC,IAAI,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,EAAS,EAAE,EAAE,CAAC,CAAC;YACvD,OAAO,OAAO,CAAC,IAAI,CAAC;SACrB;QACD,OAAO,IAAI,CAAC;IACd,CAAC;;AA90CM,qBAAa,GAAiC,EAAE,CAAC;AAi1C1D,OAAO,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;AAE3B,SAAS,kBAAkB,CAAC,KAAU;IACpC,IAAI,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,MAAM,EAAE;QAC9B,OAAO,IAAI,CAAC;KACb;IACD,OAAO,KAAK,CAAC;AACf,CAAC","file":"graphic.js","sourcesContent":["import type { ICustomPath2D } from './../interface/path';\nimport type { Dict, IPointLike, IAABBBounds, IOBBBounds } from '@visactor/vutils';\nimport { isArray, max, OBBBounds } from '@visactor/vutils';\nimport {\n AABBBounds,\n Matrix,\n normalTransform,\n Point,\n isNil,\n has,\n isString,\n isValidUrl,\n isBase64,\n isObject\n} from '@visactor/vutils';\nimport type {\n GraphicType,\n IAnimateConfig,\n IGraphicAttribute,\n IGraphic,\n IGraphicAnimateParams,\n IGraphicJson,\n ISetAttributeContext,\n ITransform,\n GraphicReleaseStatus\n} from '../interface/graphic';\nimport { Node } from './node-tree';\nimport type {\n IAnimate,\n IAnimateTarget,\n IGlyphGraphicAttribute,\n IGroup,\n ILayer,\n IPickerService,\n IShadowRoot,\n IStage,\n IStep,\n ISymbolClass\n} from '../interface';\nimport { EventTarget, CustomEvent } from '../event';\nimport { DefaultTransform } from './config';\nimport { application } from '../application';\nimport { interpolateColor } from '../color-string/interpolate';\nimport { CustomPath2D } from '../common/custom-path2d';\nimport { ResourceLoader } from '../resource-loader/loader';\nimport { AttributeUpdateType, IContainPointMode, UpdateTag } from '../common/enums';\nimport { BoundsContext } from '../common/bounds-context';\nimport { renderCommandList } from '../common/render-command-list';\nimport { parsePadding } from '../common/utils';\nimport { builtinSymbolsMap, builtInSymbolStrMap, CustomSymbolClass } from './builtin-symbol';\nimport { isSvg, XMLParser } from '../common/xml';\nimport { SVG_PARSE_ATTRIBUTE_MAP, SVG_PARSE_ATTRIBUTE_MAP_KEYS } from './constants';\nimport { DefaultStateAnimateConfig } from '../animate/config';\nimport { EmptyContext2d } from '../canvas';\n\nconst _tempBounds = new AABBBounds();\n/**\n * pathProxy参考自zrender\n * BSD 3-Clause License\n\n Copyright (c) 2017, Baidu Inc.\n All rights reserved.\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are met:\n\n * Redistributions of source code must retain the above copyright notice, this\n list of conditions and the following disclaimer.\n\n * Redistributions in binary form must reproduce the above copyright notice,\n this list of conditions and the following disclaimer in the documentation\n and/or other materials provided with the distribution.\n\n * Neither the name of the copyright holder nor the names of its\n contributors may be used to endorse or promote products derived from\n this software without specific prior written permission.\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\n FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\n OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nconst tempMatrix = new Matrix();\nconst tempBounds = new AABBBounds();\n\nexport const PURE_STYLE_KEY = [\n 'stroke',\n 'opacity',\n 'strokeOpacity',\n 'lineDash',\n 'lineDashOffset',\n 'lineCap',\n 'lineJoin',\n 'miterLimit',\n 'fill',\n 'fillOpacity'\n];\n\nexport const GRAPHIC_UPDATE_TAG_KEY = [\n 'lineWidth',\n // 'lineCap',\n // 'lineJoin',\n // 'miterLimit',\n 'scaleX',\n 'scaleY',\n 'angle',\n 'anchor',\n 'visible'\n];\n\nconst tempConstantXYKey = ['x', 'y'];\nconst tempConstantScaleXYKey = ['scaleX', 'scaleY'];\nconst tempConstantAngleKey = ['angle'];\n\nconst point = new Point();\n\nexport const NOWORK_ANIMATE_ATTR = {\n strokeSeg: 1,\n boundsPadding: 2,\n pickMode: 1,\n boundsMode: 1,\n customPickShape: 1,\n pickable: 1,\n childrenPickable: 1,\n visible: 1,\n zIndex: 1,\n layout: 1,\n keepDirIn3d: 1,\n globalZIndex: 1,\n\n outerBorder: 1,\n innerBorder: 1,\n lineDash: 1,\n lineCap: 1,\n lineJoin: 1,\n miterLimit: 2,\n strokeBoundsBuffer: 2,\n\n scaleCenter: 1,\n anchor: 1,\n anchor3d: 1,\n postMatrix: 1,\n\n backgroundMode: 2,\n background: 1,\n texture: 1,\n cursor: 1,\n html: 1\n};\n\n// function createTrackableObject(obj: any) {\n// // const accessedProperties = new Set(); // 记录被读取的属性\n// // const modifiedProperties = new Set(); // 记录被设置/修改的属性\n\n// const handler = {\n// get(target: any, property: any) {\n// // accessedProperties.add(property); // 记录读取操作\n// return Reflect.get(target, property);\n// },\n// set(target: any, property: any, value: any) {\n// if (property === 'opacity' && obj.text === 'Nail polish') {\n// console.log('set', property, value);\n// }\n// // modifiedProperties.add(property); // 记录设置/修改操作\n// return Reflect.set(target, property, value);\n// }\n// };\n\n// const proxy = new Proxy(obj, handler);\n\n// // 提供方法获取被追踪的属性\n// proxy.getAccessedProperties = () => [...accessedProperties];\n// proxy.getModifiedProperties = () => [...modifiedProperties];\n\n// return proxy;\n// }\n\n/**\n * globalTransMatrix更新逻辑\n * 1. group的transform修改,会下发到所有下层group,将所有下层的tag修改\n * 2. 叶子graphic每次获取globalTransMatrix都重新计算\n * 3. 所有节点的transform修改,或者globalTransform修改,都会下发到自己的shadowRoot上\n */\n\nexport abstract class Graphic<T extends Partial<IGraphicAttribute> = Partial<IGraphicAttribute>>\n extends Node\n implements IGraphic<T>, IAnimateTarget\n{\n /**\n * Mixes all enumerable properties and methods from a source object to Element.\n * @param source - The source of properties and methods to mix in.\n */\n static mixin(source: Dict<any>): void {\n // in ES8/ES2017, this would be really easy:\n // Object.defineProperties(Element.prototype, Object.getOwnPropertyDescriptors(source));\n\n // get all the enumerable property keys\n const keys = Object.keys(source);\n\n // loop through properties\n for (let i = 0; i < keys.length; ++i) {\n const propertyName = keys[i];\n\n // Set the property using the property descriptor - this works for accessors and normal value properties\n Object.defineProperty(\n Graphic.prototype,\n propertyName,\n Object.getOwnPropertyDescriptor(source, propertyName) as PropertyDecorator\n );\n }\n }\n\n declare _events?: any;\n\n // 保存语法上下文\n declare context?: Record<string, any>;\n\n static userSymbolMap: Record<string, ISymbolClass> = {};\n\n declare onBeforeAttributeUpdate?: (\n val: any,\n attributes: Partial<T>,\n key: null | string | string[],\n context?: ISetAttributeContext\n ) => T | undefined;\n declare parent: any;\n\n declare resources?: Map<\n string | HTMLImageElement | HTMLCanvasElement,\n { state: 'init' | 'loading' | 'success' | 'fail'; data?: HTMLImageElement | HTMLCanvasElement }\n >;\n declare backgroundImg?: boolean;\n\n declare type: GraphicType;\n declare prefixed: string;\n declare numberType: number;\n declare isContainer?: boolean;\n declare valid: boolean;\n declare stage?: IStage;\n declare layer?: ILayer;\n declare incremental?: number;\n declare glyphHost?: IGraphic<IGlyphGraphicAttribute>;\n declare _onSetStage?: (g: IGraphic, stage: IStage, layer: ILayer) => void;\n // declare _beforeAttributeUpdate?: (key: string | string, value: any) => void;\n // 标记是否是在3d模式下\n declare in3dMode?: boolean;\n\n // 不考虑transform的宽高,特殊情况下会使用到\n declare widthWithoutTransform?: number;\n declare heightWithoutTransform?: number;\n declare x1WithoutTransform?: number;\n declare y1WithoutTransform?: number;\n\n // aabbBounds,所有图形都需要有,所以初始化即赋值\n protected declare _AABBBounds: IAABBBounds;\n get AABBBounds(): IAABBBounds {\n return this.tryUpdateAABBBounds();\n }\n // 具有旋转的包围盒,部分图元需要,动态初始化\n protected declare _OBBBounds?: IOBBBounds;\n get OBBBounds(): IOBBBounds {\n return this.tryUpdateOBBBounds();\n }\n protected declare _globalAABBBounds: IAABBBounds;\n // 全局包围盒,部分图元需要,动态初始化,建议使用AABBBounds\n get globalAABBBounds(): IAABBBounds {\n return this.tryUpdateGlobalAABBBounds();\n }\n protected declare _transMatrix: Matrix;\n get transMatrix(): Matrix {\n return this.tryUpdateLocalTransMatrix(true);\n }\n protected declare _globalTransMatrix: Matrix;\n get globalTransMatrix(): Matrix {\n return this.tryUpdateGlobalTransMatrix(true);\n }\n protected declare _updateTag: number;\n\n // 上次更新的stamp\n declare stamp?: number;\n\n declare attribute: T;\n\n declare shadowRoot?: IShadowRoot;\n\n declare releaseStatus?: GraphicReleaseStatus;\n\n /** 记录state对应的图形属性 */\n declare states?: Record<string, Partial<T>>;\n /** 当前state值 */\n declare currentStates?: string[];\n /** TODO: state更新对应的动画配置 */\n declare stateAnimateConfig?: IAnimateConfig;\n /** 记录应用state之前,attribute对应的原始图形属性 */\n declare normalAttrs?: Partial<T>;\n /** 获取state图形属性的方法 */\n declare stateProxy?: (stateName: string, targetStates?: string[]) => T;\n declare animates: Map<string | number, IAnimate>;\n\n declare animate?: () => IAnimate;\n\n // declare nextAttrs?: T;\n // declare prevAttrs?: T;\n // declare finalAttrs?: T;\n\n declare pathProxy?: ICustomPath2D;\n // 依附于某个theme,如果该节点不存在parent,那么这个Theme就作为节点的Theme,避免添加到节点前计算属性\n declare attachedThemeGraphic?: IGraphic;\n protected updateAABBBoundsStamp: number;\n protected updateOBBBoundsStamp?: number;\n declare clipPathMap?: Map<string, ISymbolClass>;\n\n constructor(params: T = {} as T) {\n super();\n this._AABBBounds = new AABBBounds();\n this._updateTag = UpdateTag.INIT;\n this.attribute = params;\n this.valid = this.isValid();\n this.updateAABBBoundsStamp = 0;\n if (params.background) {\n this.loadImage((params.background as any).background ?? params.background, true);\n } else if (params.shadowGraphic) {\n this.setShadowGraphic(params.shadowGraphic);\n }\n // this.attribute = createTrackableObject(this.attribute);\n }\n\n getAttributes(): T {\n return this.attribute;\n }\n\n setMode(mode: '2d' | '3d') {\n mode === '3d' ? this.set3dMode() : this.set2dMode();\n }\n\n set3dMode() {\n this.in3dMode = true;\n }\n set2dMode() {\n this.in3dMode = false;\n }\n getOffsetXY(attr?: ITransform, includeScroll: boolean = false) {\n const { dx = attr.dx, dy = attr.dy } = this.attribute;\n if (includeScroll && this.parent) {\n // const groupTheme = getTheme(this.parent).group;\n const attribute = this.parent.attribute;\n point.x = dx + (attribute.scrollX ?? 0);\n point.y = dy + (attribute.scrollY ?? 0);\n } else {\n point.x = dx;\n point.y = dy;\n }\n return point;\n }\n\n onAnimateBind(animate: IAnimate) {\n this._emitCustomEvent('animate-bind', animate);\n }\n\n protected tryUpdateAABBBounds(): IAABBBounds {\n const full = this.attribute.boundsMode === 'imprecise';\n if (!this.shouldUpdateAABBBounds()) {\n return this._AABBBounds;\n }\n if (!this.valid) {\n this._AABBBounds.clear();\n return this._AABBBounds;\n }\n\n application.graphicService.beforeUpdateAABBBounds(this, this.stage, true, this._AABBBounds);\n const bounds = this.doUpdateAABBBounds(full);\n // this.addUpdateLayoutTag();\n application.graphicService.afterUpdateAABBBounds(this, this.stage, this._AABBBounds, this, true);\n\n // 直接返回空Bounds,但是前面的流程还是要走\n if (this.attribute.boundsMode === 'empty') {\n bounds.clear();\n }\n return bounds;\n }\n\n protected tryUpdateOBBBounds(): IOBBBounds {\n if (!this._OBBBounds) {\n this._OBBBounds = new OBBBounds();\n }\n // 尝试更新AABBBounds\n this.tryUpdateAABBBounds();\n // 如果AABBBounds和OBBBounds不一致,则重新计算OBBBounds\n if (this.updateOBBBoundsStamp === this.updateAABBBoundsStamp) {\n return this._OBBBounds;\n }\n this.updateOBBBoundsStamp = this.updateAABBBoundsStamp;\n if (!this.valid) {\n this._OBBBounds.clear();\n return this._OBBBounds;\n }\n\n const bounds = this.doUpdateOBBBounds();\n return bounds;\n }\n\n protected combindShadowAABBBounds(bounds: IAABBBounds) {\n // 合并shadowRoot的Bounds\n if (this.shadowRoot) {\n const b = this.shadowRoot.AABBBounds.clone();\n bounds.union(b);\n }\n }\n\n abstract getGraphicTheme(): T;\n\n protected doUpdateOBBBounds(): IOBBBounds {\n return this._OBBBounds;\n }\n\n protected abstract updateAABBBounds(\n attribute: T,\n symbolTheme: Required<T>,\n aabbBounds: IAABBBounds,\n full?: boolean\n ): IAABBBounds;\n\n getClipPath() {\n const { clipConfig } = this.attribute;\n if (!clipConfig) {\n return null;\n }\n if (!this.clipPathMap) {\n this.clipPathMap = new Map();\n }\n\n const { shape } = clipConfig;\n let path = this.clipPathMap.get(shape) || null;\n if (!path) {\n // 即使清理,避免内存溢出\n if (this.clipPathMap.size > 10) {\n this.clipPathMap.clear();\n }\n path = this.parsePath(shape);\n path && this.clipPathMap.set(shape, path);\n }\n return path;\n }\n\n parsePath(symbolType: string) {\n if (!symbolType) {\n return null;\n }\n let path = builtinSymbolsMap[symbolType];\n if (path) {\n return path;\n }\n path = Graphic.userSymbolMap[symbolType];\n if (path) {\n return path;\n }\n const _symbolType = builtInSymbolStrMap[symbolType];\n symbolType = _symbolType || symbolType;\n const valid = isSvg(symbolType);\n if (valid === true) {\n const parser = new XMLParser();\n const { svg } = parser.parse(symbolType);\n if (!svg) {\n return null;\n }\n const path = isArray(svg.path) ? svg.path : [svg.path];\n _tempBounds.clear();\n const cacheList: { path: CustomPath2D; attribute: Record<string, any> }[] = [];\n path.forEach((item: any) => {\n const cache = new CustomPath2D().fromString(item.d);\n const attribute: any = {};\n SVG_PARSE_ATTRIBUTE_MAP_KEYS.forEach(k => {\n if (item[k]) {\n (attribute as any)[(SVG_PARSE_ATTRIBUTE_MAP as any)[k]] = item[k];\n }\n });\n // 查找\n cacheList.push({\n path: cache,\n attribute\n });\n _tempBounds.union(cache.bounds);\n });\n const width = _tempBounds.width();\n const height = _tempBounds.height();\n // 规范化到1\n const maxWH = max(width, height);\n const scale = 1 / maxWH;\n cacheList.forEach(cache => cache.path.transform(0, 0, scale, scale));\n\n const _parsedPath = new CustomSymbolClass(symbolType, cacheList, true);\n Graphic.userSymbolMap[symbolType] = _parsedPath;\n return _parsedPath;\n }\n\n const cache = new CustomPath2D().fromString(symbolType);\n const width = cache.bounds.width();\n const height = cache.bounds.height();\n // 规范化到1\n const maxWH = max(width, height);\n const scale = 1 / maxWH;\n cache.transform(0, 0, scale, scale);\n const _parsedPath = new CustomSymbolClass(symbolType, cache);\n Graphic.userSymbolMap[symbolType] = _parsedPath;\n return _parsedPath;\n }\n\n protected doUpdateAABBBounds(full?: boolean): IAABBBounds {\n this.updateAABBBoundsStamp++;\n const graphicTheme = this.getGraphicTheme();\n this._AABBBounds.clear();\n const attribute = this.attribute;\n const bounds = this.updateAABBBounds(attribute, graphicTheme as Required<T>, this._AABBBounds, full) as AABBBounds;\n\n const { boundsPadding = graphicTheme.boundsPadding } = attribute;\n const paddingArray = parsePadding(boundsPadding);\n if (paddingArray) {\n bounds.expand(paddingArray);\n }\n\n this.clearUpdateBoundTag();\n return bounds;\n }\n\n updatePathProxyAABBBounds(aabbBounds: IAABBBounds): boolean {\n const path = typeof this.pathProxy === 'function' ? (this.pathProxy as any)(this.attribute) : this.pathProxy;\n if (!path) {\n return false;\n }\n const boundsContext = new BoundsContext(aabbBounds);\n renderCommandList(path.commandList, boundsContext, 0, 0);\n return true;\n }\n\n protected tryUpdateGlobalAABBBounds(): IAABBBounds {\n const b = this.AABBBounds;\n if (!this._globalAABBBounds) {\n this._globalAABBBounds = b.clone();\n } else {\n this._globalAABBBounds.setValue(b.x1, b.y1, b.x2, b.y2);\n }\n if (this._globalAABBBounds.empty()) {\n return this._globalAABBBounds;\n }\n // 使用parent的grloalAABBBounds\n // todo: 考虑是否需要性能优化\n if (this.parent) {\n this._globalAABBBounds.transformWithMatrix((this.parent as IGroup).globalTransMatrix);\n }\n return this._globalAABBBounds;\n }\n\n /**\n * 这里都是叶子节点的UpdateGlobalTransMatrix函数,只要走进来就直接计算\n * @param clearTag\n * @returns\n */\n protected tryUpdateGlobalTransMatrix(clearTag: boolean = true): Matrix {\n if (!this._globalTransMatrix) {\n this._globalTransMatrix = this.parent\n ? (this.parent as IGroup).globalTransMatrix.clone()\n : this.transMatrix.clone();\n } else if (this.parent) {\n const m = (this.parent as IGroup).globalTransMatrix;\n this._globalTransMatrix.setValue(m.a, m.b, m.c, m.d, m.e, m.f);\n }\n if (this.shouldUpdateGlobalMatrix()) {\n this.doUpdateGlobalMatrix();\n }\n return this._globalTransMatrix;\n }\n\n shouldUpdateGlobalMatrix(): boolean {\n return true;\n }\n\n protected tryUpdateLocalTransMatrix(clearTag: boolean = true) {\n if (!this._transMatrix) {\n this._transMatrix = new Matrix();\n }\n if (this.shouldUpdateLocalMatrix()) {\n this.doUpdateLocalMatrix();\n clearTag && this.clearUpdateLocalPositionTag();\n }\n return this._transMatrix;\n }\n\n shouldUpdateAABBBounds(): boolean {\n // 如果存在shadowRoot,那么判断shadowRoot是否需要更新\n if (this.shadowRoot) {\n return (\n (!!(this._updateTag & UpdateTag.UPDATE_BOUNDS) || this.shadowRoot.shouldUpdateAABBBounds()) &&\n application.graphicService.validCheck(\n this.attribute,\n this.getGraphicTheme() as Required<T>,\n this._AABBBounds,\n this\n )\n );\n }\n return (\n !!(this._updateTag & UpdateTag.UPDATE_BOUNDS) &&\n application.graphicService.validCheck(\n this.attribute,\n this.getGraphicTheme() as Required<T>,\n this._AABBBounds,\n this\n )\n );\n }\n\n // 自身变化导致的AABBBounds的变化\n shouldSelfChangeUpdateAABBBounds(): boolean {\n // 如果存在shadowRoot,那么判断shadowRoot是否需要更新\n if (this.shadowRoot) {\n return !!(this._updateTag & UpdateTag.UPDATE_BOUNDS) || this.shadowRoot.shouldUpdateAABBBounds();\n }\n return !!(this._updateTag & UpdateTag.UPDATE_BOUNDS);\n }\n\n protected shouldUpdateLocalMatrix(): boolean {\n return !!(this._updateTag & UpdateTag.UPDATE_LOCAL_MATRIX);\n }\n\n isValid(): boolean {\n const attribute = this.attribute;\n return Number.isFinite((attribute.x ?? 0) + (attribute.y ?? 0));\n }\n\n protected _validNumber(num?: number) {\n return num == null || Number.isFinite(num);\n }\n\n shouldUpdateShape(): boolean {\n return !!(this._updateTag & UpdateTag.UPDATE_SHAPE);\n }\n clearUpdateShapeTag() {\n this._updateTag &= UpdateTag.CLEAR_SHAPE;\n }\n\n /**\n * 是否包含某个点(点需要是全局坐标系)\n * @param x\n * @param y\n * @param mode\n * @returns\n */\n containsPoint(x: number, y: number, mode: IContainPointMode, picker?: IPickerService): boolean {\n if (!picker) {\n return false;\n }\n if (mode === IContainPointMode.GLOBAL) {\n // 转换x,y更精准\n const point = new Point(x, y);\n if (this.parent) {\n this.parent.globalTransMatrix.transformPoint(point, point);\n }\n x = point.x;\n y = point.y;\n }\n return picker.containsPoint(this, { x, y });\n }\n\n protected setWidthHeightWithoutTransform(aabbBounds: IAABBBounds) {\n this.widthWithoutTransform = aabbBounds.x2 - aabbBounds.x1;\n this.heightWithoutTransform = aabbBounds.y2 - aabbBounds.y1;\n }\n setAttributesAndPreventAnimate(params: Partial<T>, forceUpdateTag: boolean = false, context?: ISetAttributeContext) {\n this.setAttributes(params, forceUpdateTag, context);\n this.animates &&\n this.animates.forEach(animate => {\n Object.keys(params).forEach(key => {\n animate.preventAttr(key);\n });\n });\n }\n\n setAttributes(params: Partial<T>, forceUpdateTag: boolean = false, context?: ISetAttributeContext) {\n params =\n (this.onBeforeAttributeUpdate && this.onBeforeAttributeUpdate(params, this.attribute, null, context)) || params;\n\n if (params.background) {\n this.loadImage(params.background, true);\n } else if (params.shadowGraphic) {\n this.setShadowGraphic(params.shadowGraphic);\n }\n this._setAttributes(params, forceUpdateTag, context);\n }\n\n _setAttributes(params: Partial<T>, forceUpdateTag: boolean = false, context?: ISetAttributeContext) {\n const keys = Object.keys(params);\n for (let i = 0; i < keys.length; i++) {\n const key = keys[i];\n\n (this.attribute as any)[key] = (params as any)[key];\n }\n this.valid = this.isValid();\n // 没有设置shape&bounds的tag\n if (!this.updateShapeAndBoundsTagSetted() && (forceUpdateTag || this.needUpdateTags(keys))) {\n this.addUpdateShapeAndBoundsTag();\n } else {\n this.addUpdateBoundTag();\n }\n this.addUpdatePositionTag();\n this.addUpdateLayoutTag();\n this.onAttributeUpdate(context);\n }\n\n setAttribute(key: string, value: any, forceUpdateTag?: boolean, context?: ISetAttributeContext) {\n const params =\n this.onBeforeAttributeUpdate && this.onBeforeAttributeUpdate({ [key]: value }, this.attribute, key, context);\n if (!params) {\n if (!isNil((this.normalAttrs as any)?.[key])) {\n (this.normalAttrs as any)[key] = value;\n } else {\n (this.attribute as any)[key] = value;\n this.valid = this.isValid();\n if (!this.updateShapeAndBoundsTagSetted() && (forceUpdateTag || this.needUpdateTag(key))) {\n this.addUpdateShapeAndBoundsTag();\n } else {\n this.addUpdateBoundTag();\n }\n this.addUpdatePositionTag();\n this.addUpdateLayoutTag();\n this.onAttributeUpdate(context);\n }\n } else {\n this._setAttributes(params, forceUpdateTag, context);\n }\n if (key === 'background') {\n this.loadImage(value, true);\n } else if (key === 'shadowGraphic') {\n this.setShadowGraphic(value);\n }\n }\n\n protected needUpdateTags(keys: string[], k: string[] = GRAPHIC_UPDATE_TAG_KEY): boolean {\n for (let i = 0; i < k.length; i++) {\n const attrKey = k[i];\n if (keys.indexOf(attrKey) !== -1) {\n return true;\n }\n }\n return false;\n }\n\n protected needUpdateTag(key: string, k: string[] = GRAPHIC_UPDATE_TAG_KEY): boolean {\n for (let i = 0; i < k.length; i++) {\n const attrKey = k[i];\n if (key === attrKey) {\n return true;\n }\n }\n return false;\n }\n\n initAttributes(params: T) {\n // this.setAttributes(params, true);\n const context = { type: AttributeUpdateType.INIT };\n params =\n (this.onBeforeAttributeUpdate && this.onBeforeAttributeUpdate(params, this.attribute, null, context)) || params;\n this.attribute = params;\n if (params.background) {\n this.loadImage(params.background, true);\n } else if (params.shadowGraphic) {\n this.setShadowGraphic(params.shadowGraphic);\n }\n this._updateTag = UpdateTag.INIT;\n this.valid = this.isValid();\n this.onAttributeUpdate(context);\n }\n\n translate(x: number, y: number) {\n if (x === 0 && y === 0) {\n return this;\n }\n const context = {\n type: AttributeUpdateType.TRANSLATE\n };\n const params =\n this.onBeforeAttributeUpdate &&\n this.onBeforeAttributeUpdate({ x, y }, this.attribute, tempConstantXYKey, context);\n if (params) {\n x = params.x;\n y = params.y;\n delete params.x;\n delete params.y;\n this._setAttributes(params);\n }\n const attribute = this.attribute;\n const postMatrix = attribute.postMatrix;\n if (!postMatrix) {\n attribute.x = (attribute.x ?? DefaultTransform.x) + x;\n attribute.y = (attribute.y ?? DefaultTransform.y) + y;\n } else {\n application.transformUtil.fromMatrix(postMatrix, postMatrix).translate(x, y);\n }\n\n this.addUpdatePositionTag();\n this.addUpdateBoundTag();\n this.addUpdateLayoutTag();\n this.onAttributeUpdate(context);\n return this;\n }\n\n translateTo(x: number, y: number) {\n const attribute = this.attribute;\n if (attribute.x === x && attribute.y === y) {\n return this;\n }\n const context = {\n type: AttributeUpdateType.TRANSLATE_TO\n };\n const params =\n this.onBeforeAttributeUpdate &&\n this.onBeforeAttributeUpdate({ x, y }, this.attribute, tempConstantXYKey, context);\n if (params) {\n this._setAttributes(params, false, context);\n return this;\n }\n attribute.x = x;\n attribute.y = y;\n this.addUpdatePositionTag();\n this.addUpdateBoundTag();\n this.addUpdateLayoutTag();\n this.onAttributeUpdate(context);\n return this;\n }\n\n scale(scaleX: number, scaleY: number, scaleCenter?: IPointLike) {\n if (scaleX === 1 && scaleY === 1) {\n return this;\n }\n const context = {\n type: AttributeUpdateType.SCALE\n };\n const params =\n this.onBeforeAttributeUpdate &&\n this.onBeforeAttributeUpdate({ scaleX, scaleY, scaleCenter }, this.attribute, tempConstantScaleXYKey, context);\n if (params) {\n scaleX = params.scaleX;\n scaleY = params.scaleY;\n delete params.scaleX;\n delete params.scaleY;\n this._setAttributes(params);\n }\n const attribute = this.attribute;\n if (!scaleCenter) {\n attribute.scaleX = (attribute.scaleX ?? DefaultTransform.scaleX) * scaleX;\n attribute.scaleY = (attribute.scaleY ?? DefaultTransform.scaleY) * scaleY;\n } else {\n let { postMatrix } = this.attribute;\n if (!postMatrix) {\n postMatrix = new Matrix();\n attribute.postMatrix = postMatrix;\n }\n application.transformUtil.fromMatrix(postMatrix, postMatrix).scale(scaleX, scaleY, scaleCenter);\n }\n this.addUpdatePositionTag();\n this.addUpdateBoundTag();\n this.addUpdateLayoutTag();\n this.onAttributeUpdate(context);\n return this;\n }\n\n scaleTo(scaleX: number, scaleY: number) {\n const attribute = this.attribute;\n if (attribute.scaleX === scaleX && attribute.scaleY === scaleY) {\n return this;\n }\n const context = {\n type: AttributeUpdateType.SCALE_TO\n };\n const params =\n this.onBeforeAttributeUpdate &&\n this.onBeforeAttributeUpdate({ scaleX, scaleY }, this.attribute, tempConstantScaleXYKey, context);\n if (params) {\n this._setAttributes(params, false, context);\n return this;\n }\n attribute.scaleX = scaleX;\n attribute.scaleY = scaleY;\n this.addUpdatePositionTag();\n this.addUpdateBoundTag();\n this.addUpdateLayoutTag();\n this.onAttributeUpdate(context);\n return this;\n }\n\n rotate(angle: number, rotateCenter?: IPointLike) {\n if (angle === 0) {\n return this;\n }\n const context = { type: AttributeUpdateType.ROTATE };\n const params =\n this.onBeforeAttributeUpdate &&\n this.onBeforeAttributeUpdate({ angle, rotateCenter }, this.attribute, tempConstantAngleKey, context);\n if (params) {\n delete params.angle;\n this._setAttributes(params, false, context);\n // return this;\n }\n const attribute = this.attribute;\n if (!rotateCenter) {\n attribute.angle = (attribute.angle ?? DefaultTransform.angle) + angle;\n } else {\n let { postMatrix } = this.attribute;\n if (!postMatrix) {\n postMatrix = new Matrix();\n attribute.postMatrix = postMatrix;\n }\n application.transformUtil.fromMatrix(postMatrix, postMatrix).rotate(angle, rotateCenter);\n }\n this.addUpdatePositionTag();\n this.addUpdateBoundTag();\n this.addUpdateLayoutTag();\n this.onAttributeUpdate(context);\n return this;\n }\n\n rotateTo(angle: number) {\n const attribute = this.attribute;\n if (attribute.angle === angle) {\n return this;\n }\n const context = {\n type: AttributeUpdateType.ROTATE_TO\n };\n const params =\n this.onBeforeAttributeUpdate &&\n this.onBeforeAttributeUpdate(angle, this.attribute, tempConstantAngleKey, context);\n if (params) {\n this._setAttributes(params, false, context);\n return this;\n }\n attribute.angle = angle;\n this.addUpdatePositionTag();\n this.addUpdateBoundTag();\n this.addUpdateLayoutTag();\n this.onAttributeUpdate(context);\n return this;\n }\n\n skewTo(b: number, c: number) {\n return this;\n }\n\n onAttributeUpdate(context?: ISetAttributeContext) {\n if (context && context.skipUpdateCallback) {\n return;\n }\n application.graphicService.onAttributeUpdate(this);\n this._emitCustomEvent('afterAttributeUpdate', context);\n }\n\n // hasListener(event: string) {\n // const prefix = this.prefixed;\n // var evt = prefix ? prefix + event : event;\n // return this._events[evt];\n // }\n\n update(d?: { bounds: boolean; trans: boolean }) {\n if (d) {\n d.bounds && this.tryUpdateAABBBounds();\n d.trans && this.tryUpdateLocalTransMatrix();\n } else {\n this.tryUpdateAABBBounds();\n this.tryUpdateLocalTransMatrix();\n }\n }\n\n hasState(stateName?: string) {\n if (!this.currentStates || !this.currentStates.length) {\n return false;\n }\n\n if (!isNil(stateName)) {\n return this.currentStates.includes(stateName);\n }\n\n return true;\n }\n getState(stateName: string) {\n return this.states?.[stateName];\n }\n\n applyStateAttrs(attrs: Partial<T>, stateNames: string[], hasAnimation?: boolean, isClear?: boolean) {\n // 应用状态的时候要停掉动画\n if (hasAnimation) {\n const keys = Object.keys(attrs);\n const noWorkAttrs = this.getNoWorkAnimateAttr();\n const animateAttrs: Partial<T> = {};\n let noAnimateAttrs: Partial<T> | undefined;\n\n keys.forEach(key => {\n if (!noWorkAttrs[key]) {\n (animateAttrs as any)[key] =\n isClear && (attrs as any)[key] === undefined ? this.getDefaultAttribute(key) : (attrs as any)[key];\n } else {\n if (!noAnimateAttrs) {\n noAnimateAttrs = {};\n }\n (noAnimateAttrs as any)[key] = (attrs as any)[key];\n }\n });\n\n const stateAnimateConfig =\n (this.context && this.context.stateAnimateConfig) ?? this.stateAnimateConfig ?? DefaultStateAnimateConfig;\n // 需要注册动画\n (this as any).applyAnimationState(\n ['state'],\n [\n {\n name: 'state',\n animation: {\n type: 'state',\n to: animateAttrs,\n duration: stateAnimateConfig.duration,\n easing: stateAnimateConfig.easing\n }\n }\n ]\n );\n // const animate = (this.animate as any)({ slience: true });\n // (animate as any).stateNames = stateNames;\n // animate.to(animateAttrs, stateAnimateConfig.duration, stateAnimateConfig.easing);\n noAnimateAttrs && this.setAttributesAndPreventAnimate(noAnimateAttrs, false, { type: AttributeUpdateType.STATE });\n // Object.assign((this as any).finalAttribute, attrs);\n } else {\n this.stopStateAnimates();\n this.setAttributesAndPreventAnimate(attrs, false, { type: AttributeUpdateType.STATE });\n }\n }\n\n updateNormalAttrs(stateAttrs: Partial<T>) {\n const newNormalAttrs = {};\n if (this.normalAttrs) {\n Object.keys(stateAttrs).forEach(key => {\n if (key in this.normalAttrs) {\n (newNormalAttrs as any)[key] = (this.normalAttrs as any)[key];\n delete (this.normalAttrs as any)[key];\n } else {\n (newNormalAttrs as any)[key] = this.getNormalAttribute(key);\n }\n });\n Object.keys(this.normalAttrs).forEach(key => {\n (stateAttrs as any)[key] = (this.normalAttrs as any)[key];\n });\n } else {\n Object.keys(stateAttrs).forEach(key => {\n (newNormalAttrs as any)[key] = this.getNormalAttribute(key);\n });\n }\n\n this.normalAttrs = newNormalAttrs;\n }\n\n protected stopStateAnimates(type: 'start' | 'end' = 'end') {\n if (this.animates) {\n this.animates.forEach(animate => {\n if ((animate as any).stateNames) {\n animate.stop(type);\n this.animates.delete(animate.id);\n }\n });\n }\n }\n\n private getNormalAttribute(key: string) {\n const value = (this.attribute as any)[key];\n\n if (this.animates) {\n // this.animates.forEach(animate => {\n // if ((animate as any).stateNames) {\n // const endProps = animate.getEndProps();\n // if (has(endProps, key)) {\n // value = endProps[key];\n // }\n // }\n // });\n // console.log(this.finalAttrs);\n return (this as any).finalAttribute?.[key];\n }\n\n return value ?? (this as any).finalAttribute?.[key];\n }\n\n clearStates(hasAnimation?: boolean) {\n if (this.hasState() && this.normalAttrs) {\n this.currentStates = [];\n this.applyStateAttrs(this.normalAttrs, this.currentStates, hasAnimation, true);\n } else {\n this.currentStates = [];\n }\n this.normalAttrs = null;\n }\n\n removeState(stateName: string | string[], hasAnimation?: boolean) {\n if (this.currentStates) {\n const filter = isArray(stateName) ? (s: string) => !stateName.includes(s) : (s: string) => s !== stateName;\n const newStates = this.currentStates.filter(filter);\n\n if (newStates.length !== this.currentStates.length) {\n this.useStates(newStates, hasAnimation);\n }\n }\n }\n\n toggleState(stateName: string, hasAnimation?: boolean) {\n if (this.hasState(stateName)) {\n this.removeState(stateName, hasAnimation);\n } else {\n const index = this.currentStates ? this.currentStates.indexOf(stateName) : -1;\n if (index < 0) {\n const nextStates = this.currentStates ? this.currentStates.slice() : [];\n nextStates.push(stateName);\n this.useStates(nextStates, hasAnimation);\n }\n }\n }\n\n addState(stateName: string, keepCurrentStates?: boolean, hasAnimation?: boolean) {\n if (\n this.currentStates &&\n this.currentStates.includes(stateName) &&\n (keepCurrentStates || this.currentStates.length === 1)\n ) {\n return;\n }\n\n const newStates =\n keepCurrentStates && this.currentStates?.length ? this.currentStates.concat([stateName]) : [stateName];\n\n this.useStates(newStates, hasAnimation);\n }\n\n useStates(states: string[], hasAnimation?: boolean) {\n if (!states.length) {\n this.clearStates(hasAnimation);\n return;\n }\n\n const isChange =\n this.currentStates?.length !== states.length ||\n states.some((stateName, index) => this.currentStates[index] !== stateName);\n\n if (!isChange) {\n return;\n }\n\n const stateAttrs = {};\n states.forEach(stateName => {\n const attrs = this.stateProxy ? this.stateProxy(stateName, states) : this.states?.[stateName];\n\n if (attrs) {\n Object.assign(stateAttrs, attrs);\n }\n });\n\n this.updateNormalAttrs(stateAttrs);\n\n this.currentStates = states;\n this.applyStateAttrs(stateAttrs, states, hasAnimation);\n }\n\n addUpdateBoundTag() {\n this._updateTag |= UpdateTag.UPDATE_BOUNDS; // for bounds\n if (this.parent) {\n this.parent.addChildUpdateBoundTag();\n }\n if (this.glyphHost) {\n this.glyphHost.addUpdateBoundTag();\n }\n }\n\n addUpdateShapeTag() {\n this._updateTag |= UpdateTag.UPDATE_SHAPE; // for shape\n }\n\n addUpdateShapeAndBoundsTag() {\n this._updateTag |= UpdateTag.UPDATE_SHAPE_AND_BOUNDS; // for shape&bounds\n if (this.parent) {\n this.parent.addChildUpdateBoundTag();\n }\n if (this.glyphHost) {\n this.glyphHost.addUpdateBoundTag();\n }\n }\n\n protected updateShapeAndBoundsTagSetted(): boolean {\n return (this._updateTag & UpdateTag.UPDATE_SHAPE_AND_BOUNDS) === UpdateTag.UPDATE_SHAPE_AND_BOUNDS;\n }\n\n protected clearUpdateBoundTag() {\n this._updateTag &= UpdateTag.CLEAR_BOUNDS;\n }\n /**\n * 更新位置tag,包括全局tag和局部tag\n */\n addUpdatePositionTag() {\n // 更新shadowRoot的全局位置\n this.shadowRoot && this.shadowRoot.addUpdateGlobalPositionTag();\n this._updateTag |= UpdateTag.UPDATE_GLOBAL_LOCAL_MATRIX;\n }\n /**\n * 更新全局位置tag\n */\n addUpdateGlobalPositionTag() {\n // 更新shadowRoot的全局位置\n this.shadowRoot && this.shadowRoot.addUpdateGlobalPositionTag();\n this._updateTag |= UpdateTag.UPDATE_GLOBAL_MATRIX;\n }\n /**\n * 清除局部位置tag\n */\n protected clearUpdateLocalPositionTag() {\n this._updateTag &= UpdateTag.CLEAR_LOCAL_MATRIX;\n }\n /**\n * 清除全局位置tag\n */\n protected clearUpdateGlobalPositionTag() {\n this._updateTag &= UpdateTag.CLEAR_GLOBAL_MATRIX;\n }\n\n addUpdateLayoutTag() {\n this._updateTag |= UpdateTag.UPDATE_LAYOUT;\n }\n\n protected clearUpdateLayoutTag() {\n this._updateTag &= UpdateTag.CLEAR_LAYOUT;\n }\n\n protected needUpdateLayout(): boolean {\n return !!(this._updateTag & UpdateTag.UPDATE_LAYOUT);\n }\n\n protected getAnchor(anchor: [string | number, string | number], params: { b?: IAABBBounds }, resetScale?: boolean) {\n const _anchor: [number, number] = [0, 0];\n const getBounds = () => {\n if (params.b) {\n return params.b;\n }\n // 拷贝一份,避免计算bounds的过程中计算matrix,然后matrix又修改了bounds\n const graphic = this.clone();\n graphic.attribute.angle = 0;\n graphic.attribute.scaleCenter = null;\n if (resetScale) {\n graphic.attribute.scaleX = 1;\n graphic.attribute.scaleY = 1;\n }\n // @ts-ignore\n // this.setAttributes({ angle: 0, scaleCenter: null });\n params.b = graphic.AABBBounds;\n\n return params.b;\n };\n if (typeof anchor[0] === 'string') {\n const ratio = parseFloat(anchor[0]) / 100;\n const bounds = getBounds();\n _anchor[0] = bounds.x1 + (bounds.x2 - bounds.x1) * ratio;\n } else {\n _anchor[0] = anchor[0];\n }\n if (typeof anchor[1] === 'string') {\n const ratio = parseFloat(anchor[1]) / 100;\n const bounds = getBounds();\n _anchor[1] = bounds.y1 + (bounds.y2 - bounds.y1) * ratio;\n } else {\n _anchor[1] = anchor[1];\n }\n\n return _anchor;\n }\n\n /**\n * 更新局部matrix的具体函数\n */\n protected doUpdateLocalMatrix() {\n const {\n x = DefaultTransform.x,\n y = DefaultTransform.y,\n scaleX = DefaultTransform.scaleX,\n scaleY = DefaultTransform.scaleY,\n angle = DefaultTransform.angle,\n scaleCenter,\n anchor,\n postMatrix\n } = this.attribute;\n let _anchor: [number, number] = [0, 0];\n const params = {};\n if (anchor && angle) {\n _anchor = this.getAnchor(anchor, params);\n }\n if (scaleCenter && (scaleX !== 1 || scaleY !== 1)) {\n const m = this._transMatrix;\n m.reset();\n m.translate(_anchor[0], _anchor[1]);\n m.rotate(angle);\n m.translate(-_anchor[0], -_anchor[1]);\n\n m.translate(x, y);\n // m.translate(scaleCenter[0] * scaleX, scaleCenter[1] * scaleY);\n // 计算bounds\n _anchor = this.getAnchor(scaleCenter, params, true);\n application.transformUtil.fromMatrix(m, m).scale(scaleX, scaleY, { x: _anchor[0], y: _anchor[1] });\n // m.translate(-scaleCenter[0], -scaleCenter[1]);\n } else {\n normalTransform(this._transMatrix, this._transMatrix.reset(), x, y, scaleX, scaleY, angle, anchor && _anchor);\n }\n const p = this.getOffsetXY(DefaultTransform);\n this._transMatrix.e += p.x;\n this._transMatrix.f += p.y;\n\n if (postMatrix) {\n const m1 = tempMatrix.setValue(\n postMatrix.a,\n postMatrix.b,\n postMatrix.c,\n postMatrix.d,\n postMatrix.e,\n postMatrix.f\n );\n const m2 = this._transMatrix;\n m1.multiply(m2.a, m2.b, m2.c, m2.d, m2.e, m2.f);\n m2.setValue(m1.a, m1.b, m1.c, m1.d, m1.e, m1.f);\n }\n }\n /**\n * 更新全局matrix的具体函数\n */\n protected doUpdateGlobalMatrix() {\n // 基于parent的matrix修改\n if (this.parent) {\n this._globalTransMatrix.multiply(\n this.transMatrix.a,\n this.transMatrix.b,\n this.transMatrix.c,\n this.transMatrix.d,\n this.transMatrix.e,\n this.transMatrix.f\n );\n const { scrollX = 0, scrollY = 0 } = this.parent.attribute;\n this._globalTransMatrix.translate(scrollX, scrollY);\n }\n }\n\n setStage(stage?: IStage, layer?: ILayer) {\n if (this.stage !== stage) {\n this.stage = stage;\n this.layer = layer;\n this.setStageToShadowRoot(stage, layer);\n if (this.animates && this.animates.size) {\n // 设置timeline为所属的stage上的timeline,但如果timeline并不是默认的timeline,就不用覆盖\n const timeline = stage.getTimeline();\n this.animates.forEach(a => {\n if (a.timeline.isGlobal) {\n a.setTimeline(timeline);\n timeline.addAnimate(a);\n }\n });\n }\n this._onSetStage && this._onSetStage(this, stage, layer);\n application.graphicService.onSetStage(this, stage);\n }\n }\n\n setStageToShadowRoot(stage?: IStage, layer?: ILayer) {\n if (this.shadowRoot) {\n this.shadowRoot.setStage(stage, layer);\n }\n }\n\n onAddStep(step: IStep) {\n return;\n }\n onStop(props?: Partial<T>): void {\n if (props) {\n this.setAttributes(props, false, { type: AttributeUpdateType.ANIMATE_END });\n }\n }\n\n getDefaultAttribute(name: string) {\n return (this.getGraphicTheme() as any)[name];\n }\n\n // 获取属性\n getComputedAttribute(name: string) {\n return (this.attribute as any)[name] ?? this.getDefaultAttribute(name);\n }\n /**\n * 添加onSetStage钩子\n * @param cb 回调函数\n * @param immediate 是否立刻执行,如果在回调添加之前stage就已经绑定,那么如果第二个参数为true就立刻执行回调\n */\n onSetStage(cb: (g: IGraphic, stage: IStage) => void, immediate: boolean = false) {\n this._onSetStage = cb;\n if (immediate && this.stage) {\n cb(this, this.stage);\n }\n }\n\n /******************** shadow graphic *********************/\n attachShadow(shadowRoot?: IShadowRoot) {\n if (shadowRoot) {\n shadowRoot.shadowHost = this;\n }\n\n this.shadowRoot = shadowRoot ?? application.graphicService.creator.shadowRoot(this);\n this.addUpdateBoundTag();\n this.shadowRoot.setStage(this.stage, this.layer);\n return this.shadowRoot;\n }\n\n detachShadow() {\n if (this.shadowRoot) {\n this.addUpdateBoundTag();\n this.shadowRoot.release(true);\n this.shadowRoot = null;\n }\n }\n\n toJson(): IGraphicJson {\n return {\n attribute: this.attribute,\n _uid: this._uid,\n type: this.type,\n name: this.name,\n children: this.children.map((item: IGraphic) => item.toJson())\n };\n }\n\n createPathProxy(path?: string) {\n if (isString(path, true)) {\n this.pathProxy = new CustomPath2D().fromString(path as string);\n } else {\n this.pathProxy = new CustomPath2D();\n }\n\n return this.pathProxy;\n }\n\n loadImage(image: any, background: boolean = false) {\n if (!image || (background && backgroundNotImage(image))) {\n return;\n }\n const url = image;\n if (!this.resources) {\n this.resources = new Map();\n }\n const cache: {\n state: 'loading' | 'success' | 'init' | 'fail';\n data: any;\n } = {\n data: 'init',\n state: null\n };\n this.resources.set(url, cache);\n if (typeof image === 'string') {\n cache.state = 'loading';\n if (image.startsWith('<svg')) {\n // TODO 封装isSvg到@visactor/vutils\n ResourceLoader.GetSvg(image, this);\n this.backgroundImg = this.backgroundImg || background;\n } else if (isValidUrl(image) || image.includes('/') || isBase64(image)) {\n ResourceLoader.GetImage(image, this);\n this.backgroundImg = this.backgroundImg || background;\n }\n } else if (isObject(image)) {\n (cache.state = 'success'), (cache.data = image);\n this.backgroundImg = this.backgroundImg || background;\n } else {\n cache.state = 'fail';\n }\n }\n\n setShadowGraphic(graphic: IGraphic) {\n if (!graphic) {\n this.detachShadow();\n } else {\n const root = this.attachShadow();\n root.add(graphic);\n }\n }\n\n imageLoadSuccess(url: string, image: HTMLImageElement, cb?: () => void) {\n // 更新属性\n // this.resourceState = 'success';\n // this.resource = image;\n if (!this.resources) {\n return;\n }\n const res = this.resources.get(url);\n if (!res) {\n return;\n }\n res.state = 'success';\n res.data = image;\n\n cb && cb();\n\n // 触发重绘\n // 暂时全量,TODO 启动局部重绘\n // this.stage.enableDirtyBounds();\n // this.stage.dirty(this.AABBBounds);\n this.addUpdateBoundTag(); // 添加bounds更新tag重绘才会绘制这个mark\n this.stage && this.stage.renderNextFrame();\n }\n\n imageLoadFail(url: string, cb?: () => void) {\n if (!this.resources) {\n return;\n }\n const res = this.resources.get(url);\n if (!res) {\n return;\n }\n res.state = 'fail';\n\n cb && cb();\n }\n\n private _stopAnimates(animates: Map<string | number, IAnimate>) {\n if (animates) {\n animates.forEach(animate => {\n animate.stop();\n });\n }\n }\n\n stopAnimates(stopChildren: boolean = false) {\n this._stopAnimates(this.animates);\n\n if (this.shadowRoot) {\n // 停止所有影子节点的动画\n this.shadowRoot.stopAnimates(true);\n }\n if (this.isContainer && stopChildren) {\n this.forEachChildren((c: IGraphic) => {\n c.stopAnimates(stopChildren);\n });\n }\n }\n\n release(): void {\n this.releaseStatus = 'released';\n this.stopAnimates();\n application.graphicService.onRelease(this);\n }\n\n protected _emitCustomEvent(type: string, context?: any) {\n if (this._events && type in this._events) {\n const changeEvent = new CustomEvent(type, context);\n changeEvent.bubbles = false;\n\n (changeEvent as any).manager = (this.stage as any)?.eventSystem?.manager;\n this.dispatchEvent(changeEvent);\n }\n }\n\n abstract getNoWorkAnimateAttr(): Record<string, number>;\n\n abstract clone(): IGraphic<any>;\n\n toCustomPath(): ICustomPath2D {\n // throw new Error('暂不支持');\n const renderer = (this.stage?.renderService || application.renderService)?.drawContribution?.getRenderContribution(\n this\n );\n if (renderer) {\n const context = new EmptyContext2d(null, 1);\n renderer.drawShape(this, context, 0, 0, {} as any, {});\n return context.path;\n }\n return null;\n }\n}\n\nGraphic.mixin(EventTarget);\n\nfunction backgroundNotImage(image: any) {\n if (image.fill || image.stroke) {\n return true;\n }\n return false;\n}\n"]}
1
+ {"version":3,"sources":["../src/graphic/graphic.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EACL,UAAU,EACV,MAAM,EACN,eAAe,EACf,KAAK,EACL,KAAK,EAEL,QAAQ,EACR,UAAU,EACV,QAAQ,EACR,QAAQ,EACT,MAAM,kBAAkB,CAAC;AAY1B,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAanC,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACpF,OAA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C5C,QAAQ,CAAC,SAAS,CAAC,IAAI,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,EAAS,EAAE,EAAE,CAAC,CAAC;YACvD,OAAO,OAAO,CAAC,IAAI,CAAC;SACrB;QACD,OAAO,IAAI,CAAC;IACd,CAAC;;AA90CM,qBAAa,GAAiC,EAAE,CAAC;AAi1C1D,OAAO,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;AAE3B,SAAS,kBAAkB,CAAC,KAAU;IACpC,IAAI,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,MAAM,EAAE;QAC9B,OAAO,IAAI,CAAC;KACb;IACD,OAAO,KAAK,CAAC;AACf,CAAC","file":"graphic.js","sourcesContent":["import type { ICustomPath2D } from './../interface/path';\nimport type { Dict, IPointLike, IAABBBounds, IOBBBounds } from '@visactor/vutils';\nimport { isArray, max, OBBBounds } from '@visactor/vutils';\nimport {\n AABBBounds,\n Matrix,\n normalTransform,\n Point,\n isNil,\n has,\n isString,\n isValidUrl,\n isBase64,\n isObject\n} from '@visactor/vutils';\nimport type {\n GraphicType,\n IAnimateConfig,\n IGraphicAttribute,\n IGraphic,\n IGraphicAnimateParams,\n IGraphicJson,\n ISetAttributeContext,\n ITransform,\n GraphicReleaseStatus\n} from '../interface/graphic';\nimport { Node } from './node-tree';\nimport type {\n IAnimate,\n IAnimateTarget,\n IGlyphGraphicAttribute,\n IGroup,\n ILayer,\n IPickerService,\n IShadowRoot,\n IStage,\n IStep,\n ISymbolClass\n} from '../interface';\nimport { EventTarget, CustomEvent } from '../event';\nimport { DefaultTransform } from './config';\nimport { application } from '../application';\nimport { interpolateColor } from '../color-string/interpolate';\nimport { CustomPath2D } from '../common/custom-path2d';\nimport { ResourceLoader } from '../resource-loader/loader';\nimport { AttributeUpdateType, IContainPointMode, UpdateTag } from '../common/enums';\nimport { BoundsContext } from '../common/bounds-context';\nimport { renderCommandList } from '../common/render-command-list';\nimport { parsePadding } from '../common/utils';\nimport { builtinSymbolsMap, builtInSymbolStrMap, CustomSymbolClass } from './builtin-symbol';\nimport { isSvg, XMLParser } from '../common/xml';\nimport { SVG_PARSE_ATTRIBUTE_MAP, SVG_PARSE_ATTRIBUTE_MAP_KEYS } from './constants';\nimport { DefaultStateAnimateConfig } from '../animate/config';\nimport { EmptyContext2d } from '../canvas';\n\nconst _tempBounds = new AABBBounds();\n/**\n * pathProxy参考自zrender\n * BSD 3-Clause License\n\n Copyright (c) 2017, Baidu Inc.\n All rights reserved.\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are met:\n\n * Redistributions of source code must retain the above copyright notice, this\n list of conditions and the following disclaimer.\n\n * Redistributions in binary form must reproduce the above copyright notice,\n this list of conditions and the following disclaimer in the documentation\n and/or other materials provided with the distribution.\n\n * Neither the name of the copyright holder nor the names of its\n contributors may be used to endorse or promote products derived from\n this software without specific prior written permission.\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\n FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\n OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\nconst tempMatrix = new Matrix();\nconst tempBounds = new AABBBounds();\n\nexport const PURE_STYLE_KEY = [\n 'stroke',\n 'opacity',\n 'strokeOpacity',\n 'lineDash',\n 'lineDashOffset',\n 'lineCap',\n 'lineJoin',\n 'miterLimit',\n 'fill',\n 'fillOpacity'\n];\n\nexport const GRAPHIC_UPDATE_TAG_KEY = [\n 'lineWidth',\n // 'lineCap',\n // 'lineJoin',\n // 'miterLimit',\n 'scaleX',\n 'scaleY',\n 'angle',\n 'anchor',\n 'visible'\n];\n\nconst tempConstantXYKey = ['x', 'y'];\nconst tempConstantScaleXYKey = ['scaleX', 'scaleY'];\nconst tempConstantAngleKey = ['angle'];\n\nconst point = new Point();\n\nexport const NOWORK_ANIMATE_ATTR = {\n strokeSeg: 1,\n boundsPadding: 2,\n pickMode: 1,\n boundsMode: 1,\n customPickShape: 1,\n pickable: 1,\n childrenPickable: 1,\n visible: 1,\n zIndex: 1,\n layout: 1,\n keepDirIn3d: 1,\n globalZIndex: 1,\n\n outerBorder: 1,\n innerBorder: 1,\n lineDash: 1,\n lineCap: 1,\n lineJoin: 1,\n miterLimit: 2,\n strokeBoundsBuffer: 2,\n\n scaleCenter: 1,\n anchor: 1,\n anchor3d: 1,\n postMatrix: 1,\n\n backgroundMode: 2,\n background: 1,\n texture: 1,\n cursor: 1,\n html: 1\n};\n\n// function createTrackableObject(obj: any) {\n// // const accessedProperties = new Set(); // 记录被读取的属性\n// // const modifiedProperties = new Set(); // 记录被设置/修改的属性\n\n// const handler = {\n// get(target: any, property: any) {\n// // accessedProperties.add(property); // 记录读取操作\n// return Reflect.get(target, property);\n// },\n// set(target: any, property: any, value: any) {\n// if (property === 'size' && !isFinite(value)) {\n// console.log('set', property, value);\n// }\n// // modifiedProperties.add(property); // 记录设置/修改操作\n// return Reflect.set(target, property, value);\n// }\n// };\n\n// const proxy = new Proxy(obj, handler);\n\n// // 提供方法获取被追踪的属性\n// // proxy.getAccessedProperties = () => [...accessedProperties];\n// // proxy.getModifiedProperties = () => [...modifiedProperties];\n\n// return proxy;\n// }\n\n/**\n * globalTransMatrix更新逻辑\n * 1. group的transform修改,会下发到所有下层group,将所有下层的tag修改\n * 2. 叶子graphic每次获取globalTransMatrix都重新计算\n * 3. 所有节点的transform修改,或者globalTransform修改,都会下发到自己的shadowRoot上\n */\n\nexport abstract class Graphic<T extends Partial<IGraphicAttribute> = Partial<IGraphicAttribute>>\n extends Node\n implements IGraphic<T>, IAnimateTarget\n{\n /**\n * Mixes all enumerable properties and methods from a source object to Element.\n * @param source - The source of properties and methods to mix in.\n */\n static mixin(source: Dict<any>): void {\n // in ES8/ES2017, this would be really easy:\n // Object.defineProperties(Element.prototype, Object.getOwnPropertyDescriptors(source));\n\n // get all the enumerable property keys\n const keys = Object.keys(source);\n\n // loop through properties\n for (let i = 0; i < keys.length; ++i) {\n const propertyName = keys[i];\n\n // Set the property using the property descriptor - this works for accessors and normal value properties\n Object.defineProperty(\n Graphic.prototype,\n propertyName,\n Object.getOwnPropertyDescriptor(source, propertyName) as PropertyDecorator\n );\n }\n }\n\n declare _events?: any;\n\n // 保存语法上下文\n declare context?: Record<string, any>;\n\n static userSymbolMap: Record<string, ISymbolClass> = {};\n\n declare onBeforeAttributeUpdate?: (\n val: any,\n attributes: Partial<T>,\n key: null | string | string[],\n context?: ISetAttributeContext\n ) => T | undefined;\n declare parent: any;\n\n declare resources?: Map<\n string | HTMLImageElement | HTMLCanvasElement,\n { state: 'init' | 'loading' | 'success' | 'fail'; data?: HTMLImageElement | HTMLCanvasElement }\n >;\n declare backgroundImg?: boolean;\n\n declare type: GraphicType;\n declare prefixed: string;\n declare numberType: number;\n declare isContainer?: boolean;\n declare valid: boolean;\n declare stage?: IStage;\n declare layer?: ILayer;\n declare incremental?: number;\n declare glyphHost?: IGraphic<IGlyphGraphicAttribute>;\n declare _onSetStage?: (g: IGraphic, stage: IStage, layer: ILayer) => void;\n // declare _beforeAttributeUpdate?: (key: string | string, value: any) => void;\n // 标记是否是在3d模式下\n declare in3dMode?: boolean;\n\n // 不考虑transform的宽高,特殊情况下会使用到\n declare widthWithoutTransform?: number;\n declare heightWithoutTransform?: number;\n declare x1WithoutTransform?: number;\n declare y1WithoutTransform?: number;\n\n // aabbBounds,所有图形都需要有,所以初始化即赋值\n protected declare _AABBBounds: IAABBBounds;\n get AABBBounds(): IAABBBounds {\n return this.tryUpdateAABBBounds();\n }\n // 具有旋转的包围盒,部分图元需要,动态初始化\n protected declare _OBBBounds?: IOBBBounds;\n get OBBBounds(): IOBBBounds {\n return this.tryUpdateOBBBounds();\n }\n protected declare _globalAABBBounds: IAABBBounds;\n // 全局包围盒,部分图元需要,动态初始化,建议使用AABBBounds\n get globalAABBBounds(): IAABBBounds {\n return this.tryUpdateGlobalAABBBounds();\n }\n protected declare _transMatrix: Matrix;\n get transMatrix(): Matrix {\n return this.tryUpdateLocalTransMatrix(true);\n }\n protected declare _globalTransMatrix: Matrix;\n get globalTransMatrix(): Matrix {\n return this.tryUpdateGlobalTransMatrix(true);\n }\n protected declare _updateTag: number;\n\n // 上次更新的stamp\n declare stamp?: number;\n\n declare attribute: T;\n\n declare shadowRoot?: IShadowRoot;\n\n declare releaseStatus?: GraphicReleaseStatus;\n\n /** 记录state对应的图形属性 */\n declare states?: Record<string, Partial<T>>;\n /** 当前state值 */\n declare currentStates?: string[];\n /** TODO: state更新对应的动画配置 */\n declare stateAnimateConfig?: IAnimateConfig;\n /** 记录应用state之前,attribute对应的原始图形属性 */\n declare normalAttrs?: Partial<T>;\n /** 获取state图形属性的方法 */\n declare stateProxy?: (stateName: string, targetStates?: string[]) => T;\n declare animates: Map<string | number, IAnimate>;\n\n declare animate?: () => IAnimate;\n\n // declare nextAttrs?: T;\n // declare prevAttrs?: T;\n // declare finalAttrs?: T;\n\n declare pathProxy?: ICustomPath2D;\n // 依附于某个theme,如果该节点不存在parent,那么这个Theme就作为节点的Theme,避免添加到节点前计算属性\n declare attachedThemeGraphic?: IGraphic;\n protected updateAABBBoundsStamp: number;\n protected updateOBBBoundsStamp?: number;\n declare clipPathMap?: Map<string, ISymbolClass>;\n\n constructor(params: T = {} as T) {\n super();\n this._AABBBounds = new AABBBounds();\n this._updateTag = UpdateTag.INIT;\n this.attribute = params;\n this.valid = this.isValid();\n this.updateAABBBoundsStamp = 0;\n if (params.background) {\n this.loadImage((params.background as any).background ?? params.background, true);\n } else if (params.shadowGraphic) {\n this.setShadowGraphic(params.shadowGraphic);\n }\n // this.attribute = createTrackableObject(this.attribute);\n }\n\n getAttributes(): T {\n return this.attribute;\n }\n\n setMode(mode: '2d' | '3d') {\n mode === '3d' ? this.set3dMode() : this.set2dMode();\n }\n\n set3dMode() {\n this.in3dMode = true;\n }\n set2dMode() {\n this.in3dMode = false;\n }\n getOffsetXY(attr?: ITransform, includeScroll: boolean = false) {\n const { dx = attr.dx, dy = attr.dy } = this.attribute;\n if (includeScroll && this.parent) {\n // const groupTheme = getTheme(this.parent).group;\n const attribute = this.parent.attribute;\n point.x = dx + (attribute.scrollX ?? 0);\n point.y = dy + (attribute.scrollY ?? 0);\n } else {\n point.x = dx;\n point.y = dy;\n }\n return point;\n }\n\n onAnimateBind(animate: IAnimate) {\n this._emitCustomEvent('animate-bind', animate);\n }\n\n protected tryUpdateAABBBounds(): IAABBBounds {\n const full = this.attribute.boundsMode === 'imprecise';\n if (!this.shouldUpdateAABBBounds()) {\n return this._AABBBounds;\n }\n if (!this.valid) {\n this._AABBBounds.clear();\n return this._AABBBounds;\n }\n\n this.stage?.graphicService.beforeUpdateAABBBounds(this, this.stage, true, this._AABBBounds);\n const bounds = this.doUpdateAABBBounds(full);\n // this.addUpdateLayoutTag();\n this.stage?.graphicService.afterUpdateAABBBounds(this, this.stage, this._AABBBounds, this, true);\n\n // 直接返回空Bounds,但是前面的流程还是要走\n if (this.attribute.boundsMode === 'empty') {\n bounds.clear();\n }\n return bounds;\n }\n\n protected tryUpdateOBBBounds(): IOBBBounds {\n if (!this._OBBBounds) {\n this._OBBBounds = new OBBBounds();\n }\n // 尝试更新AABBBounds\n this.tryUpdateAABBBounds();\n // 如果AABBBounds和OBBBounds不一致,则重新计算OBBBounds\n if (this.updateOBBBoundsStamp === this.updateAABBBoundsStamp) {\n return this._OBBBounds;\n }\n this.updateOBBBoundsStamp = this.updateAABBBoundsStamp;\n if (!this.valid) {\n this._OBBBounds.clear();\n return this._OBBBounds;\n }\n\n const bounds = this.doUpdateOBBBounds();\n return bounds;\n }\n\n protected combindShadowAABBBounds(bounds: IAABBBounds) {\n // 合并shadowRoot的Bounds\n if (this.shadowRoot) {\n const b = this.shadowRoot.AABBBounds.clone();\n bounds.union(b);\n }\n }\n\n abstract getGraphicTheme(): T;\n\n protected doUpdateOBBBounds(): IOBBBounds {\n return this._OBBBounds;\n }\n\n protected abstract updateAABBBounds(\n attribute: T,\n symbolTheme: Required<T>,\n aabbBounds: IAABBBounds,\n full?: boolean\n ): IAABBBounds;\n\n getClipPath() {\n const { clipConfig } = this.attribute;\n if (!clipConfig) {\n return null;\n }\n if (!this.clipPathMap) {\n this.clipPathMap = new Map();\n }\n\n const { shape } = clipConfig;\n let path = this.clipPathMap.get(shape) || null;\n if (!path) {\n // 即使清理,避免内存溢出\n if (this.clipPathMap.size > 10) {\n this.clipPathMap.clear();\n }\n path = this.parsePath(shape);\n path && this.clipPathMap.set(shape, path);\n }\n return path;\n }\n\n parsePath(symbolType: string) {\n if (!symbolType) {\n return null;\n }\n let path = builtinSymbolsMap[symbolType];\n if (path) {\n return path;\n }\n path = Graphic.userSymbolMap[symbolType];\n if (path) {\n return path;\n }\n const _symbolType = builtInSymbolStrMap[symbolType];\n symbolType = _symbolType || symbolType;\n const valid = isSvg(symbolType);\n if (valid === true) {\n const parser = new XMLParser();\n const { svg } = parser.parse(symbolType);\n if (!svg) {\n return null;\n }\n const path = isArray(svg.path) ? svg.path : [svg.path];\n _tempBounds.clear();\n const cacheList: { path: CustomPath2D; attribute: Record<string, any> }[] = [];\n path.forEach((item: any) => {\n const cache = new CustomPath2D().fromString(item.d);\n const attribute: any = {};\n SVG_PARSE_ATTRIBUTE_MAP_KEYS.forEach(k => {\n if (item[k]) {\n (attribute as any)[(SVG_PARSE_ATTRIBUTE_MAP as any)[k]] = item[k];\n }\n });\n // 查找\n cacheList.push({\n path: cache,\n attribute\n });\n _tempBounds.union(cache.bounds);\n });\n const width = _tempBounds.width();\n const height = _tempBounds.height();\n // 规范化到1\n const maxWH = max(width, height);\n const scale = 1 / maxWH;\n cacheList.forEach(cache => cache.path.transform(0, 0, scale, scale));\n\n const _parsedPath = new CustomSymbolClass(symbolType, cacheList, true);\n Graphic.userSymbolMap[symbolType] = _parsedPath;\n return _parsedPath;\n }\n\n const cache = new CustomPath2D().fromString(symbolType);\n const width = cache.bounds.width();\n const height = cache.bounds.height();\n // 规范化到1\n const maxWH = max(width, height);\n const scale = 1 / maxWH;\n cache.transform(0, 0, scale, scale);\n const _parsedPath = new CustomSymbolClass(symbolType, cache);\n Graphic.userSymbolMap[symbolType] = _parsedPath;\n return _parsedPath;\n }\n\n protected doUpdateAABBBounds(full?: boolean): IAABBBounds {\n this.updateAABBBoundsStamp++;\n const graphicTheme = this.getGraphicTheme();\n this._AABBBounds.clear();\n const attribute = this.attribute;\n const bounds = this.updateAABBBounds(attribute, graphicTheme as Required<T>, this._AABBBounds, full) as AABBBounds;\n\n const { boundsPadding = graphicTheme.boundsPadding } = attribute;\n const paddingArray = parsePadding(boundsPadding);\n if (paddingArray) {\n bounds.expand(paddingArray);\n }\n\n this.clearUpdateBoundTag();\n return bounds;\n }\n\n updatePathProxyAABBBounds(aabbBounds: IAABBBounds): boolean {\n const path = typeof this.pathProxy === 'function' ? (this.pathProxy as any)(this.attribute) : this.pathProxy;\n if (!path) {\n return false;\n }\n const boundsContext = new BoundsContext(aabbBounds);\n renderCommandList(path.commandList, boundsContext, 0, 0);\n return true;\n }\n\n protected tryUpdateGlobalAABBBounds(): IAABBBounds {\n const b = this.AABBBounds;\n if (!this._globalAABBBounds) {\n this._globalAABBBounds = b.clone();\n } else {\n this._globalAABBBounds.setValue(b.x1, b.y1, b.x2, b.y2);\n }\n if (this._globalAABBBounds.empty()) {\n return this._globalAABBBounds;\n }\n // 使用parent的grloalAABBBounds\n // todo: 考虑是否需要性能优化\n if (this.parent) {\n this._globalAABBBounds.transformWithMatrix((this.parent as IGroup).globalTransMatrix);\n }\n return this._globalAABBBounds;\n }\n\n /**\n * 这里都是叶子节点的UpdateGlobalTransMatrix函数,只要走进来就直接计算\n * @param clearTag\n * @returns\n */\n protected tryUpdateGlobalTransMatrix(clearTag: boolean = true): Matrix {\n if (!this._globalTransMatrix) {\n this._globalTransMatrix = this.parent\n ? (this.parent as IGroup).globalTransMatrix.clone()\n : this.transMatrix.clone();\n } else if (this.parent) {\n const m = (this.parent as IGroup).globalTransMatrix;\n this._globalTransMatrix.setValue(m.a, m.b, m.c, m.d, m.e, m.f);\n }\n if (this.shouldUpdateGlobalMatrix()) {\n this.doUpdateGlobalMatrix();\n }\n return this._globalTransMatrix;\n }\n\n shouldUpdateGlobalMatrix(): boolean {\n return true;\n }\n\n protected tryUpdateLocalTransMatrix(clearTag: boolean = true) {\n if (!this._transMatrix) {\n this._transMatrix = new Matrix();\n }\n if (this.shouldUpdateLocalMatrix()) {\n this.doUpdateLocalMatrix();\n clearTag && this.clearUpdateLocalPositionTag();\n }\n return this._transMatrix;\n }\n\n shouldUpdateAABBBounds(): boolean {\n // 如果存在shadowRoot,那么判断shadowRoot是否需要更新\n if (this.shadowRoot) {\n return (\n (!!(this._updateTag & UpdateTag.UPDATE_BOUNDS) || this.shadowRoot.shouldUpdateAABBBounds()) &&\n application.graphicService.validCheck(\n this.attribute,\n this.getGraphicTheme() as Required<T>,\n this._AABBBounds,\n this\n )\n );\n }\n return (\n !!(this._updateTag & UpdateTag.UPDATE_BOUNDS) &&\n application.graphicService.validCheck(\n this.attribute,\n this.getGraphicTheme() as Required<T>,\n this._AABBBounds,\n this\n )\n );\n }\n\n // 自身变化导致的AABBBounds的变化\n shouldSelfChangeUpdateAABBBounds(): boolean {\n // 如果存在shadowRoot,那么判断shadowRoot是否需要更新\n if (this.shadowRoot) {\n return !!(this._updateTag & UpdateTag.UPDATE_BOUNDS) || this.shadowRoot.shouldUpdateAABBBounds();\n }\n return !!(this._updateTag & UpdateTag.UPDATE_BOUNDS);\n }\n\n protected shouldUpdateLocalMatrix(): boolean {\n return !!(this._updateTag & UpdateTag.UPDATE_LOCAL_MATRIX);\n }\n\n isValid(): boolean {\n const attribute = this.attribute;\n return Number.isFinite((attribute.x ?? 0) + (attribute.y ?? 0));\n }\n\n protected _validNumber(num?: number) {\n return num == null || Number.isFinite(num);\n }\n\n shouldUpdateShape(): boolean {\n return !!(this._updateTag & UpdateTag.UPDATE_SHAPE);\n }\n clearUpdateShapeTag() {\n this._updateTag &= UpdateTag.CLEAR_SHAPE;\n }\n\n /**\n * 是否包含某个点(点需要是全局坐标系)\n * @param x\n * @param y\n * @param mode\n * @returns\n */\n containsPoint(x: number, y: number, mode: IContainPointMode, picker?: IPickerService): boolean {\n if (!picker) {\n return false;\n }\n if (mode === IContainPointMode.GLOBAL) {\n // 转换x,y更精准\n const point = new Point(x, y);\n if (this.parent) {\n this.parent.globalTransMatrix.transformPoint(point, point);\n }\n x = point.x;\n y = point.y;\n }\n return picker.containsPoint(this, { x, y });\n }\n\n protected setWidthHeightWithoutTransform(aabbBounds: IAABBBounds) {\n this.widthWithoutTransform = aabbBounds.x2 - aabbBounds.x1;\n this.heightWithoutTransform = aabbBounds.y2 - aabbBounds.y1;\n }\n setAttributesAndPreventAnimate(params: Partial<T>, forceUpdateTag: boolean = false, context?: ISetAttributeContext) {\n this.setAttributes(params, forceUpdateTag, context);\n this.animates &&\n this.animates.forEach(animate => {\n Object.keys(params).forEach(key => {\n animate.preventAttr(key);\n });\n });\n }\n\n setAttributes(params: Partial<T>, forceUpdateTag: boolean = false, context?: ISetAttributeContext) {\n params =\n (this.onBeforeAttributeUpdate && this.onBeforeAttributeUpdate(params, this.attribute, null, context)) || params;\n\n if (params.background) {\n this.loadImage(params.background, true);\n } else if (params.shadowGraphic) {\n this.setShadowGraphic(params.shadowGraphic);\n }\n this._setAttributes(params, forceUpdateTag, context);\n }\n\n _setAttributes(params: Partial<T>, forceUpdateTag: boolean = false, context?: ISetAttributeContext) {\n const keys = Object.keys(params);\n for (let i = 0; i < keys.length; i++) {\n const key = keys[i];\n\n (this.attribute as any)[key] = (params as any)[key];\n }\n this.valid = this.isValid();\n // 没有设置shape&bounds的tag\n if (!this.updateShapeAndBoundsTagSetted() && (forceUpdateTag || this.needUpdateTags(keys))) {\n this.addUpdateShapeAndBoundsTag();\n } else {\n this.addUpdateBoundTag();\n }\n this.addUpdatePositionTag();\n this.addUpdateLayoutTag();\n this.onAttributeUpdate(context);\n }\n\n setAttribute(key: string, value: any, forceUpdateTag?: boolean, context?: ISetAttributeContext) {\n const params =\n this.onBeforeAttributeUpdate && this.onBeforeAttributeUpdate({ [key]: value }, this.attribute, key, context);\n if (!params) {\n if (!isNil((this.normalAttrs as any)?.[key])) {\n (this.normalAttrs as any)[key] = value;\n } else {\n (this.attribute as any)[key] = value;\n this.valid = this.isValid();\n if (!this.updateShapeAndBoundsTagSetted() && (forceUpdateTag || this.needUpdateTag(key))) {\n this.addUpdateShapeAndBoundsTag();\n } else {\n this.addUpdateBoundTag();\n }\n this.addUpdatePositionTag();\n this.addUpdateLayoutTag();\n this.onAttributeUpdate(context);\n }\n } else {\n this._setAttributes(params, forceUpdateTag, context);\n }\n if (key === 'background') {\n this.loadImage(value, true);\n } else if (key === 'shadowGraphic') {\n this.setShadowGraphic(value);\n }\n }\n\n protected needUpdateTags(keys: string[], k: string[] = GRAPHIC_UPDATE_TAG_KEY): boolean {\n for (let i = 0; i < k.length; i++) {\n const attrKey = k[i];\n if (keys.indexOf(attrKey) !== -1) {\n return true;\n }\n }\n return false;\n }\n\n protected needUpdateTag(key: string, k: string[] = GRAPHIC_UPDATE_TAG_KEY): boolean {\n for (let i = 0; i < k.length; i++) {\n const attrKey = k[i];\n if (key === attrKey) {\n return true;\n }\n }\n return false;\n }\n\n initAttributes(params: T) {\n // this.setAttributes(params, true);\n const context = { type: AttributeUpdateType.INIT };\n params =\n (this.onBeforeAttributeUpdate && this.onBeforeAttributeUpdate(params, this.attribute, null, context)) || params;\n this.attribute = params;\n if (params.background) {\n this.loadImage(params.background, true);\n } else if (params.shadowGraphic) {\n this.setShadowGraphic(params.shadowGraphic);\n }\n this._updateTag = UpdateTag.INIT;\n this.valid = this.isValid();\n this.onAttributeUpdate(context);\n }\n\n translate(x: number, y: number) {\n if (x === 0 && y === 0) {\n return this;\n }\n const context = {\n type: AttributeUpdateType.TRANSLATE\n };\n const params =\n this.onBeforeAttributeUpdate &&\n this.onBeforeAttributeUpdate({ x, y }, this.attribute, tempConstantXYKey, context);\n if (params) {\n x = params.x;\n y = params.y;\n delete params.x;\n delete params.y;\n this._setAttributes(params);\n }\n const attribute = this.attribute;\n const postMatrix = attribute.postMatrix;\n if (!postMatrix) {\n attribute.x = (attribute.x ?? DefaultTransform.x) + x;\n attribute.y = (attribute.y ?? DefaultTransform.y) + y;\n } else {\n application.transformUtil.fromMatrix(postMatrix, postMatrix).translate(x, y);\n }\n\n this.addUpdatePositionTag();\n this.addUpdateBoundTag();\n this.addUpdateLayoutTag();\n this.onAttributeUpdate(context);\n return this;\n }\n\n translateTo(x: number, y: number) {\n const attribute = this.attribute;\n if (attribute.x === x && attribute.y === y) {\n return this;\n }\n const context = {\n type: AttributeUpdateType.TRANSLATE_TO\n };\n const params =\n this.onBeforeAttributeUpdate &&\n this.onBeforeAttributeUpdate({ x, y }, this.attribute, tempConstantXYKey, context);\n if (params) {\n this._setAttributes(params, false, context);\n return this;\n }\n attribute.x = x;\n attribute.y = y;\n this.addUpdatePositionTag();\n this.addUpdateBoundTag();\n this.addUpdateLayoutTag();\n this.onAttributeUpdate(context);\n return this;\n }\n\n scale(scaleX: number, scaleY: number, scaleCenter?: IPointLike) {\n if (scaleX === 1 && scaleY === 1) {\n return this;\n }\n const context = {\n type: AttributeUpdateType.SCALE\n };\n const params =\n this.onBeforeAttributeUpdate &&\n this.onBeforeAttributeUpdate({ scaleX, scaleY, scaleCenter }, this.attribute, tempConstantScaleXYKey, context);\n if (params) {\n scaleX = params.scaleX;\n scaleY = params.scaleY;\n delete params.scaleX;\n delete params.scaleY;\n this._setAttributes(params);\n }\n const attribute = this.attribute;\n if (!scaleCenter) {\n attribute.scaleX = (attribute.scaleX ?? DefaultTransform.scaleX) * scaleX;\n attribute.scaleY = (attribute.scaleY ?? DefaultTransform.scaleY) * scaleY;\n } else {\n let { postMatrix } = this.attribute;\n if (!postMatrix) {\n postMatrix = new Matrix();\n attribute.postMatrix = postMatrix;\n }\n application.transformUtil.fromMatrix(postMatrix, postMatrix).scale(scaleX, scaleY, scaleCenter);\n }\n this.addUpdatePositionTag();\n this.addUpdateBoundTag();\n this.addUpdateLayoutTag();\n this.onAttributeUpdate(context);\n return this;\n }\n\n scaleTo(scaleX: number, scaleY: number) {\n const attribute = this.attribute;\n if (attribute.scaleX === scaleX && attribute.scaleY === scaleY) {\n return this;\n }\n const context = {\n type: AttributeUpdateType.SCALE_TO\n };\n const params =\n this.onBeforeAttributeUpdate &&\n this.onBeforeAttributeUpdate({ scaleX, scaleY }, this.attribute, tempConstantScaleXYKey, context);\n if (params) {\n this._setAttributes(params, false, context);\n return this;\n }\n attribute.scaleX = scaleX;\n attribute.scaleY = scaleY;\n this.addUpdatePositionTag();\n this.addUpdateBoundTag();\n this.addUpdateLayoutTag();\n this.onAttributeUpdate(context);\n return this;\n }\n\n rotate(angle: number, rotateCenter?: IPointLike) {\n if (angle === 0) {\n return this;\n }\n const context = { type: AttributeUpdateType.ROTATE };\n const params =\n this.onBeforeAttributeUpdate &&\n this.onBeforeAttributeUpdate({ angle, rotateCenter }, this.attribute, tempConstantAngleKey, context);\n if (params) {\n delete params.angle;\n this._setAttributes(params, false, context);\n // return this;\n }\n const attribute = this.attribute;\n if (!rotateCenter) {\n attribute.angle = (attribute.angle ?? DefaultTransform.angle) + angle;\n } else {\n let { postMatrix } = this.attribute;\n if (!postMatrix) {\n postMatrix = new Matrix();\n attribute.postMatrix = postMatrix;\n }\n application.transformUtil.fromMatrix(postMatrix, postMatrix).rotate(angle, rotateCenter);\n }\n this.addUpdatePositionTag();\n this.addUpdateBoundTag();\n this.addUpdateLayoutTag();\n this.onAttributeUpdate(context);\n return this;\n }\n\n rotateTo(angle: number) {\n const attribute = this.attribute;\n if (attribute.angle === angle) {\n return this;\n }\n const context = {\n type: AttributeUpdateType.ROTATE_TO\n };\n const params =\n this.onBeforeAttributeUpdate &&\n this.onBeforeAttributeUpdate(angle, this.attribute, tempConstantAngleKey, context);\n if (params) {\n this._setAttributes(params, false, context);\n return this;\n }\n attribute.angle = angle;\n this.addUpdatePositionTag();\n this.addUpdateBoundTag();\n this.addUpdateLayoutTag();\n this.onAttributeUpdate(context);\n return this;\n }\n\n skewTo(b: number, c: number) {\n return this;\n }\n\n onAttributeUpdate(context?: ISetAttributeContext) {\n if (context && context.skipUpdateCallback) {\n return;\n }\n this.stage?.graphicService.onAttributeUpdate(this);\n this._emitCustomEvent('afterAttributeUpdate', context);\n }\n\n // hasListener(event: string) {\n // const prefix = this.prefixed;\n // var evt = prefix ? prefix + event : event;\n // return this._events[evt];\n // }\n\n update(d?: { bounds: boolean; trans: boolean }) {\n if (d) {\n d.bounds && this.tryUpdateAABBBounds();\n d.trans && this.tryUpdateLocalTransMatrix();\n } else {\n this.tryUpdateAABBBounds();\n this.tryUpdateLocalTransMatrix();\n }\n }\n\n hasState(stateName?: string) {\n if (!this.currentStates || !this.currentStates.length) {\n return false;\n }\n\n if (!isNil(stateName)) {\n return this.currentStates.includes(stateName);\n }\n\n return true;\n }\n getState(stateName: string) {\n return this.states?.[stateName];\n }\n\n applyStateAttrs(attrs: Partial<T>, stateNames: string[], hasAnimation?: boolean, isClear?: boolean) {\n // 应用状态的时候要停掉动画\n if (hasAnimation) {\n const keys = Object.keys(attrs);\n const noWorkAttrs = this.getNoWorkAnimateAttr();\n const animateAttrs: Partial<T> = {};\n let noAnimateAttrs: Partial<T> | undefined;\n\n keys.forEach(key => {\n if (!noWorkAttrs[key]) {\n (animateAttrs as any)[key] =\n isClear && (attrs as any)[key] === undefined ? this.getDefaultAttribute(key) : (attrs as any)[key];\n } else {\n if (!noAnimateAttrs) {\n noAnimateAttrs = {};\n }\n (noAnimateAttrs as any)[key] = (attrs as any)[key];\n }\n });\n\n const stateAnimateConfig =\n (this.context && this.context.stateAnimateConfig) ?? this.stateAnimateConfig ?? DefaultStateAnimateConfig;\n // 需要注册动画\n (this as any).applyAnimationState(\n ['state'],\n [\n {\n name: 'state',\n animation: {\n type: 'state',\n to: animateAttrs,\n duration: stateAnimateConfig.duration,\n easing: stateAnimateConfig.easing\n }\n }\n ]\n );\n // const animate = (this.animate as any)({ slience: true });\n // (animate as any).stateNames = stateNames;\n // animate.to(animateAttrs, stateAnimateConfig.duration, stateAnimateConfig.easing);\n noAnimateAttrs && this.setAttributesAndPreventAnimate(noAnimateAttrs, false, { type: AttributeUpdateType.STATE });\n // Object.assign((this as any).finalAttribute, attrs);\n } else {\n this.stopStateAnimates();\n this.setAttributesAndPreventAnimate(attrs, false, { type: AttributeUpdateType.STATE });\n }\n }\n\n updateNormalAttrs(stateAttrs: Partial<T>) {\n const newNormalAttrs = {};\n if (this.normalAttrs) {\n Object.keys(stateAttrs).forEach(key => {\n if (key in this.normalAttrs) {\n (newNormalAttrs as any)[key] = (this.normalAttrs as any)[key];\n delete (this.normalAttrs as any)[key];\n } else {\n (newNormalAttrs as any)[key] = this.getNormalAttribute(key);\n }\n });\n Object.keys(this.normalAttrs).forEach(key => {\n (stateAttrs as any)[key] = (this.normalAttrs as any)[key];\n });\n } else {\n Object.keys(stateAttrs).forEach(key => {\n (newNormalAttrs as any)[key] = this.getNormalAttribute(key);\n });\n }\n\n this.normalAttrs = newNormalAttrs;\n }\n\n protected stopStateAnimates(type: 'start' | 'end' = 'end') {\n if (this.animates) {\n this.animates.forEach(animate => {\n if ((animate as any).stateNames) {\n animate.stop(type);\n this.animates.delete(animate.id);\n }\n });\n }\n }\n\n private getNormalAttribute(key: string) {\n const value = (this.attribute as any)[key];\n\n if (this.animates) {\n // this.animates.forEach(animate => {\n // if ((animate as any).stateNames) {\n // const endProps = animate.getEndProps();\n // if (has(endProps, key)) {\n // value = endProps[key];\n // }\n // }\n // });\n // console.log(this.finalAttrs);\n return (this as any).finalAttribute?.[key];\n }\n\n return value ?? (this as any).finalAttribute?.[key];\n }\n\n clearStates(hasAnimation?: boolean) {\n if (this.hasState() && this.normalAttrs) {\n this.currentStates = [];\n this.applyStateAttrs(this.normalAttrs, this.currentStates, hasAnimation, true);\n } else {\n this.currentStates = [];\n }\n this.normalAttrs = null;\n }\n\n removeState(stateName: string | string[], hasAnimation?: boolean) {\n if (this.currentStates) {\n const filter = isArray(stateName) ? (s: string) => !stateName.includes(s) : (s: string) => s !== stateName;\n const newStates = this.currentStates.filter(filter);\n\n if (newStates.length !== this.currentStates.length) {\n this.useStates(newStates, hasAnimation);\n }\n }\n }\n\n toggleState(stateName: string, hasAnimation?: boolean) {\n if (this.hasState(stateName)) {\n this.removeState(stateName, hasAnimation);\n } else {\n const index = this.currentStates ? this.currentStates.indexOf(stateName) : -1;\n if (index < 0) {\n const nextStates = this.currentStates ? this.currentStates.slice() : [];\n nextStates.push(stateName);\n this.useStates(nextStates, hasAnimation);\n }\n }\n }\n\n addState(stateName: string, keepCurrentStates?: boolean, hasAnimation?: boolean) {\n if (\n this.currentStates &&\n this.currentStates.includes(stateName) &&\n (keepCurrentStates || this.currentStates.length === 1)\n ) {\n return;\n }\n\n const newStates =\n keepCurrentStates && this.currentStates?.length ? this.currentStates.concat([stateName]) : [stateName];\n\n this.useStates(newStates, hasAnimation);\n }\n\n useStates(states: string[], hasAnimation?: boolean) {\n if (!states.length) {\n this.clearStates(hasAnimation);\n return;\n }\n\n const isChange =\n this.currentStates?.length !== states.length ||\n states.some((stateName, index) => this.currentStates[index] !== stateName);\n\n if (!isChange) {\n return;\n }\n\n const stateAttrs = {};\n states.forEach(stateName => {\n const attrs = this.stateProxy ? this.stateProxy(stateName, states) : this.states?.[stateName];\n\n if (attrs) {\n Object.assign(stateAttrs, attrs);\n }\n });\n\n this.updateNormalAttrs(stateAttrs);\n\n this.currentStates = states;\n this.applyStateAttrs(stateAttrs, states, hasAnimation);\n }\n\n addUpdateBoundTag() {\n this._updateTag |= UpdateTag.UPDATE_BOUNDS; // for bounds\n if (this.parent) {\n this.parent.addChildUpdateBoundTag();\n }\n if (this.glyphHost) {\n this.glyphHost.addUpdateBoundTag();\n }\n }\n\n addUpdateShapeTag() {\n this._updateTag |= UpdateTag.UPDATE_SHAPE; // for shape\n }\n\n addUpdateShapeAndBoundsTag() {\n this._updateTag |= UpdateTag.UPDATE_SHAPE_AND_BOUNDS; // for shape&bounds\n if (this.parent) {\n this.parent.addChildUpdateBoundTag();\n }\n if (this.glyphHost) {\n this.glyphHost.addUpdateBoundTag();\n }\n }\n\n protected updateShapeAndBoundsTagSetted(): boolean {\n return (this._updateTag & UpdateTag.UPDATE_SHAPE_AND_BOUNDS) === UpdateTag.UPDATE_SHAPE_AND_BOUNDS;\n }\n\n protected clearUpdateBoundTag() {\n this._updateTag &= UpdateTag.CLEAR_BOUNDS;\n }\n /**\n * 更新位置tag,包括全局tag和局部tag\n */\n addUpdatePositionTag() {\n // 更新shadowRoot的全局位置\n this.shadowRoot && this.shadowRoot.addUpdateGlobalPositionTag();\n this._updateTag |= UpdateTag.UPDATE_GLOBAL_LOCAL_MATRIX;\n }\n /**\n * 更新全局位置tag\n */\n addUpdateGlobalPositionTag() {\n // 更新shadowRoot的全局位置\n this.shadowRoot && this.shadowRoot.addUpdateGlobalPositionTag();\n this._updateTag |= UpdateTag.UPDATE_GLOBAL_MATRIX;\n }\n /**\n * 清除局部位置tag\n */\n protected clearUpdateLocalPositionTag() {\n this._updateTag &= UpdateTag.CLEAR_LOCAL_MATRIX;\n }\n /**\n * 清除全局位置tag\n */\n protected clearUpdateGlobalPositionTag() {\n this._updateTag &= UpdateTag.CLEAR_GLOBAL_MATRIX;\n }\n\n addUpdateLayoutTag() {\n this._updateTag |= UpdateTag.UPDATE_LAYOUT;\n }\n\n protected clearUpdateLayoutTag() {\n this._updateTag &= UpdateTag.CLEAR_LAYOUT;\n }\n\n protected needUpdateLayout(): boolean {\n return !!(this._updateTag & UpdateTag.UPDATE_LAYOUT);\n }\n\n protected getAnchor(anchor: [string | number, string | number], params: { b?: IAABBBounds }, resetScale?: boolean) {\n const _anchor: [number, number] = [0, 0];\n const getBounds = () => {\n if (params.b) {\n return params.b;\n }\n // 拷贝一份,避免计算bounds的过程中计算matrix,然后matrix又修改了bounds\n const graphic = this.clone();\n graphic.attribute.angle = 0;\n graphic.attribute.scaleCenter = null;\n if (resetScale) {\n graphic.attribute.scaleX = 1;\n graphic.attribute.scaleY = 1;\n }\n // @ts-ignore\n // this.setAttributes({ angle: 0, scaleCenter: null });\n params.b = graphic.AABBBounds;\n\n return params.b;\n };\n if (typeof anchor[0] === 'string') {\n const ratio = parseFloat(anchor[0]) / 100;\n const bounds = getBounds();\n _anchor[0] = bounds.x1 + (bounds.x2 - bounds.x1) * ratio;\n } else {\n _anchor[0] = anchor[0];\n }\n if (typeof anchor[1] === 'string') {\n const ratio = parseFloat(anchor[1]) / 100;\n const bounds = getBounds();\n _anchor[1] = bounds.y1 + (bounds.y2 - bounds.y1) * ratio;\n } else {\n _anchor[1] = anchor[1];\n }\n\n return _anchor;\n }\n\n /**\n * 更新局部matrix的具体函数\n */\n protected doUpdateLocalMatrix() {\n const {\n x = DefaultTransform.x,\n y = DefaultTransform.y,\n scaleX = DefaultTransform.scaleX,\n scaleY = DefaultTransform.scaleY,\n angle = DefaultTransform.angle,\n scaleCenter,\n anchor,\n postMatrix\n } = this.attribute;\n let _anchor: [number, number] = [0, 0];\n const params = {};\n if (anchor && angle) {\n _anchor = this.getAnchor(anchor, params);\n }\n if (scaleCenter && (scaleX !== 1 || scaleY !== 1)) {\n const m = this._transMatrix;\n m.reset();\n m.translate(_anchor[0], _anchor[1]);\n m.rotate(angle);\n m.translate(-_anchor[0], -_anchor[1]);\n\n m.translate(x, y);\n // m.translate(scaleCenter[0] * scaleX, scaleCenter[1] * scaleY);\n // 计算bounds\n _anchor = this.getAnchor(scaleCenter, params, true);\n application.transformUtil.fromMatrix(m, m).scale(scaleX, scaleY, { x: _anchor[0], y: _anchor[1] });\n // m.translate(-scaleCenter[0], -scaleCenter[1]);\n } else {\n normalTransform(this._transMatrix, this._transMatrix.reset(), x, y, scaleX, scaleY, angle, anchor && _anchor);\n }\n const p = this.getOffsetXY(DefaultTransform);\n this._transMatrix.e += p.x;\n this._transMatrix.f += p.y;\n\n if (postMatrix) {\n const m1 = tempMatrix.setValue(\n postMatrix.a,\n postMatrix.b,\n postMatrix.c,\n postMatrix.d,\n postMatrix.e,\n postMatrix.f\n );\n const m2 = this._transMatrix;\n m1.multiply(m2.a, m2.b, m2.c, m2.d, m2.e, m2.f);\n m2.setValue(m1.a, m1.b, m1.c, m1.d, m1.e, m1.f);\n }\n }\n /**\n * 更新全局matrix的具体函数\n */\n protected doUpdateGlobalMatrix() {\n // 基于parent的matrix修改\n if (this.parent) {\n this._globalTransMatrix.multiply(\n this.transMatrix.a,\n this.transMatrix.b,\n this.transMatrix.c,\n this.transMatrix.d,\n this.transMatrix.e,\n this.transMatrix.f\n );\n const { scrollX = 0, scrollY = 0 } = this.parent.attribute;\n this._globalTransMatrix.translate(scrollX, scrollY);\n }\n }\n\n setStage(stage?: IStage, layer?: ILayer) {\n if (this.stage !== stage) {\n this.stage = stage;\n this.layer = layer;\n this.setStageToShadowRoot(stage, layer);\n if (this.animates && this.animates.size) {\n // 设置timeline为所属的stage上的timeline,但如果timeline并不是默认的timeline,就不用覆盖\n const timeline = stage.getTimeline();\n this.animates.forEach(a => {\n if (a.timeline.isGlobal) {\n a.setTimeline(timeline);\n timeline.addAnimate(a);\n }\n });\n }\n this._onSetStage && this._onSetStage(this, stage, layer);\n this.stage?.graphicService.onSetStage(this, stage);\n }\n }\n\n setStageToShadowRoot(stage?: IStage, layer?: ILayer) {\n if (this.shadowRoot) {\n this.shadowRoot.setStage(stage, layer);\n }\n }\n\n onAddStep(step: IStep) {\n return;\n }\n onStop(props?: Partial<T>): void {\n if (props) {\n this.setAttributes(props, false, { type: AttributeUpdateType.ANIMATE_END });\n }\n }\n\n getDefaultAttribute(name: string) {\n return (this.getGraphicTheme() as any)[name];\n }\n\n // 获取属性\n getComputedAttribute(name: string) {\n return (this.attribute as any)[name] ?? this.getDefaultAttribute(name);\n }\n /**\n * 添加onSetStage钩子\n * @param cb 回调函数\n * @param immediate 是否立刻执行,如果在回调添加之前stage就已经绑定,那么如果第二个参数为true就立刻执行回调\n */\n onSetStage(cb: (g: IGraphic, stage: IStage) => void, immediate: boolean = false) {\n this._onSetStage = cb;\n if (immediate && this.stage) {\n cb(this, this.stage);\n }\n }\n\n /******************** shadow graphic *********************/\n attachShadow(shadowRoot?: IShadowRoot) {\n if (shadowRoot) {\n shadowRoot.shadowHost = this;\n }\n\n this.shadowRoot = shadowRoot ?? application.graphicService.creator.shadowRoot(this);\n this.addUpdateBoundTag();\n this.shadowRoot.setStage(this.stage, this.layer);\n return this.shadowRoot;\n }\n\n detachShadow() {\n if (this.shadowRoot) {\n this.addUpdateBoundTag();\n this.shadowRoot.release(true);\n this.shadowRoot = null;\n }\n }\n\n toJson(): IGraphicJson {\n return {\n attribute: this.attribute,\n _uid: this._uid,\n type: this.type,\n name: this.name,\n children: this.children.map((item: IGraphic) => item.toJson())\n };\n }\n\n createPathProxy(path?: string) {\n if (isString(path, true)) {\n this.pathProxy = new CustomPath2D().fromString(path as string);\n } else {\n this.pathProxy = new CustomPath2D();\n }\n\n return this.pathProxy;\n }\n\n loadImage(image: any, background: boolean = false) {\n if (!image || (background && backgroundNotImage(image))) {\n return;\n }\n const url = image;\n if (!this.resources) {\n this.resources = new Map();\n }\n const cache: {\n state: 'loading' | 'success' | 'init' | 'fail';\n data: any;\n } = {\n data: 'init',\n state: null\n };\n this.resources.set(url, cache);\n if (typeof image === 'string') {\n cache.state = 'loading';\n if (image.startsWith('<svg')) {\n // TODO 封装isSvg到@visactor/vutils\n ResourceLoader.GetSvg(image, this);\n this.backgroundImg = this.backgroundImg || background;\n } else if (isValidUrl(image) || image.includes('/') || isBase64(image)) {\n ResourceLoader.GetImage(image, this);\n this.backgroundImg = this.backgroundImg || background;\n }\n } else if (isObject(image)) {\n (cache.state = 'success'), (cache.data = image);\n this.backgroundImg = this.backgroundImg || background;\n } else {\n cache.state = 'fail';\n }\n }\n\n setShadowGraphic(graphic: IGraphic) {\n if (!graphic) {\n this.detachShadow();\n } else {\n const root = this.attachShadow();\n root.add(graphic);\n }\n }\n\n imageLoadSuccess(url: string, image: HTMLImageElement, cb?: () => void) {\n // 更新属性\n // this.resourceState = 'success';\n // this.resource = image;\n if (!this.resources) {\n return;\n }\n const res = this.resources.get(url);\n if (!res) {\n return;\n }\n res.state = 'success';\n res.data = image;\n\n cb && cb();\n\n // 触发重绘\n // 暂时全量,TODO 启动局部重绘\n // this.stage.enableDirtyBounds();\n // this.stage.dirty(this.AABBBounds);\n this.addUpdateBoundTag(); // 添加bounds更新tag重绘才会绘制这个mark\n this.stage && this.stage.renderNextFrame();\n }\n\n imageLoadFail(url: string, cb?: () => void) {\n if (!this.resources) {\n return;\n }\n const res = this.resources.get(url);\n if (!res) {\n return;\n }\n res.state = 'fail';\n\n cb && cb();\n }\n\n private _stopAnimates(animates: Map<string | number, IAnimate>) {\n if (animates) {\n animates.forEach(animate => {\n animate.stop();\n });\n }\n }\n\n stopAnimates(stopChildren: boolean = false) {\n this._stopAnimates(this.animates);\n\n if (this.shadowRoot) {\n // 停止所有影子节点的动画\n this.shadowRoot.stopAnimates(true);\n }\n if (this.isContainer && stopChildren) {\n this.forEachChildren((c: IGraphic) => {\n c.stopAnimates(stopChildren);\n });\n }\n }\n\n release(): void {\n this.releaseStatus = 'released';\n this.stopAnimates();\n application.graphicService.onRelease(this);\n }\n\n protected _emitCustomEvent(type: string, context?: any) {\n if (this._events && type in this._events) {\n const changeEvent = new CustomEvent(type, context);\n changeEvent.bubbles = false;\n\n (changeEvent as any).manager = (this.stage as any)?.eventSystem?.manager;\n this.dispatchEvent(changeEvent);\n }\n }\n\n abstract getNoWorkAnimateAttr(): Record<string, number>;\n\n abstract clone(): IGraphic<any>;\n\n toCustomPath(): ICustomPath2D {\n // throw new Error('暂不支持');\n const renderer = (this.stage?.renderService || application.renderService)?.drawContribution?.getRenderContribution(\n this\n );\n if (renderer) {\n const context = new EmptyContext2d(null, 1);\n renderer.drawShape(this, context, 0, 0, {} as any, {});\n return context.path;\n }\n return null;\n }\n}\n\nGraphic.mixin(EventTarget);\n\nfunction backgroundNotImage(image: any) {\n if (image.fill || image.stroke) {\n return true;\n }\n return false;\n}\n"]}
@@ -62,10 +62,11 @@ export class Group extends Graphic {
62
62
  return !!super.shouldUpdateAABBBounds() || !!(this._childUpdateTag & UpdateTag.UPDATE_BOUNDS);
63
63
  }
64
64
  tryUpdateAABBBounds() {
65
+ var _a, _b;
65
66
  if (!this.shouldUpdateAABBBounds()) return this._AABBBounds;
66
- application.graphicService.beforeUpdateAABBBounds(this, this.stage, !0, this._AABBBounds);
67
+ null === (_a = this.stage) || void 0 === _a || _a.graphicService.beforeUpdateAABBBounds(this, this.stage, !0, this._AABBBounds);
67
68
  const selfChange = this.shouldSelfChangeUpdateAABBBounds(), bounds = this.doUpdateAABBBounds();
68
- return this.addUpdateLayoutTag(), application.graphicService.afterUpdateAABBBounds(this, this.stage, this._AABBBounds, this, selfChange),
69
+ return this.addUpdateLayoutTag(), null === (_b = this.stage) || void 0 === _b || _b.graphicService.afterUpdateAABBBounds(this, this.stage, this._AABBBounds, this, selfChange),
69
70
  "empty" === this.attribute.boundsMode && bounds.clear(), bounds;
70
71
  }
71
72
  doUpdateLocalMatrix() {
@@ -113,13 +114,15 @@ export class Group extends Graphic {
113
114
  return this.theme.getTheme(this);
114
115
  }
115
116
  incrementalAppendChild(node) {
117
+ var _a;
116
118
  const data = super.appendChild(node);
117
119
  return this.stage && data && (data.stage = this.stage, data.layer = this.layer),
118
- this.addUpdateBoundTag(), application.graphicService.onAddIncremental(node, this, this.stage),
120
+ this.addUpdateBoundTag(), null === (_a = this.stage) || void 0 === _a || _a.graphicService.onAddIncremental(node, this, this.stage),
119
121
  data;
120
122
  }
121
123
  incrementalClearChild() {
122
- super.removeAllChild(), this.addUpdateBoundTag(), application.graphicService.onClearIncremental(this, this.stage);
124
+ var _a;
125
+ super.removeAllChild(), this.addUpdateBoundTag(), null === (_a = this.stage) || void 0 === _a || _a.graphicService.onClearIncremental(this, this.stage);
123
126
  }
124
127
  _updateChildToStage(child) {
125
128
  return this.stage && child && child.setStage(this.stage, this.layer), this.addUpdateBoundTag(),
@@ -140,18 +143,22 @@ export class Group extends Graphic {
140
143
  return this._updateChildToStage(super.insertInto(newNode, idx));
141
144
  }
142
145
  removeChild(child) {
146
+ var _a;
143
147
  const data = super.removeChild(child);
144
- return child.stage = null, application.graphicService.onRemove(child), this.addUpdateBoundTag(),
145
- data;
148
+ return child.stage = null, null === (_a = this.stage) || void 0 === _a || _a.graphicService.onRemove(child),
149
+ this.addUpdateBoundTag(), data;
146
150
  }
147
151
  removeAllChild(deep = !1) {
148
152
  this.forEachChildren((child => {
149
- application.graphicService.onRemove(child), deep && child.isContainer && child.removeAllChild(deep);
153
+ var _a;
154
+ null === (_a = this.stage) || void 0 === _a || _a.graphicService.onRemove(child),
155
+ deep && child.isContainer && child.removeAllChild(deep);
150
156
  })), super.removeAllChild(), this.addUpdateBoundTag();
151
157
  }
152
158
  setStage(stage, layer) {
159
+ var _a;
153
160
  this.stage !== stage && (this.stage = stage, this.layer = layer, this.setStageToShadowRoot(stage, layer),
154
- this._onSetStage && this._onSetStage(this, stage, layer), application.graphicService.onSetStage(this, stage),
161
+ this._onSetStage && this._onSetStage(this, stage, layer), null === (_a = this.stage) || void 0 === _a || _a.graphicService.onSetStage(this, stage),
155
162
  this.forEachChildren((item => {
156
163
  item.setStage(stage, this.layer);
157
164
  })));
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/graphic/group.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAY7C,OAAO,EAAE,OAAO,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAC/D,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAG5C,MAAM,CAAN,IAAY,yBAKX;AALD,WAAY,yBAAyB;IAEnC,qFAAc,CAAA;IAEd,qFAAc,CAAA;AAChB,CAAC,EALW,yBAAyB,KAAzB,yBAAyB,QAKpC;AAED,MAAM,OAAO,KAAM,SAAQ,OAA+B;IAWxD,YAAY,MAA8B;QACxC,KAAK,CAAC,MAAM,CAAC,CAAC;QAXhB,SAAI,GAAgB,OAAO,CAAC;QAC5B,WAAM,GAAQ,IAAI,CAAC;QACnB,gBAAW,GAAY,IAAI,CAAC;QAU1B,IAAI,CAAC,UAAU,GAAG,iBAAiB,CAAC;QACpC,IAAI,CAAC,eAAe,GAAG,SAAS,CAAC,aAAa,CAAC;IAEjD,CAAC;IAED,OAAO,CAAC,IAAiB;QACvB,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC;IACtD,CAAC;IAED,SAAS;QACP,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;IAIvB,CAAC;IACD,SAAS;QACP,IAAI,CAAC,QAAQ,GAAG,KAAK,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B,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;SACnB;QAED,OAAO,OAAO,CAAC;IACjB,CAAC;IAED,KAAK;QACH,OAAO,IAAI,KAAK,mBAAM,IAAI,CAAC,SAAS,EAAG,CAAC;IAC1C,CAAC;IAED,oBAAoB;QAClB,OAAO,KAAK,CAAC,mBAAmB,CAAC;IACnC,CAAC;IAED,OAAO,CAAC,GAAa;QACnB,IAAI,GAAG,EAAE;YACP,IAAI,CAAC,eAAe,CAAC,CAAC,CAAW,EAAE,EAAE;gBACnC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;YACjB,CAAC,CAAC,CAAC;SACJ;QACD,KAAK,CAAC,OAAO,EAAE,CAAC;IAClB,CAAC;;AAlYM,yBAAmB,GAAG,mBAAmB,CAAC;AAqYnD,MAAM,UAAU,WAAW,CAAC,UAAkC;IAC5D,OAAO,IAAI,KAAK,CAAC,UAAU,CAAC,CAAC;AAC/B,CAAC","file":"group.js","sourcesContent":["import type { IAABBBounds, Matrix } from '@visactor/vutils';\n// eslint-disable-next-line no-duplicate-imports\nimport { Point } from '@visactor/vutils';\nimport { application } from '../application';\nimport type {\n IStage,\n GraphicAttributeMap,\n INode,\n IGraphic,\n ITheme,\n IThemeSpec,\n ILayer,\n GraphicType\n} from '../interface';\nimport type { IGroup, IGroupGraphicAttribute } from '../interface/graphic/group';\nimport { Graphic, NOWORK_ANIMATE_ATTR } from './graphic';\nimport { getTheme, Theme } from './theme';\nimport { UpdateTag, IContainPointMode } from '../common/enums';\nimport { GROUP_NUMBER_TYPE } from './constants';\nimport { DefaultTransform } from './config';\n\n// Group更新AABBBounds的策略\nexport enum GroupUpdateAABBBoundsMode {\n // Group较少的情况,不会批量设置所有父层的tag,而是每次都查找\n LESS_GROUP = 0,\n // Group较多的情况,每次都会设置tag到最顶层\n MORE_GROUP = 1\n}\n\nexport class Group extends Graphic<IGroupGraphicAttribute> implements IGroup {\n type: GraphicType = 'group';\n parent: any = null;\n isContainer: boolean = true;\n // 子元素的更新标记\n declare _childUpdateTag: number;\n\n declare theme?: ITheme;\n\n static NOWORK_ANIMATE_ATTR = NOWORK_ANIMATE_ATTR;\n\n constructor(params: IGroupGraphicAttribute) {\n super(params);\n this.numberType = GROUP_NUMBER_TYPE;\n this._childUpdateTag = UpdateTag.UPDATE_BOUNDS;\n // this.theme = new Theme();\n }\n\n setMode(mode: '2d' | '3d') {\n mode === '3d' ? this.set3dMode() : this.set2dMode();\n }\n\n set3dMode() {\n this.in3dMode = true;\n // this.forEachChildren((c: IGraphic) => {\n // c.setMode('3d');\n // });\n }\n set2dMode() {\n this.in3dMode = false;\n // this.forEachChildren((c: IGraphic) => {\n // c.setMode('2d');\n // });\n }\n\n setTheme(t: IThemeSpec) {\n if (!this.theme) {\n this.theme = new Theme();\n }\n return this.theme.setTheme(t, this);\n }\n\n createTheme() {\n if (!this.theme) {\n this.theme = new Theme();\n }\n }\n\n visibleAll(visible: boolean) {\n this.setAttribute('visible', visible);\n this.forEachChildren((item: IGraphic) => {\n if (item.isContainer && (item as any).visibleAll) {\n (item as any).visibleAll(visible);\n } else {\n item.setAttribute('visible', visible);\n }\n });\n }\n\n hideAll() {\n this.visibleAll(false);\n }\n\n showAll() {\n this.visibleAll(true);\n }\n\n /**\n * 是否包含某个点(点需要是全局坐标系)\n * group containsPoint 只需要判断bounds\n * TODO: group的shape判断\n * @param x\n * @param y\n * @param mode\n * @returns\n */\n containsPoint(x: number, y: number, mode: IContainPointMode): boolean {\n if (mode === IContainPointMode.GLOBAL) {\n // 转换x,y更精准\n const point = new Point(x, y);\n if (this.parent) {\n this.parent.globalTransMatrix.transformPoint(point, point);\n }\n return this.AABBBounds.contains(point.x, point.y);\n }\n return this.AABBBounds.contains(x, y);\n }\n\n shouldUpdateAABBBounds(): boolean {\n // 检索自己是否需要更新\n if (super.shouldUpdateAABBBounds()) {\n return true;\n }\n // 检索叶子节点是否有更新(如果children是叶子节点的话)\n if (this._childUpdateTag & UpdateTag.UPDATE_BOUNDS) {\n return true;\n }\n return false;\n // // 检索是否子group需要更新\n // let needUpdate = false;\n // this.forEachChildren((node: IGraphic) => {\n // // 只查找group层级\n // if (node.isContainer && (node as Group).shouldUpdateAABBBounds()) {\n // needUpdate = true;\n // return true;\n // }\n // return false;\n // });\n // return needUpdate;\n }\n\n protected tryUpdateAABBBounds(): IAABBBounds {\n if (!this.shouldUpdateAABBBounds()) {\n return this._AABBBounds;\n }\n application.graphicService.beforeUpdateAABBBounds(this, this.stage, true, this._AABBBounds);\n const selfChange = this.shouldSelfChangeUpdateAABBBounds();\n const bounds = this.doUpdateAABBBounds();\n this.addUpdateLayoutTag();\n application.graphicService.afterUpdateAABBBounds(this, this.stage, this._AABBBounds, this, selfChange);\n // 直接返回空Bounds,但是前面的流程还是要走\n if (this.attribute.boundsMode === 'empty') {\n bounds.clear();\n }\n return bounds;\n }\n\n /**\n * 大部分group不需要更新matrix,这里特殊优化一下\n * 更新局部matrix的具体函数\n */\n protected doUpdateLocalMatrix() {\n const {\n x = DefaultTransform.x,\n y = DefaultTransform.y,\n dx = DefaultTransform.dx,\n dy = DefaultTransform.dy,\n scaleX = DefaultTransform.scaleX,\n scaleY = DefaultTransform.scaleY,\n angle = DefaultTransform.angle,\n postMatrix\n } = this.attribute;\n if (x === 0 && y === 0 && dx === 0 && dy === 0 && scaleX === 1 && scaleY === 1 && angle === 0 && !postMatrix) {\n this._transMatrix.reset();\n return;\n }\n return super.doUpdateLocalMatrix();\n }\n\n getGraphicTheme(): Required<IGroupGraphicAttribute> {\n return getTheme(this).group;\n }\n\n protected updateAABBBounds(\n attribute: IGroupGraphicAttribute,\n groupTheme: Required<IGroupGraphicAttribute>,\n aabbBounds: IAABBBounds\n ) {\n const originalAABBBounds = aabbBounds; // fix aabbbounds update error in flex layout\n aabbBounds = aabbBounds.clone();\n\n const { width, height, path, clip = groupTheme.clip } = attribute;\n // 添加自身的fill或者clip\n if (path && path.length) {\n path.forEach(g => {\n aabbBounds.union(g.AABBBounds);\n });\n } else if (width != null && height != null) {\n aabbBounds.set(0, 0, Math.max(0, width), Math.max(0, height)); // fix bounds set when auto size in vtable\n }\n if (!clip) {\n // 添加子节点\n this.forEachChildren((node: IGraphic) => {\n aabbBounds.union(node.AABBBounds);\n });\n // 如果没有clip的话,还需要加一下scroll\n const { scrollX = 0, scrollY = 0 } = attribute;\n aabbBounds.translate(scrollX, scrollY);\n }\n application.graphicService.updateTempAABBBounds(aabbBounds);\n\n application.graphicService.transformAABBBounds(attribute, aabbBounds, groupTheme, false, this);\n\n originalAABBBounds.copy(aabbBounds);\n return originalAABBBounds;\n }\n\n protected doUpdateAABBBounds(): IAABBBounds {\n this.updateAABBBoundsStamp++;\n const bounds = super.doUpdateAABBBounds();\n\n // 更新bounds之后需要设置父节点,否则tag丢失\n this.parent && this.parent.addChildUpdateBoundTag();\n this._emitCustomEvent('AAABBBoundsChange');\n\n return bounds;\n }\n\n protected clearUpdateBoundTag() {\n this._updateTag &= UpdateTag.CLEAR_BOUNDS;\n this._childUpdateTag &= UpdateTag.CLEAR_BOUNDS;\n }\n\n addUpdateBoundTag() {\n this._updateTag |= UpdateTag.UPDATE_BOUNDS; // for bounds\n if (this.parent) {\n this.parent.addChildUpdateBoundTag();\n }\n }\n\n addChildUpdateBoundTag() {\n // 如果已经设置过updateTag,那就不需要设置了\n if (this._childUpdateTag & UpdateTag.UPDATE_BOUNDS) {\n return;\n }\n // 如果没有设置过,那么继续向上设置\n this._childUpdateTag |= UpdateTag.UPDATE_BOUNDS;\n this.parent && this.parent.addChildUpdateBoundTag();\n }\n\n getTheme() {\n return this.theme.getTheme(this);\n }\n\n /* 场景树结构 */\n incrementalAppendChild(node: INode): INode | null {\n const data = super.appendChild(node);\n if (this.stage && data) {\n (data as unknown as this).stage = this.stage;\n (data as unknown as this).layer = this.layer;\n }\n this.addUpdateBoundTag();\n application.graphicService.onAddIncremental(node as unknown as IGraphic, this, this.stage);\n return data;\n }\n incrementalClearChild(): void {\n super.removeAllChild();\n this.addUpdateBoundTag();\n application.graphicService.onClearIncremental(this, this.stage);\n return;\n }\n\n protected _updateChildToStage(child: IGraphic) {\n if (this.stage && child) {\n child.setStage(this.stage, this.layer);\n }\n this.addUpdateBoundTag();\n return child;\n }\n // TODO 代码优化\n appendChild(node: INode, addStage: boolean = true): INode | null {\n const data = super.appendChild(node);\n if (addStage && this.stage && data) {\n (data as unknown as this).setStage(this.stage, this.layer);\n }\n this.addUpdateBoundTag();\n return data;\n }\n insertBefore(newNode: INode, referenceNode: INode): INode | null {\n return this._updateChildToStage(super.insertBefore(newNode, referenceNode) as undefined as IGraphic);\n }\n insertAfter(newNode: INode, referenceNode: INode): INode | null {\n return this._updateChildToStage(super.insertAfter(newNode, referenceNode) as undefined as IGraphic);\n }\n insertInto(newNode: INode, idx: number): INode | null {\n return this._updateChildToStage(super.insertInto(newNode, idx) as undefined as IGraphic);\n }\n\n removeChild(child: IGraphic): IGraphic {\n const data = super.removeChild(child);\n child.stage = null;\n application.graphicService.onRemove(child);\n this.addUpdateBoundTag();\n return data as IGraphic;\n }\n\n removeAllChild(deep: boolean = false): void {\n this.forEachChildren((child: IGraphic) => {\n application.graphicService.onRemove(child);\n if (deep && child.isContainer) {\n child.removeAllChild(deep);\n }\n });\n super.removeAllChild();\n this.addUpdateBoundTag();\n }\n\n setStage(stage?: IStage, layer?: ILayer) {\n if (this.stage !== stage) {\n this.stage = stage;\n this.layer = layer;\n this.setStageToShadowRoot(stage, layer);\n this._onSetStage && this._onSetStage(this, stage, layer);\n application.graphicService.onSetStage(this, stage);\n this.forEachChildren(item => {\n (item as any).setStage(stage, this.layer);\n });\n }\n }\n /**\n * 更新位置tag,包括全局tag和局部tag\n */\n addUpdatePositionTag() {\n super.addUpdatePositionTag();\n // 批量设置底层group的global tag\n this.forEachChildren((g: Group) => {\n if (g.isContainer) {\n g.addUpdateGlobalPositionTag();\n }\n });\n }\n /**\n * 更新全局位置tag\n */\n addUpdateGlobalPositionTag() {\n super.addUpdateGlobalPositionTag();\n // 批量设置底层group的global tag\n this.forEachChildren((g: Group) => {\n if (g.isContainer) {\n g.addUpdateGlobalPositionTag();\n }\n });\n }\n /**\n * group更新全局的transMatrix\n * @param clearTag\n * @returns\n */\n protected tryUpdateGlobalTransMatrix(clearTag: boolean = true): Matrix {\n if (this.shouldUpdateGlobalMatrix()) {\n if (!this._globalTransMatrix) {\n this._globalTransMatrix = this.parent\n ? (this.parent as IGroup).globalTransMatrix.clone()\n : this.transMatrix.clone();\n } else if (this.parent) {\n const m = (this.parent as IGroup).globalTransMatrix;\n this._globalTransMatrix.setValue(m.a, m.b, m.c, m.d, m.e, m.f);\n }\n this.doUpdateGlobalMatrix();\n clearTag && this.clearUpdateGlobalPositionTag();\n }\n return this._globalTransMatrix;\n }\n /**\n * 查找自身更新global的tag,如果存在,就更新\n * @returns\n */\n shouldUpdateGlobalMatrix(): boolean {\n const shouldUpdate = !!(this._updateTag & UpdateTag.UPDATE_GLOBAL_MATRIX);\n return shouldUpdate;\n }\n\n private _getChildByName<T extends INode = INode>(name: string, deep?: boolean): T | null {\n return this.find(node => node.name === name, deep);\n }\n\n /**\n * if graphic exist then update attributes, otherwise create a new instance\n * @param graphicName the name of graphic\n * @param attributes the attributes of graphic\n * @param graphicType the type of graphic\n * @returns the graphic instance\n */\n createOrUpdateChild<T extends keyof GraphicAttributeMap>(\n graphicName: string,\n attributes: GraphicAttributeMap[T],\n graphicType: T\n ): INode {\n let graphic = this._getChildByName(graphicName) as IGraphic;\n if (graphic) {\n graphic.setAttributes(attributes);\n } else {\n graphic = application.graphicService.creator[graphicType](attributes as any);\n graphic.name = graphicName;\n this.add(graphic);\n }\n\n return graphic;\n }\n\n clone() {\n return new Group({ ...this.attribute });\n }\n\n getNoWorkAnimateAttr(): Record<string, number> {\n return Group.NOWORK_ANIMATE_ATTR;\n }\n\n release(all?: boolean) {\n if (all) {\n this.forEachChildren((g: IGraphic) => {\n g.release(all);\n });\n }\n super.release();\n }\n}\n\nexport function createGroup(attributes: IGroupGraph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AO,CAAC,WAAW,CAAC,CAAC,UAAiB,CAAC,CAAC;YAC7E,OAAO,CAAC,IAAI,GAAG,WAAW,CAAC;YAC3B,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;SACnB;QAED,OAAO,OAAO,CAAC;IACjB,CAAC;IAED,KAAK;QACH,OAAO,IAAI,KAAK,mBAAM,IAAI,CAAC,SAAS,EAAG,CAAC;IAC1C,CAAC;IAED,oBAAoB;QAClB,OAAO,KAAK,CAAC,mBAAmB,CAAC;IACnC,CAAC;IAED,OAAO,CAAC,GAAa;QACnB,IAAI,GAAG,EAAE;YACP,IAAI,CAAC,eAAe,CAAC,CAAC,CAAW,EAAE,EAAE;gBACnC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;YACjB,CAAC,CAAC,CAAC;SACJ;QACD,KAAK,CAAC,OAAO,EAAE,CAAC;IAClB,CAAC;;AAlYM,yBAAmB,GAAG,mBAAmB,CAAC;AAqYnD,MAAM,UAAU,WAAW,CAAC,UAAkC;IAC5D,OAAO,IAAI,KAAK,CAAC,UAAU,CAAC,CAAC;AAC/B,CAAC","file":"group.js","sourcesContent":["import type { IAABBBounds, Matrix } from '@visactor/vutils';\n// eslint-disable-next-line no-duplicate-imports\nimport { Point } from '@visactor/vutils';\nimport { application } from '../application';\nimport type {\n IStage,\n GraphicAttributeMap,\n INode,\n IGraphic,\n ITheme,\n IThemeSpec,\n ILayer,\n GraphicType\n} from '../interface';\nimport type { IGroup, IGroupGraphicAttribute } from '../interface/graphic/group';\nimport { Graphic, NOWORK_ANIMATE_ATTR } from './graphic';\nimport { getTheme, Theme } from './theme';\nimport { UpdateTag, IContainPointMode } from '../common/enums';\nimport { GROUP_NUMBER_TYPE } from './constants';\nimport { DefaultTransform } from './config';\n\n// Group更新AABBBounds的策略\nexport enum GroupUpdateAABBBoundsMode {\n // Group较少的情况,不会批量设置所有父层的tag,而是每次都查找\n LESS_GROUP = 0,\n // Group较多的情况,每次都会设置tag到最顶层\n MORE_GROUP = 1\n}\n\nexport class Group extends Graphic<IGroupGraphicAttribute> implements IGroup {\n type: GraphicType = 'group';\n parent: any = null;\n isContainer: boolean = true;\n // 子元素的更新标记\n declare _childUpdateTag: number;\n\n declare theme?: ITheme;\n\n static NOWORK_ANIMATE_ATTR = NOWORK_ANIMATE_ATTR;\n\n constructor(params: IGroupGraphicAttribute) {\n super(params);\n this.numberType = GROUP_NUMBER_TYPE;\n this._childUpdateTag = UpdateTag.UPDATE_BOUNDS;\n // this.theme = new Theme();\n }\n\n setMode(mode: '2d' | '3d') {\n mode === '3d' ? this.set3dMode() : this.set2dMode();\n }\n\n set3dMode() {\n this.in3dMode = true;\n // this.forEachChildren((c: IGraphic) => {\n // c.setMode('3d');\n // });\n }\n set2dMode() {\n this.in3dMode = false;\n // this.forEachChildren((c: IGraphic) => {\n // c.setMode('2d');\n // });\n }\n\n setTheme(t: IThemeSpec) {\n if (!this.theme) {\n this.theme = new Theme();\n }\n return this.theme.setTheme(t, this);\n }\n\n createTheme() {\n if (!this.theme) {\n this.theme = new Theme();\n }\n }\n\n visibleAll(visible: boolean) {\n this.setAttribute('visible', visible);\n this.forEachChildren((item: IGraphic) => {\n if (item.isContainer && (item as any).visibleAll) {\n (item as any).visibleAll(visible);\n } else {\n item.setAttribute('visible', visible);\n }\n });\n }\n\n hideAll() {\n this.visibleAll(false);\n }\n\n showAll() {\n this.visibleAll(true);\n }\n\n /**\n * 是否包含某个点(点需要是全局坐标系)\n * group containsPoint 只需要判断bounds\n * TODO: group的shape判断\n * @param x\n * @param y\n * @param mode\n * @returns\n */\n containsPoint(x: number, y: number, mode: IContainPointMode): boolean {\n if (mode === IContainPointMode.GLOBAL) {\n // 转换x,y更精准\n const point = new Point(x, y);\n if (this.parent) {\n this.parent.globalTransMatrix.transformPoint(point, point);\n }\n return this.AABBBounds.contains(point.x, point.y);\n }\n return this.AABBBounds.contains(x, y);\n }\n\n shouldUpdateAABBBounds(): boolean {\n // 检索自己是否需要更新\n if (super.shouldUpdateAABBBounds()) {\n return true;\n }\n // 检索叶子节点是否有更新(如果children是叶子节点的话)\n if (this._childUpdateTag & UpdateTag.UPDATE_BOUNDS) {\n return true;\n }\n return false;\n // // 检索是否子group需要更新\n // let needUpdate = false;\n // this.forEachChildren((node: IGraphic) => {\n // // 只查找group层级\n // if (node.isContainer && (node as Group).shouldUpdateAABBBounds()) {\n // needUpdate = true;\n // return true;\n // }\n // return false;\n // });\n // return needUpdate;\n }\n\n protected tryUpdateAABBBounds(): IAABBBounds {\n if (!this.shouldUpdateAABBBounds()) {\n return this._AABBBounds;\n }\n this.stage?.graphicService.beforeUpdateAABBBounds(this, this.stage, true, this._AABBBounds);\n const selfChange = this.shouldSelfChangeUpdateAABBBounds();\n const bounds = this.doUpdateAABBBounds();\n this.addUpdateLayoutTag();\n this.stage?.graphicService.afterUpdateAABBBounds(this, this.stage, this._AABBBounds, this, selfChange);\n // 直接返回空Bounds,但是前面的流程还是要走\n if (this.attribute.boundsMode === 'empty') {\n bounds.clear();\n }\n return bounds;\n }\n\n /**\n * 大部分group不需要更新matrix,这里特殊优化一下\n * 更新局部matrix的具体函数\n */\n protected doUpdateLocalMatrix() {\n const {\n x = DefaultTransform.x,\n y = DefaultTransform.y,\n dx = DefaultTransform.dx,\n dy = DefaultTransform.dy,\n scaleX = DefaultTransform.scaleX,\n scaleY = DefaultTransform.scaleY,\n angle = DefaultTransform.angle,\n postMatrix\n } = this.attribute;\n if (x === 0 && y === 0 && dx === 0 && dy === 0 && scaleX === 1 && scaleY === 1 && angle === 0 && !postMatrix) {\n this._transMatrix.reset();\n return;\n }\n return super.doUpdateLocalMatrix();\n }\n\n getGraphicTheme(): Required<IGroupGraphicAttribute> {\n return getTheme(this).group;\n }\n\n protected updateAABBBounds(\n attribute: IGroupGraphicAttribute,\n groupTheme: Required<IGroupGraphicAttribute>,\n aabbBounds: IAABBBounds\n ) {\n const originalAABBBounds = aabbBounds; // fix aabbbounds update error in flex layout\n aabbBounds = aabbBounds.clone();\n\n const { width, height, path, clip = groupTheme.clip } = attribute;\n // 添加自身的fill或者clip\n if (path && path.length) {\n path.forEach(g => {\n aabbBounds.union(g.AABBBounds);\n });\n } else if (width != null && height != null) {\n aabbBounds.set(0, 0, Math.max(0, width), Math.max(0, height)); // fix bounds set when auto size in vtable\n }\n if (!clip) {\n // 添加子节点\n this.forEachChildren((node: IGraphic) => {\n aabbBounds.union(node.AABBBounds);\n });\n // 如果没有clip的话,还需要加一下scroll\n const { scrollX = 0, scrollY = 0 } = attribute;\n aabbBounds.translate(scrollX, scrollY);\n }\n application.graphicService.updateTempAABBBounds(aabbBounds);\n\n application.graphicService.transformAABBBounds(attribute, aabbBounds, groupTheme, false, this);\n\n originalAABBBounds.copy(aabbBounds);\n return originalAABBBounds;\n }\n\n protected doUpdateAABBBounds(): IAABBBounds {\n this.updateAABBBoundsStamp++;\n const bounds = super.doUpdateAABBBounds();\n\n // 更新bounds之后需要设置父节点,否则tag丢失\n this.parent && this.parent.addChildUpdateBoundTag();\n this._emitCustomEvent('AAABBBoundsChange');\n\n return bounds;\n }\n\n protected clearUpdateBoundTag() {\n this._updateTag &= UpdateTag.CLEAR_BOUNDS;\n this._childUpdateTag &= UpdateTag.CLEAR_BOUNDS;\n }\n\n addUpdateBoundTag() {\n this._updateTag |= UpdateTag.UPDATE_BOUNDS; // for bounds\n if (this.parent) {\n this.parent.addChildUpdateBoundTag();\n }\n }\n\n addChildUpdateBoundTag() {\n // 如果已经设置过updateTag,那就不需要设置了\n if (this._childUpdateTag & UpdateTag.UPDATE_BOUNDS) {\n return;\n }\n // 如果没有设置过,那么继续向上设置\n this._childUpdateTag |= UpdateTag.UPDATE_BOUNDS;\n this.parent && this.parent.addChildUpdateBoundTag();\n }\n\n getTheme() {\n return this.theme.getTheme(this);\n }\n\n /* 场景树结构 */\n incrementalAppendChild(node: INode): INode | null {\n const data = super.appendChild(node);\n if (this.stage && data) {\n (data as unknown as this).stage = this.stage;\n (data as unknown as this).layer = this.layer;\n }\n this.addUpdateBoundTag();\n this.stage?.graphicService.onAddIncremental(node as unknown as IGraphic, this, this.stage);\n return data;\n }\n incrementalClearChild(): void {\n super.removeAllChild();\n this.addUpdateBoundTag();\n this.stage?.graphicService.onClearIncremental(this, this.stage);\n return;\n }\n\n protected _updateChildToStage(child: IGraphic) {\n if (this.stage && child) {\n child.setStage(this.stage, this.layer);\n }\n this.addUpdateBoundTag();\n return child;\n }\n // TODO 代码优化\n appendChild(node: INode, addStage: boolean = true): INode | null {\n const data = super.appendChild(node);\n if (addStage && this.stage && data) {\n (data as unknown as this).setStage(this.stage, this.layer);\n }\n this.addUpdateBoundTag();\n return data;\n }\n insertBefore(newNode: INode, referenceNode: INode): INode | null {\n return this._updateChildToStage(super.insertBefore(newNode, referenceNode) as undefined as IGraphic);\n }\n insertAfter(newNode: INode, referenceNode: INode): INode | null {\n return this._updateChildToStage(super.insertAfter(newNode, referenceNode) as undefined as IGraphic);\n }\n insertInto(newNode: INode, idx: number): INode | null {\n return this._updateChildToStage(super.insertInto(newNode, idx) as undefined as IGraphic);\n }\n\n removeChild(child: IGraphic): IGraphic {\n const data = super.removeChild(child);\n child.stage = null;\n this.stage?.graphicService.onRemove(child);\n this.addUpdateBoundTag();\n return data as IGraphic;\n }\n\n removeAllChild(deep: boolean = false): void {\n this.forEachChildren((child: IGraphic) => {\n this.stage?.graphicService.onRemove(child);\n if (deep && child.isContainer) {\n child.removeAllChild(deep);\n }\n });\n super.removeAllChild();\n this.addUpdateBoundTag();\n }\n\n setStage(stage?: IStage, layer?: ILayer) {\n if (this.stage !== stage) {\n this.stage = stage;\n this.layer = layer;\n this.setStageToShadowRoot(stage, layer);\n this._onSetStage && this._onSetStage(this, stage, layer);\n this.stage?.graphicService.onSetStage(this, stage);\n this.forEachChildren(item => {\n (item as any).setStage(stage, this.layer);\n });\n }\n }\n /**\n * 更新位置tag,包括全局tag和局部tag\n */\n addUpdatePositionTag() {\n super.addUpdatePositionTag();\n // 批量设置底层group的global tag\n this.forEachChildren((g: Group) => {\n if (g.isContainer) {\n g.addUpdateGlobalPositionTag();\n }\n });\n }\n /**\n * 更新全局位置tag\n */\n addUpdateGlobalPositionTag() {\n super.addUpdateGlobalPositionTag();\n // 批量设置底层group的global tag\n this.forEachChildren((g: Group) => {\n if (g.isContainer) {\n g.addUpdateGlobalPositionTag();\n }\n });\n }\n /**\n * group更新全局的transMatrix\n * @param clearTag\n * @returns\n */\n protected tryUpdateGlobalTransMatrix(clearTag: boolean = true): Matrix {\n if (this.shouldUpdateGlobalMatrix()) {\n if (!this._globalTransMatrix) {\n this._globalTransMatrix = this.parent\n ? (this.parent as IGroup).globalTransMatrix.clone()\n : this.transMatrix.clone();\n } else if (this.parent) {\n const m = (this.parent as IGroup).globalTransMatrix;\n this._globalTransMatrix.setValue(m.a, m.b, m.c, m.d, m.e, m.f);\n }\n this.doUpdateGlobalMatrix();\n clearTag && this.clearUpdateGlobalPositionTag();\n }\n return this._globalTransMatrix;\n }\n /**\n * 查找自身更新global的tag,如果存在,就更新\n * @returns\n */\n shouldUpdateGlobalMatrix(): boolean {\n const shouldUpdate = !!(this._updateTag & UpdateTag.UPDATE_GLOBAL_MATRIX);\n return shouldUpdate;\n }\n\n private _getChildByName<T extends INode = INode>(name: string, deep?: boolean): T | null {\n return this.find(node => node.name === name, deep);\n }\n\n /**\n * if graphic exist then update attributes, otherwise create a new instance\n * @param graphicName the name of graphic\n * @param attributes the attributes of graphic\n * @param graphicType the type of graphic\n * @returns the graphic instance\n */\n createOrUpdateChild<T extends keyof GraphicAttributeMap>(\n graphicName: string,\n attributes: GraphicAttributeMap[T],\n graphicType: T\n ): INode {\n let graphic = this._getChildByName(graphicName) as IGraphic;\n if (graphic) {\n graphic.setAttributes(attributes);\n } else {\n graphic = application.graphicService.creator[graphicType](attributes as any);\n graphic.name = graphicName;\n this.add(graphic);\n }\n\n return graphic;\n }\n\n clone() {\n return new Group({ ...this.attribute });\n }\n\n getNoWorkAnimateAttr(): Record<string, number> {\n return Group.NOWORK_ANIMATE_ATTR;\n }\n\n release(all?: boolean) {\n if (all) {\n this.forEachChildren((g: IGraphic) => {\n g.release(all);\n });\n }\n super.release();\n }\n}\n\nexport function createGroup(attributes: IGroupGraphicAttribute): IGroup {\n return new Group(attributes);\n}\n"]}