@visactor/vrender-core 0.20.0-alpha.3 → 0.20.0-alpha.4

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.
@@ -44,6 +44,7 @@ export declare class Path extends Graphic<IPathGraphicAttribute> implements IPat
44
44
  getParsedPathShape(): CustomPath2D;
45
45
  getGraphicTheme(): Required<IPathGraphicAttribute>;
46
46
  protected updateAABBBounds(attribute: IPathGraphicAttribute, pathTheme: Required<IPathGraphicAttribute>, aabbBounds: IAABBBounds): import("@visactor/vutils").IBounds;
47
+ protected doUpdateAABBBounds(full?: boolean): import("@visactor/vutils").IBounds;
47
48
  protected doUpdatePathShape(): void;
48
49
  protected needUpdateTags(keys: string[]): boolean;
49
50
  protected needUpdateTag(key: string): boolean;
@@ -43,6 +43,9 @@ class Path extends graphic_1.Graphic {
43
43
  return application_1.application.graphicService.transformAABBBounds(attribute, aabbBounds, pathTheme, "miter" === lineJoin, this),
44
44
  aabbBounds;
45
45
  }
46
+ doUpdateAABBBounds(full) {
47
+ return this.doUpdatePathShape(), super.doUpdateAABBBounds(full);
48
+ }
46
49
  doUpdatePathShape() {
47
50
  const attribute = this.attribute;
48
51
  (0, vutils_1.isString)(attribute.path, !0) ? this.cache = (new custom_path2d_1.CustomPath2D).fromString(attribute.path) : attribute.customPath && (this.cache = new custom_path2d_1.CustomPath2D,
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/graphic/path.ts"],"names":[],"mappings":";;;AACA,6CAAmD;AACnD,uCAAiF;AAEjF,2DAAuD;AACvD,mCAAmC;AACnC,gDAA6C;AAC7C,2CAA+C;AAC/C,2FAA8F;AAE9F,MAAM,mBAAmB,GAAG,CAAC,MAAM,EAAE,YAAY,EAAE,GAAG,gCAAsB,CAAC,CAAC;AAE9E,MAAa,IAAK,SAAQ,iBAA8B;IAUtD,YAAY,MAA6B;QACvC,KAAK,CAAC,MAAM,CAAC,CAAC;QAVhB,SAAI,GAAW,MAAM,CAAC;QAW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KAAK,CAAC,cAAc,CAAC,IAAI,EAAE,mBAAmB,CAAC,CAAC;IACzD,CAAC;IACS,aAAa,CAAC,GAAW;QACjC,OAAO,KAAK,CAAC,aAAa,CAAC,GAAG,EAAE,mBAAmB,CAAC,CAAC;IACvD,CAAC;IAED,YAAY;QACV,MAAM,CAAC,GAAG,CAAC,CAAC;QACZ,MAAM,CAAC,GAAG,CAAC,CAAC;QAEZ,OAAO,IAAI,4BAAY,EAAE,CAAC,gBAAgB,CAAC,IAAI,CAAC,kBAAkB,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IAC9E,CAAC;IAED,KAAK;QACH,OAAO,IAAI,IAAI,mBAAM,IAAI,CAAC,SAAS,EAAG,CAAC;IACzC,CAAC;IAED,oBAAoB;QAClB,OAAO,IAAI,CAAC,mBAAmB,CAAC;IAClC,CAAC;;AAzGH,oBA0GC;AAtGQ,wBAAmB,mBACxB,IAAI,EAAE,CAAC,EACP,UAAU,EAAE,CAAC,IACV,6BAAmB,EACtB;AAoGJ,SAAgB,UAAU,CAAC,UAAiC;IAC1D,OAAO,IAAI,IAAI,CAAC,UAAU,CAAC,CAAC;AAC9B,CAAC;AAFD,gCAEC","file":"path.js","sourcesContent":["import type { IAABBBounds } from '@visactor/vutils';\nimport { isString, isNil } from '@visactor/vutils';\nimport { Graphic, GRAPHIC_UPDATE_TAG_KEY, NOWORK_ANIMATE_ATTR } from './graphic';\nimport type { ICustomPath2D, IPath, IPathGraphicAttribute } from '../interface';\nimport { CustomPath2D } from '../common/custom-path2d';\nimport { getTheme } from './theme';\nimport { application } from '../application';\nimport { PATH_NUMBER_TYPE } from './constants';\nimport { updateBoundsOfCommonOuterBorder } from './graphic-service/common-outer-boder-bounds';\n\nconst PATH_UPDATE_TAG_KEY = ['path', 'customPath', ...GRAPHIC_UPDATE_TAG_KEY];\n\nexport class Path extends Graphic<IPathGraphicAttribute> implements IPath {\n type: 'path' = 'path';\n cache?: ICustomPath2D;\n\n static NOWORK_ANIMATE_ATTR = {\n path: 1,\n customPath: 1,\n ...NOWORK_ANIMATE_ATTR\n };\n\n constructor(params: IPathGraphicAttribute) {\n super(params);\n this.numberType = PATH_NUMBER_TYPE;\n }\n\n get pathShape(): ICustomPath2D {\n this.tryUpdateAABBBounds();\n return this.getParsedPathShape();\n }\n\n isValid(): boolean {\n return super.isValid() && this._isValid();\n }\n private _isValid(): boolean {\n const { path } = this.attribute;\n return path != null && path !== '';\n }\n\n getParsedPathShape(): CustomPath2D {\n const pathTheme = this.getGraphicTheme();\n if (!this.valid) {\n return pathTheme.path as CustomPath2D;\n }\n const attribute = this.attribute;\n if (attribute.path instanceof CustomPath2D) {\n return attribute.path;\n }\n\n if (isNil(this.cache)) {\n this.doUpdatePathShape();\n }\n\n if (this.cache instanceof CustomPath2D) {\n return this.cache;\n }\n return pathTheme.path as CustomPath2D;\n }\n\n getGraphicTheme(): Required<IPathGraphicAttribute> {\n return getTheme(this).path;\n }\n\n protected updateAABBBounds(\n attribute: IPathGraphicAttribute,\n pathTheme: Required<IPathGraphicAttribute>,\n aabbBounds: IAABBBounds\n ) {\n if (!application.graphicService.validCheck(attribute, pathTheme, aabbBounds, this)) {\n return aabbBounds;\n }\n if (!this.updatePathProxyAABBBounds(aabbBounds)) {\n const pathShape = this.getParsedPathShape();\n aabbBounds.union(pathShape.getBounds());\n }\n\n const { tb1, tb2 } = application.graphicService.updateTempAABBBounds(aabbBounds);\n\n updateBoundsOfCommonOuterBorder(attribute, pathTheme, tb1);\n aabbBounds.union(tb1);\n tb1.setValue(tb2.x1, tb2.y1, tb2.x2, tb2.y2);\n const { lineJoin = pathTheme.lineJoin } = attribute;\n application.graphicService.transformAABBBounds(attribute, aabbBounds, pathTheme, lineJoin === 'miter', this);\n return aabbBounds;\n }\n\n protected doUpdatePathShape() {\n const attribute = this.attribute;\n if (isString(attribute.path, true)) {\n this.cache = new CustomPath2D().fromString(attribute.path as string);\n } else if (attribute.customPath) {\n this.cache = new CustomPath2D();\n attribute.customPath(this.cache, this);\n }\n }\n\n protected needUpdateTags(keys: string[]): boolean {\n return super.needUpdateTags(keys, PATH_UPDATE_TAG_KEY);\n }\n protected needUpdateTag(key: string): boolean {\n return super.needUpdateTag(key, PATH_UPDATE_TAG_KEY);\n }\n\n toCustomPath() {\n const x = 0;\n const y = 0;\n\n return new CustomPath2D().fromCustomPath2D(this.getParsedPathShape(), x, y);\n }\n\n clone() {\n return new Path({ ...this.attribute });\n }\n\n getNoWorkAnimateAttr(): Record<string, number> {\n return Path.NOWORK_ANIMATE_ATTR;\n }\n}\n\nexport function createPath(attributes: IPathGraphicAttribute): IPath {\n return new Path(attributes);\n}\n"]}
1
+ {"version":3,"sources":["../src/graphic/path.ts"],"names":[],"mappings":";;;AACA,6CAAmD;AACnD,uCAAiF;AAEjF,2DAAuD;AACvD,mCAAmC;AACnC,gDAA6C;AAC7C,2CAA+C;AAC/C,2FAA8F;AAE9F,MAAM,mBAAmB,GAAG,CAAC,MAAM,EAAE,YAAY,EAAE,GAAG,gCAAsB,CAAC,CAAC;AAE9E,MAAa,IAAK,SAAQ,iBAA8B;IAUtD,YAAY,MAA6B;QACvC,KAAK,CAAC,MAAM,CAAC,CAAC;QAVhB,SAAI,GAAW,MAAM,CAAC;QAWpB,IAAI,CAAC,UAAU,GAAG,4BAAgB,CAAC;IACrC,CAAC;IAED,IAAI,SAAS;QACX,IAAI,CAAC,mBAAmB,EAAE,CAAC;QAC3B,OAAO,IAAI,CAAC,kBAAkB,EAAE,CAAC;IACnC,CAAC;IAED,OAAO;QACL,OAAO,KAAK,CAAC,OAAO,EAAE,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;IAC5C,CAAC;IACO,QAAQ;QACd,MAAM,EAAE,IAAI,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC;QAChC,OAAO,IAAI,IAAI,IAAI,IAAI,IAAI,KAAK,EAAE,CAAC;IACrC,CAAC;IAED,kBAAkB;QAChB,MAAM,SAAS,GAAG,IAAI,CAAC,eAAe,EA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E,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IAC9E,CAAC;IAED,KAAK;QACH,OAAO,IAAI,IAAI,mBAAM,IAAI,CAAC,SAAS,EAAG,CAAC;IACzC,CAAC;IAED,oBAAoB;QAClB,OAAO,IAAI,CAAC,mBAAmB,CAAC;IAClC,CAAC;;AA9GH,oBA+GC;AA3GQ,wBAAmB,mBACxB,IAAI,EAAE,CAAC,EACP,UAAU,EAAE,CAAC,IACV,6BAAmB,EACtB;AAyGJ,SAAgB,UAAU,CAAC,UAAiC;IAC1D,OAAO,IAAI,IAAI,CAAC,UAAU,CAAC,CAAC;AAC9B,CAAC;AAFD,gCAEC","file":"path.js","sourcesContent":["import type { IAABBBounds } from '@visactor/vutils';\nimport { isString, isNil } from '@visactor/vutils';\nimport { Graphic, GRAPHIC_UPDATE_TAG_KEY, NOWORK_ANIMATE_ATTR } from './graphic';\nimport type { ICustomPath2D, IPath, IPathGraphicAttribute } from '../interface';\nimport { CustomPath2D } from '../common/custom-path2d';\nimport { getTheme } from './theme';\nimport { application } from '../application';\nimport { PATH_NUMBER_TYPE } from './constants';\nimport { updateBoundsOfCommonOuterBorder } from './graphic-service/common-outer-boder-bounds';\n\nconst PATH_UPDATE_TAG_KEY = ['path', 'customPath', ...GRAPHIC_UPDATE_TAG_KEY];\n\nexport class Path extends Graphic<IPathGraphicAttribute> implements IPath {\n type: 'path' = 'path';\n cache?: ICustomPath2D;\n\n static NOWORK_ANIMATE_ATTR = {\n path: 1,\n customPath: 1,\n ...NOWORK_ANIMATE_ATTR\n };\n\n constructor(params: IPathGraphicAttribute) {\n super(params);\n this.numberType = PATH_NUMBER_TYPE;\n }\n\n get pathShape(): ICustomPath2D {\n this.tryUpdateAABBBounds();\n return this.getParsedPathShape();\n }\n\n isValid(): boolean {\n return super.isValid() && this._isValid();\n }\n private _isValid(): boolean {\n const { path } = this.attribute;\n return path != null && path !== '';\n }\n\n getParsedPathShape(): CustomPath2D {\n const pathTheme = this.getGraphicTheme();\n if (!this.valid) {\n return pathTheme.path as CustomPath2D;\n }\n const attribute = this.attribute;\n if (attribute.path instanceof CustomPath2D) {\n return attribute.path;\n }\n\n if (isNil(this.cache)) {\n this.doUpdatePathShape();\n }\n\n if (this.cache instanceof CustomPath2D) {\n return this.cache;\n }\n return pathTheme.path as CustomPath2D;\n }\n\n getGraphicTheme(): Required<IPathGraphicAttribute> {\n return getTheme(this).path;\n }\n\n protected updateAABBBounds(\n attribute: IPathGraphicAttribute,\n pathTheme: Required<IPathGraphicAttribute>,\n aabbBounds: IAABBBounds\n ) {\n if (!application.graphicService.validCheck(attribute, pathTheme, aabbBounds, this)) {\n return aabbBounds;\n }\n if (!this.updatePathProxyAABBBounds(aabbBounds)) {\n const pathShape = this.getParsedPathShape();\n aabbBounds.union(pathShape.getBounds());\n }\n\n const { tb1, tb2 } = application.graphicService.updateTempAABBBounds(aabbBounds);\n\n updateBoundsOfCommonOuterBorder(attribute, pathTheme, tb1);\n aabbBounds.union(tb1);\n tb1.setValue(tb2.x1, tb2.y1, tb2.x2, tb2.y2);\n const { lineJoin = pathTheme.lineJoin } = attribute;\n application.graphicService.transformAABBBounds(attribute, aabbBounds, pathTheme, lineJoin === 'miter', this);\n return aabbBounds;\n }\n\n protected doUpdateAABBBounds(full?: boolean) {\n this.doUpdatePathShape();\n return super.doUpdateAABBBounds(full);\n }\n\n protected doUpdatePathShape() {\n const attribute = this.attribute;\n if (isString(attribute.path, true)) {\n this.cache = new CustomPath2D().fromString(attribute.path as string);\n } else if (attribute.customPath) {\n this.cache = new CustomPath2D();\n attribute.customPath(this.cache, this);\n }\n }\n\n protected needUpdateTags(keys: string[]): boolean {\n return super.needUpdateTags(keys, PATH_UPDATE_TAG_KEY);\n }\n protected needUpdateTag(key: string): boolean {\n return super.needUpdateTag(key, PATH_UPDATE_TAG_KEY);\n }\n\n toCustomPath() {\n const x = 0;\n const y = 0;\n\n return new CustomPath2D().fromCustomPath2D(this.getParsedPathShape(), x, y);\n }\n\n clone() {\n return new Path({ ...this.attribute });\n }\n\n getNoWorkAnimateAttr(): Record<string, number> {\n return Path.NOWORK_ANIMATE_ATTR;\n }\n}\n\nexport function createPath(attributes: IPathGraphicAttribute): IPath {\n return new Path(attributes);\n}\n"]}
package/dist/index.es.js CHANGED
@@ -22470,6 +22470,10 @@ class Path extends Graphic {
22470
22470
  application.graphicService.transformAABBBounds(attribute, aabbBounds, pathTheme, lineJoin === 'miter', this);
22471
22471
  return aabbBounds;
22472
22472
  }
22473
+ doUpdateAABBBounds(full) {
22474
+ this.doUpdatePathShape();
22475
+ return super.doUpdateAABBBounds(full);
22476
+ }
22473
22477
  doUpdatePathShape() {
22474
22478
  const attribute = this.attribute;
22475
22479
  if (isString(attribute.path, true)) {
@@ -44,6 +44,7 @@ export declare class Path extends Graphic<IPathGraphicAttribute> implements IPat
44
44
  getParsedPathShape(): CustomPath2D;
45
45
  getGraphicTheme(): Required<IPathGraphicAttribute>;
46
46
  protected updateAABBBounds(attribute: IPathGraphicAttribute, pathTheme: Required<IPathGraphicAttribute>, aabbBounds: IAABBBounds): import("@visactor/vutils").IBounds;
47
+ protected doUpdateAABBBounds(full?: boolean): import("@visactor/vutils").IBounds;
47
48
  protected doUpdatePathShape(): void;
48
49
  protected needUpdateTags(keys: string[]): boolean;
49
50
  protected needUpdateTag(key: string): boolean;
@@ -51,6 +51,9 @@ export class Path extends Graphic {
51
51
  return application.graphicService.transformAABBBounds(attribute, aabbBounds, pathTheme, "miter" === lineJoin, this),
52
52
  aabbBounds;
53
53
  }
54
+ doUpdateAABBBounds(full) {
55
+ return this.doUpdatePathShape(), super.doUpdateAABBBounds(full);
56
+ }
54
57
  doUpdatePathShape() {
55
58
  const attribute = this.attribute;
56
59
  isString(attribute.path, !0) ? this.cache = (new CustomPath2D).fromString(attribute.path) : attribute.customPath && (this.cache = new CustomPath2D,
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/graphic/path.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,KAA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CAAC,CAAC;AAC9B,CAAC","file":"path.js","sourcesContent":["import type { IAABBBounds } from '@visactor/vutils';\nimport { isString, isNil } from '@visactor/vutils';\nimport { Graphic, GRAPHIC_UPDATE_TAG_KEY, NOWORK_ANIMATE_ATTR } from './graphic';\nimport type { ICustomPath2D, IPath, IPathGraphicAttribute } from '../interface';\nimport { CustomPath2D } from '../common/custom-path2d';\nimport { getTheme } from './theme';\nimport { application } from '../application';\nimport { PATH_NUMBER_TYPE } from './constants';\nimport { updateBoundsOfCommonOuterBorder } from './graphic-service/common-outer-boder-bounds';\n\nconst PATH_UPDATE_TAG_KEY = ['path', 'customPath', ...GRAPHIC_UPDATE_TAG_KEY];\n\nexport class Path extends Graphic<IPathGraphicAttribute> implements IPath {\n type: 'path' = 'path';\n cache?: ICustomPath2D;\n\n static NOWORK_ANIMATE_ATTR = {\n path: 1,\n customPath: 1,\n ...NOWORK_ANIMATE_ATTR\n };\n\n constructor(params: IPathGraphicAttribute) {\n super(params);\n this.numberType = PATH_NUMBER_TYPE;\n }\n\n get pathShape(): ICustomPath2D {\n this.tryUpdateAABBBounds();\n return this.getParsedPathShape();\n }\n\n isValid(): boolean {\n return super.isValid() && this._isValid();\n }\n private _isValid(): boolean {\n const { path } = this.attribute;\n return path != null && path !== '';\n }\n\n getParsedPathShape(): CustomPath2D {\n const pathTheme = this.getGraphicTheme();\n if (!this.valid) {\n return pathTheme.path as CustomPath2D;\n }\n const attribute = this.attribute;\n if (attribute.path instanceof CustomPath2D) {\n return attribute.path;\n }\n\n if (isNil(this.cache)) {\n this.doUpdatePathShape();\n }\n\n if (this.cache instanceof CustomPath2D) {\n return this.cache;\n }\n return pathTheme.path as CustomPath2D;\n }\n\n getGraphicTheme(): Required<IPathGraphicAttribute> {\n return getTheme(this).path;\n }\n\n protected updateAABBBounds(\n attribute: IPathGraphicAttribute,\n pathTheme: Required<IPathGraphicAttribute>,\n aabbBounds: IAABBBounds\n ) {\n if (!application.graphicService.validCheck(attribute, pathTheme, aabbBounds, this)) {\n return aabbBounds;\n }\n if (!this.updatePathProxyAABBBounds(aabbBounds)) {\n const pathShape = this.getParsedPathShape();\n aabbBounds.union(pathShape.getBounds());\n }\n\n const { tb1, tb2 } = application.graphicService.updateTempAABBBounds(aabbBounds);\n\n updateBoundsOfCommonOuterBorder(attribute, pathTheme, tb1);\n aabbBounds.union(tb1);\n tb1.setValue(tb2.x1, tb2.y1, tb2.x2, tb2.y2);\n const { lineJoin = pathTheme.lineJoin } = attribute;\n application.graphicService.transformAABBBounds(attribute, aabbBounds, pathTheme, lineJoin === 'miter', this);\n return aabbBounds;\n }\n\n protected doUpdatePathShape() {\n const attribute = this.attribute;\n if (isString(attribute.path, true)) {\n this.cache = new CustomPath2D().fromString(attribute.path as string);\n } else if (attribute.customPath) {\n this.cache = new CustomPath2D();\n attribute.customPath(this.cache, this);\n }\n }\n\n protected needUpdateTags(keys: string[]): boolean {\n return super.needUpdateTags(keys, PATH_UPDATE_TAG_KEY);\n }\n protected needUpdateTag(key: string): boolean {\n return super.needUpdateTag(key, PATH_UPDATE_TAG_KEY);\n }\n\n toCustomPath() {\n const x = 0;\n const y = 0;\n\n return new CustomPath2D().fromCustomPath2D(this.getParsedPathShape(), x, y);\n }\n\n clone() {\n return new Path({ ...this.attribute });\n }\n\n getNoWorkAnimateAttr(): Record<string, number> {\n return Path.NOWORK_ANIMATE_ATTR;\n }\n}\n\nexport function createPath(attributes: IPathGraphicAttribute): IPath {\n return new Path(attributes);\n}\n"]}
1
+ {"version":3,"sources":["../src/graphic/path.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,sBAAsB,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAEjF,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,EAAE,WAAW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IAES,iBAAiB;QACzB,MAAM,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC;QACjC,IAAI,QAAQ,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE;YAClC,IAAI,CAAC,KAAK,GAAG,IAAI,YAAY,EAAE,CAAC,UAAU,CAAC,SAAS,CAAC,IAAc,CAAC,CAAC;SACtE;aAAM,IAAI,SAAS,CAAC,UAAU,EAAE;YAC/B,IAAI,CAAC,KAAK,GAAG,IAAI,YAAY,EAAE,CAAC;YAChC,SAAS,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;SACxC;IACH,CAAC;IAES,cAAc,CAAC,IAAc;QACrC,OAAO,KAAK,CAAC,cAAc,CAAC,IAAI,EAAE,mBAAmB,CAAC,CAAC;IACzD,CAAC;IACS,aAAa,CAAC,GAAW;QACjC,OAAO,KAAK,CAAC,aAAa,CAAC,GAAG,EAAE,mBAAmB,CAAC,CAAC;IACvD,CAAC;IAED,YAAY;QACV,MAAM,CAAC,GAAG,CAAC,CAAC;QACZ,MAAM,CAAC,GAAG,CAAC,CAAC;QAEZ,OAAO,IAAI,YAAY,EAAE,CAAC,gBAAgB,CAAC,IAAI,CAAC,kBAAkB,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IAC9E,CAAC;IAED,KAAK;QACH,OAAO,IAAI,IAAI,mBAAM,IAAI,CAAC,SAAS,EAAG,CAAC;IACzC,CAAC;IAED,oBAAoB;QAClB,OAAO,IAAI,CAAC,mBAAmB,CAAC;IAClC,CAAC;;AA1GM,wBAAmB,mBACxB,IAAI,EAAE,CAAC,EACP,UAAU,EAAE,CAAC,IACV,mBAAmB,EACtB;AAyGJ,MAAM,UAAU,UAAU,CAAC,UAAiC;IAC1D,OAAO,IAAI,IAAI,CAAC,UAAU,CAAC,CAAC;AAC9B,CAAC","file":"path.js","sourcesContent":["import type { IAABBBounds } from '@visactor/vutils';\nimport { isString, isNil } from '@visactor/vutils';\nimport { Graphic, GRAPHIC_UPDATE_TAG_KEY, NOWORK_ANIMATE_ATTR } from './graphic';\nimport type { ICustomPath2D, IPath, IPathGraphicAttribute } from '../interface';\nimport { CustomPath2D } from '../common/custom-path2d';\nimport { getTheme } from './theme';\nimport { application } from '../application';\nimport { PATH_NUMBER_TYPE } from './constants';\nimport { updateBoundsOfCommonOuterBorder } from './graphic-service/common-outer-boder-bounds';\n\nconst PATH_UPDATE_TAG_KEY = ['path', 'customPath', ...GRAPHIC_UPDATE_TAG_KEY];\n\nexport class Path extends Graphic<IPathGraphicAttribute> implements IPath {\n type: 'path' = 'path';\n cache?: ICustomPath2D;\n\n static NOWORK_ANIMATE_ATTR = {\n path: 1,\n customPath: 1,\n ...NOWORK_ANIMATE_ATTR\n };\n\n constructor(params: IPathGraphicAttribute) {\n super(params);\n this.numberType = PATH_NUMBER_TYPE;\n }\n\n get pathShape(): ICustomPath2D {\n this.tryUpdateAABBBounds();\n return this.getParsedPathShape();\n }\n\n isValid(): boolean {\n return super.isValid() && this._isValid();\n }\n private _isValid(): boolean {\n const { path } = this.attribute;\n return path != null && path !== '';\n }\n\n getParsedPathShape(): CustomPath2D {\n const pathTheme = this.getGraphicTheme();\n if (!this.valid) {\n return pathTheme.path as CustomPath2D;\n }\n const attribute = this.attribute;\n if (attribute.path instanceof CustomPath2D) {\n return attribute.path;\n }\n\n if (isNil(this.cache)) {\n this.doUpdatePathShape();\n }\n\n if (this.cache instanceof CustomPath2D) {\n return this.cache;\n }\n return pathTheme.path as CustomPath2D;\n }\n\n getGraphicTheme(): Required<IPathGraphicAttribute> {\n return getTheme(this).path;\n }\n\n protected updateAABBBounds(\n attribute: IPathGraphicAttribute,\n pathTheme: Required<IPathGraphicAttribute>,\n aabbBounds: IAABBBounds\n ) {\n if (!application.graphicService.validCheck(attribute, pathTheme, aabbBounds, this)) {\n return aabbBounds;\n }\n if (!this.updatePathProxyAABBBounds(aabbBounds)) {\n const pathShape = this.getParsedPathShape();\n aabbBounds.union(pathShape.getBounds());\n }\n\n const { tb1, tb2 } = application.graphicService.updateTempAABBBounds(aabbBounds);\n\n updateBoundsOfCommonOuterBorder(attribute, pathTheme, tb1);\n aabbBounds.union(tb1);\n tb1.setValue(tb2.x1, tb2.y1, tb2.x2, tb2.y2);\n const { lineJoin = pathTheme.lineJoin } = attribute;\n application.graphicService.transformAABBBounds(attribute, aabbBounds, pathTheme, lineJoin === 'miter', this);\n return aabbBounds;\n }\n\n protected doUpdateAABBBounds(full?: boolean) {\n this.doUpdatePathShape();\n return super.doUpdateAABBBounds(full);\n }\n\n protected doUpdatePathShape() {\n const attribute = this.attribute;\n if (isString(attribute.path, true)) {\n this.cache = new CustomPath2D().fromString(attribute.path as string);\n } else if (attribute.customPath) {\n this.cache = new CustomPath2D();\n attribute.customPath(this.cache, this);\n }\n }\n\n protected needUpdateTags(keys: string[]): boolean {\n return super.needUpdateTags(keys, PATH_UPDATE_TAG_KEY);\n }\n protected needUpdateTag(key: string): boolean {\n return super.needUpdateTag(key, PATH_UPDATE_TAG_KEY);\n }\n\n toCustomPath() {\n const x = 0;\n const y = 0;\n\n return new CustomPath2D().fromCustomPath2D(this.getParsedPathShape(), x, y);\n }\n\n clone() {\n return new Path({ ...this.attribute });\n }\n\n getNoWorkAnimateAttr(): Record<string, number> {\n return Path.NOWORK_ANIMATE_ATTR;\n }\n}\n\nexport function createPath(attributes: IPathGraphicAttribute): IPath {\n return new Path(attributes);\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@visactor/vrender-core",
3
- "version": "0.20.0-alpha.3",
3
+ "version": "0.20.0-alpha.4",
4
4
  "description": "",
5
5
  "sideEffects": [
6
6
  "./src/modules.ts",