@visactor/vrender 0.15.3 → 0.15.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.
Files changed (61) hide show
  1. package/cjs/allocator/canvas-allocate.js +2 -1
  2. package/cjs/animate/default-ticker.js +1 -2
  3. package/cjs/canvas/constants.js +1 -1
  4. package/cjs/canvas/empty-context.js +1 -1
  5. package/cjs/canvas/index.js +1 -1
  6. package/cjs/canvas/util.js +1 -1
  7. package/cjs/common/custom-path2d.js +1 -2
  8. package/cjs/common/morphing-utils.js +2 -1
  9. package/cjs/core/application.js +1 -2
  10. package/cjs/core/global-module.js +0 -2
  11. package/cjs/core/layer-service.js +1 -1
  12. package/cjs/core/layer.js +1 -1
  13. package/cjs/core/light.js +1 -1
  14. package/cjs/core/stage.js +1 -1
  15. package/cjs/graphic/graphic-service/common-contribution.d.ts +2 -2
  16. package/cjs/graphic/graphic-service/common-contribution.js +1 -1
  17. package/cjs/graphic/graphic-service/common-contribution.js.map +1 -1
  18. package/cjs/graphic/graphic-service/symbol-contribution.js +1 -1
  19. package/cjs/graphic/graphic-service/symbol-contribution.js.map +1 -1
  20. package/cjs/graphic/graphic.d.ts +3 -0
  21. package/cjs/graphic/graphic.js +45 -19
  22. package/cjs/graphic/graphic.js.map +1 -1
  23. package/cjs/index.d.ts +1 -1
  24. package/cjs/index.js +1 -1
  25. package/cjs/index.js.map +1 -1
  26. package/cjs/interface/graphic.d.ts +1 -1
  27. package/cjs/interface/graphic.js.map +1 -1
  28. package/cjs/render/contributions/render/draw-interceptor.js +1 -1
  29. package/cjs/render/contributions/render/draw-interceptor.js.map +1 -1
  30. package/dist/index.js +72 -27
  31. package/dist/index.min.js +1 -1
  32. package/es/allocator/canvas-allocate.js +2 -1
  33. package/es/animate/default-ticker.js +1 -2
  34. package/es/canvas/constants.js +1 -1
  35. package/es/canvas/empty-context.js +1 -1
  36. package/es/canvas/index.js +1 -1
  37. package/es/canvas/util.js +1 -1
  38. package/es/common/custom-path2d.js +1 -2
  39. package/es/common/morphing-utils.js +2 -1
  40. package/es/core/application.js +1 -2
  41. package/es/core/global-module.js +0 -2
  42. package/es/core/layer-service.js +1 -1
  43. package/es/core/layer.js +1 -1
  44. package/es/core/light.js +1 -1
  45. package/es/core/stage.js +1 -1
  46. package/es/graphic/graphic-service/common-contribution.d.ts +2 -2
  47. package/es/graphic/graphic-service/common-contribution.js +1 -1
  48. package/es/graphic/graphic-service/common-contribution.js.map +1 -1
  49. package/es/graphic/graphic-service/symbol-contribution.js +1 -1
  50. package/es/graphic/graphic-service/symbol-contribution.js.map +1 -1
  51. package/es/graphic/graphic.d.ts +3 -0
  52. package/es/graphic/graphic.js +44 -19
  53. package/es/graphic/graphic.js.map +1 -1
  54. package/es/index.d.ts +1 -1
  55. package/es/index.js +1 -1
  56. package/es/index.js.map +1 -1
  57. package/es/interface/graphic.d.ts +1 -1
  58. package/es/interface/graphic.js.map +1 -1
  59. package/es/render/contributions/render/draw-interceptor.js +1 -1
  60. package/es/render/contributions/render/draw-interceptor.js.map +1 -1
  61. package/package.json +3 -3
@@ -38,4 +38,5 @@ export class DefaultCanvasAllocate {
38
38
  }
39
39
  }
40
40
 
41
- export const canvasAllocate = new DefaultCanvasAllocate;
41
+ export const canvasAllocate = new DefaultCanvasAllocate;
42
+ //# sourceMappingURL=canvas-allocate.js.map
@@ -8,5 +8,4 @@ defaultTicker.addTimeline(defaultTimeline);
8
8
 
9
9
  const TICKER_FPS = 60;
10
10
 
11
- defaultTicker.setFPS(60);
12
- //# sourceMappingURL=default-ticker.js.map
11
+ defaultTicker.setFPS(60);
@@ -1,4 +1,4 @@
1
1
  export const CanvasFactory = Symbol.for("CanvasFactory");
2
2
 
3
3
  export const Context2dFactory = Symbol.for("Context2dFactory");
4
- //# sourceMappingURL=constants.js.map
4
+ //# sourceMappingURL=constants.js.map
@@ -213,4 +213,4 @@ let EmptyContext2d = class {
213
213
  EmptyContext2d = __decorate([ injectable(), __metadata("design:paramtypes", [ Object, Number ]) ], EmptyContext2d);
214
214
 
215
215
  export { EmptyContext2d };
216
- //# sourceMappingURL=empty-context.js.map
216
+ //# sourceMappingURL=empty-context.js.map
@@ -3,4 +3,4 @@ export * from "./constants";
3
3
  export * from "./empty-context";
4
4
 
5
5
  export * from "./contributions/browser";
6
- //# sourceMappingURL=index.js.map
6
+ //# sourceMappingURL=index.js.map
package/es/canvas/util.js CHANGED
@@ -382,4 +382,4 @@ export function contain(commands, x, y) {
382
382
  export function containStroke(commands, lineWidth, x, y) {
383
383
  return containPath(commands, lineWidth, !0, x, y);
384
384
  }
385
- //# sourceMappingURL=util.js.map
385
+ //# sourceMappingURL=util.js.map
@@ -334,5 +334,4 @@ function scale(current, sX, sY) {
334
334
  temp[3] = current[3], temp[4] = current[4], temp[5] = current[5], temp[6] = sX * current[6],
335
335
  temp[7] = sY * current[7]; else if ("h" === c || "H" === c) temp[1] = sX * current[1]; else if ("v" === c || "V" === c) temp[1] = sY * current[1]; else for (let i = 1, n = current.length; i < n; ++i) temp[i] = (i % 2 == 1 ? sX : sY) * current[i];
336
336
  return temp;
337
- }
338
- //# sourceMappingURL=custom-path2d.js.map
337
+ }
@@ -283,4 +283,5 @@ export function bezierCurversToPath(bezierCurves) {
283
283
  }
284
284
  }
285
285
  return path;
286
- }
286
+ }
287
+ //# sourceMappingURL=morphing-utils.js.map
@@ -1,2 +1 @@
1
- export const ApplicationContribution = Symbol("ApplicationContribution");
2
- //# sourceMappingURL=application.js.map
1
+ export const ApplicationContribution = Symbol("ApplicationContribution");
@@ -1,3 +1 @@
1
-
2
-
3
1
  //# sourceMappingURL=global-module.js.map
@@ -53,4 +53,4 @@ let DefaultLayerService = class {
53
53
  DefaultLayerService = __decorate([ injectable(), __param(0, inject(VGlobal)), __metadata("design:paramtypes", [ Object ]) ], DefaultLayerService);
54
54
 
55
55
  export { DefaultLayerService };
56
- //# sourceMappingURL=layer-service.js.map
56
+ //# sourceMappingURL=layer-service.js.map
package/es/core/layer.js CHANGED
@@ -126,4 +126,4 @@ export class Layer extends Group {
126
126
  }, params)), this.afterDrawCbs.forEach((c => c(this)));
127
127
  }
128
128
  }
129
- //# sourceMappingURL=layer.js.map
129
+ //# sourceMappingURL=layer.js.map
package/es/core/light.js CHANGED
@@ -19,4 +19,4 @@ export class DirectionalLight {
19
19
  return colorString.to.rgb(lightColorArray[0] * colorArray[0] * brightness, lightColorArray[1] * colorArray[1] * brightness, lightColorArray[2] * colorArray[2] * brightness);
20
20
  }
21
21
  }
22
- //# sourceMappingURL=light.js.map
22
+ //# sourceMappingURL=light.js.map
package/es/core/stage.js CHANGED
@@ -466,4 +466,4 @@ export class Stage extends Group {
466
466
  return this._cursor;
467
467
  }
468
468
  }
469
- //# sourceMappingURL=stage.js.map
469
+ //# sourceMappingURL=stage.js.map
@@ -1,5 +1,5 @@
1
- import { IAABBBounds } from '@visactor/vutils';
2
- import { IGraphicAttribute, IGraphic } from '../../interface';
1
+ import type { IAABBBounds } from '@visactor/vutils';
2
+ import type { IGraphicAttribute, IGraphic } from '../../interface';
3
3
  export declare class DefaultOuterBorderBoundsContribution {
4
4
  updateBounds(attribute: Partial<IGraphicAttribute>, theme: Required<IGraphicAttribute>, aabbBounds: IAABBBounds, graphic?: IGraphic): IAABBBounds;
5
5
  }
@@ -11,7 +11,7 @@ let DefaultOuterBorderBoundsContribution = class {
11
11
  const {outerBorder: outerBorder, shadowBlur: shadowBlur = theme.shadowBlur} = attribute;
12
12
  if (outerBorder) {
13
13
  const defaultOuterBorder = theme.outerBorder, {distance: distance = defaultOuterBorder.distance, lineWidth: lineWidth = defaultOuterBorder.lineWidth} = outerBorder;
14
- aabbBounds.expand(distance + shadowBlur + lineWidth / 2);
14
+ aabbBounds.expand(distance + (shadowBlur + lineWidth) / 2);
15
15
  }
16
16
  return aabbBounds;
17
17
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/graphic/graphic-service/common-contribution.ts"],"names":[],"mappings":";;;;;;AACA,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAIhC,IAAM,oCAAoC,GAA1C,MAAM,oCAAoC;IAC/C,YAAY,CACV,SAAqC,EACrC,KAAkC,EAClC,UAAuB,EACvB,OAAkB;QAElB,MAAM,EAAE,WAAW,EAAE,UAAU,GAAG,KAAK,CAAC,UAAU,EAAE,GAAG,SAAS,CAAC;QACjE,IAAI,WAAW,EAAE;YACf,MAAM,kBAAkB,GAAG,KAAK,CAAC,WAAW,CAAC;YAC7C,MAAM,EAAE,QAAQ,GAAG,kBAAkB,CAAC,QAAQ,EAAE,SAAS,GAAG,kBAAkB,CAAC,SAAS,EAAE,GAAG,WAAW,CAAC;YAGzG,UAAU,CAAC,MAAM,CAAE,QAAmB,GAAG,UAAU,GAAG,SAAS,GAAG,CAAC,CAAC,CAAC;SACtE;QACD,OAAO,UAAU,CAAC;IACpB,CAAC;CACF,CAAA;AAjBY,oCAAoC;IADhD,UAAU,EAAE;GACA,oCAAoC,CAiBhD;SAjBY,oCAAoC","file":"common-contribution.js","sourcesContent":["import { IAABBBounds } from '@visactor/vutils';\nimport { injectable } from 'inversify';\nimport { IGraphicAttribute, IGraphic } from '../../interface';\n\n@injectable()\nexport class DefaultOuterBorderBoundsContribution {\n updateBounds(\n attribute: Partial<IGraphicAttribute>,\n theme: Required<IGraphicAttribute>,\n aabbBounds: IAABBBounds,\n graphic?: IGraphic\n ): IAABBBounds {\n const { outerBorder, shadowBlur = theme.shadowBlur } = attribute;\n if (outerBorder) {\n const defaultOuterBorder = theme.outerBorder;\n const { distance = defaultOuterBorder.distance, lineWidth = defaultOuterBorder.lineWidth } = outerBorder;\n\n // rect的distance一定是number\n aabbBounds.expand((distance as number) + shadowBlur + lineWidth / 2);\n }\n return aabbBounds;\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/graphic/graphic-service/common-contribution.ts"],"names":[],"mappings":";;;;;;AACA,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAIhC,IAAM,oCAAoC,GAA1C,MAAM,oCAAoC;IAC/C,YAAY,CACV,SAAqC,EACrC,KAAkC,EAClC,UAAuB,EACvB,OAAkB;QAElB,MAAM,EAAE,WAAW,EAAE,UAAU,GAAG,KAAK,CAAC,UAAU,EAAE,GAAG,SAAS,CAAC;QACjE,IAAI,WAAW,EAAE;YACf,MAAM,kBAAkB,GAAG,KAAK,CAAC,WAAW,CAAC;YAC7C,MAAM,EAAE,QAAQ,GAAG,kBAAkB,CAAC,QAAQ,EAAE,SAAS,GAAG,kBAAkB,CAAC,SAAS,EAAE,GAAG,WAAW,CAAC;YAGzG,UAAU,CAAC,MAAM,CAAE,QAAmB,GAAG,CAAC,UAAU,GAAG,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;SACxE;QACD,OAAO,UAAU,CAAC;IACpB,CAAC;CACF,CAAA;AAjBY,oCAAoC;IADhD,UAAU,EAAE;GACA,oCAAoC,CAiBhD;SAjBY,oCAAoC","file":"common-contribution.js","sourcesContent":["import type { IAABBBounds } from '@visactor/vutils';\nimport { injectable } from 'inversify';\nimport type { IGraphicAttribute, IGraphic } from '../../interface';\n\n@injectable()\nexport class DefaultOuterBorderBoundsContribution {\n updateBounds(\n attribute: Partial<IGraphicAttribute>,\n theme: Required<IGraphicAttribute>,\n aabbBounds: IAABBBounds,\n graphic?: IGraphic\n ): IAABBBounds {\n const { outerBorder, shadowBlur = theme.shadowBlur } = attribute;\n if (outerBorder) {\n const defaultOuterBorder = theme.outerBorder;\n const { distance = defaultOuterBorder.distance, lineWidth = defaultOuterBorder.lineWidth } = outerBorder;\n\n // rect的distance一定是number\n aabbBounds.expand((distance as number) + (shadowBlur + lineWidth) / 2);\n }\n return aabbBounds;\n }\n}\n"]}
@@ -17,7 +17,7 @@ let DefaultSymbolOuterBorderBoundsContribution = class extends DefaultOuterBorde
17
17
  const {outerBorder: outerBorder, shadowBlur: shadowBlur = symbolTheme.shadowBlur, strokeBoundsBuffer: strokeBoundsBuffer = symbolTheme.strokeBoundsBuffer} = attribute;
18
18
  if (outerBorder) {
19
19
  const defaultOuterBorder = symbolTheme.outerBorder, {distance: distance = defaultOuterBorder.distance, lineWidth: lineWidth = defaultOuterBorder.lineWidth} = outerBorder;
20
- boundStroke(aabbBounds, distance + shadowBlur + lineWidth / 2, !0, strokeBoundsBuffer);
20
+ boundStroke(aabbBounds, distance + (shadowBlur + lineWidth) / 2, !0, strokeBoundsBuffer);
21
21
  }
22
22
  return aabbBounds;
23
23
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/graphic/graphic-service/symbol-contribution.ts"],"names":[],"mappings":";;;;;;AACA,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAEvC,OAAO,EAAE,oCAAoC,EAAE,MAAM,uBAAuB,CAAC;AAE7E,MAAM,CAAC,MAAM,wBAAwB,GAAG,MAAM,CAAC,GAAG,CAAC,0BAA0B,CAAC,CAAC;AAGxE,IAAM,0CAA0C,GAAhD,MAAM,0CACX,SAAQ,oCAAoC;IAG5C,YAAY,CACV,SAAkC,EAClC,WAA8C,EAC9C,UAAuB,EACvB,OAAkB;QAElB,MAAM,EACJ,WAAW,EACX,UAAU,GAAG,WAAW,CAAC,UAAU,EACnC,kBAAkB,GAAG,WAAW,CAAC,kBAAkB,EACpD,GAAG,SAAS,CAAC;QAEd,IAAI,WAAW,EAAE;YACf,MAAM,kBAAkB,GAAG,WAAW,CAAC,WAAW,CAAC;YACnD,MAAM,EAAE,QAAQ,GAAG,kBAAkB,CAAC,QAAQ,EAAE,SAAS,GAAG,kBAAkB,CAAC,SAAS,EAAE,GAAG,WAAW,CAAC;YAGzG,WAAW,CAAC,UAAU,EAAG,QAAmB,GAAG,UAAU,GAAG,SAAS,GAAG,CAAC,EAAE,IAAI,EAAE,kBAAkB,CAAC,CAAC;SACtG;QACD,OAAO,UAAU,CAAC;IACpB,CAAC;CACF,CAAA;AAzBY,0CAA0C;IADtD,UAAU,EAAE;GACA,0CAA0C,CAyBtD;SAzBY,0CAA0C","file":"symbol-contribution.js","sourcesContent":["import type { IAABBBounds } from '@visactor/vutils';\nimport { injectable } from 'inversify';\nimport { boundStroke } from '../tools';\nimport type { IGraphic, ISymbolBoundsContribution, ISymbolGraphicAttribute } from '../../interface';\nimport { DefaultOuterBorderBoundsContribution } from './common-contribution';\n\nexport const SymbolBoundsContribution = Symbol.for('SymbolBoundsContribution');\n\n@injectable()\nexport class DefaultSymbolOuterBorderBoundsContribution\n extends DefaultOuterBorderBoundsContribution\n implements ISymbolBoundsContribution\n{\n updateBounds(\n attribute: ISymbolGraphicAttribute,\n symbolTheme: Required<ISymbolGraphicAttribute>,\n aabbBounds: IAABBBounds,\n graphic?: IGraphic\n ): IAABBBounds {\n const {\n outerBorder,\n shadowBlur = symbolTheme.shadowBlur,\n strokeBoundsBuffer = symbolTheme.strokeBoundsBuffer\n } = attribute;\n\n if (outerBorder) {\n const defaultOuterBorder = symbolTheme.outerBorder;\n const { distance = defaultOuterBorder.distance, lineWidth = defaultOuterBorder.lineWidth } = outerBorder;\n\n // Symbol的distance一定是number\n boundStroke(aabbBounds, (distance as number) + shadowBlur + lineWidth / 2, true, strokeBoundsBuffer);\n }\n return aabbBounds;\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/graphic/graphic-service/symbol-contribution.ts"],"names":[],"mappings":";;;;;;AACA,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAEvC,OAAO,EAAE,oCAAoC,EAAE,MAAM,uBAAuB,CAAC;AAE7E,MAAM,CAAC,MAAM,wBAAwB,GAAG,MAAM,CAAC,GAAG,CAAC,0BAA0B,CAAC,CAAC;AAGxE,IAAM,0CAA0C,GAAhD,MAAM,0CACX,SAAQ,oCAAoC;IAG5C,YAAY,CACV,SAAkC,EAClC,WAA8C,EAC9C,UAAuB,EACvB,OAAkB;QAElB,MAAM,EACJ,WAAW,EACX,UAAU,GAAG,WAAW,CAAC,UAAU,EACnC,kBAAkB,GAAG,WAAW,CAAC,kBAAkB,EACpD,GAAG,SAAS,CAAC;QAEd,IAAI,WAAW,EAAE;YACf,MAAM,kBAAkB,GAAG,WAAW,CAAC,WAAW,CAAC;YACnD,MAAM,EAAE,QAAQ,GAAG,kBAAkB,CAAC,QAAQ,EAAE,SAAS,GAAG,kBAAkB,CAAC,SAAS,EAAE,GAAG,WAAW,CAAC;YAGzG,WAAW,CAAC,UAAU,EAAG,QAAmB,GAAG,CAAC,UAAU,GAAG,SAAS,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,kBAAkB,CAAC,CAAC;SACxG;QACD,OAAO,UAAU,CAAC;IACpB,CAAC;CACF,CAAA;AAzBY,0CAA0C;IADtD,UAAU,EAAE;GACA,0CAA0C,CAyBtD;SAzBY,0CAA0C","file":"symbol-contribution.js","sourcesContent":["import type { IAABBBounds } from '@visactor/vutils';\nimport { injectable } from 'inversify';\nimport { boundStroke } from '../tools';\nimport type { IGraphic, ISymbolBoundsContribution, ISymbolGraphicAttribute } from '../../interface';\nimport { DefaultOuterBorderBoundsContribution } from './common-contribution';\n\nexport const SymbolBoundsContribution = Symbol.for('SymbolBoundsContribution');\n\n@injectable()\nexport class DefaultSymbolOuterBorderBoundsContribution\n extends DefaultOuterBorderBoundsContribution\n implements ISymbolBoundsContribution\n{\n updateBounds(\n attribute: ISymbolGraphicAttribute,\n symbolTheme: Required<ISymbolGraphicAttribute>,\n aabbBounds: IAABBBounds,\n graphic?: IGraphic\n ): IAABBBounds {\n const {\n outerBorder,\n shadowBlur = symbolTheme.shadowBlur,\n strokeBoundsBuffer = symbolTheme.strokeBoundsBuffer\n } = attribute;\n\n if (outerBorder) {\n const defaultOuterBorder = symbolTheme.outerBorder;\n const { distance = defaultOuterBorder.distance, lineWidth = defaultOuterBorder.lineWidth } = outerBorder;\n\n // Symbol的distance一定是number\n boundStroke(aabbBounds, (distance as number) + (shadowBlur + lineWidth) / 2, true, strokeBoundsBuffer);\n }\n return aabbBounds;\n }\n}\n"]}
@@ -146,6 +146,9 @@ export declare abstract class Graphic<T extends Partial<IGraphicAttribute> = Par
146
146
  addUpdateLayoutTag(): void;
147
147
  protected clearUpdateLayoutTag(): void;
148
148
  protected needUpdateLayout(): boolean;
149
+ protected getAnchor(anchor: [string | number, string | number], params: {
150
+ b?: IAABBBounds;
151
+ }): [number, number];
149
152
  protected doUpdateLocalMatrix(): void;
150
153
  protected doUpdateGlobalMatrix(): void;
151
154
  setStage(stage?: IStage, layer?: ILayer): void;
@@ -20,7 +20,7 @@ import { ResourceLoader } from "../resource-loader/loader";
20
20
 
21
21
  import { AttributeUpdateType, IContainPointMode, UpdateTag } from "../common/enums";
22
22
 
23
- const tempMatrix = new Matrix;
23
+ const tempMatrix = new Matrix, tempBounds = new AABBBounds;
24
24
 
25
25
  export const PURE_STYLE_KEY = [ "stroke", "opacity", "strokeOpacity", "lineDash", "lineDashOffset", "lineCap", "lineJoin", "miterLimit", "fill", "fillOpacity" ];
26
26
 
@@ -344,9 +344,18 @@ export class Graphic extends Node {
344
344
  applyStateAttrs(attrs, stateNames, hasAnimation, isClear) {
345
345
  var _a, _b, _c, _d;
346
346
  if (hasAnimation) {
347
- const keys = Object.keys(attrs), animateAttrs = isClear ? keys.reduce(((res, key) => (res[key] = void 0 === attrs[key] ? this.getDefaultAttribute(key) : attrs[key],
348
- res)), {}) : attrs, animate = this.animate();
349
- animate.stateNames = stateNames, animate.to(animateAttrs, null !== (_b = null === (_a = this.stateAnimateConfig) || void 0 === _a ? void 0 : _a.duration) && void 0 !== _b ? _b : DefaultStateAnimateConfig.duration, null !== (_d = null === (_c = this.stateAnimateConfig) || void 0 === _c ? void 0 : _c.easing) && void 0 !== _d ? _d : DefaultStateAnimateConfig.easing);
347
+ const keys = Object.keys(attrs), noWorkAAttr = this.getNoWorkAnimateAttr(), animateAttrs = {};
348
+ let noAnimateAttrs;
349
+ isClear ? keys.forEach((key => {
350
+ noWorkAAttr[key] ? (noAnimateAttrs || (noAnimateAttrs = {}), noAnimateAttrs[key] = attrs[key]) : animateAttrs[key] = void 0 === attrs[key] ? this.getDefaultAttribute(key) : attrs[key];
351
+ })) : keys.forEach((key => {
352
+ noWorkAAttr[key] ? (noAnimateAttrs || (noAnimateAttrs = {}), noAnimateAttrs[key] = attrs[key]) : animateAttrs[key] = attrs[key];
353
+ }));
354
+ const animate = this.animate();
355
+ animate.stateNames = stateNames, animate.to(animateAttrs, null !== (_b = null === (_a = this.stateAnimateConfig) || void 0 === _a ? void 0 : _a.duration) && void 0 !== _b ? _b : DefaultStateAnimateConfig.duration, null !== (_d = null === (_c = this.stateAnimateConfig) || void 0 === _c ? void 0 : _c.easing) && void 0 !== _d ? _d : DefaultStateAnimateConfig.easing),
356
+ noAnimateAttrs && this.setAttributes(noAnimateAttrs, !1, {
357
+ type: AttributeUpdateType.STATE
358
+ });
350
359
  } else this.setAttributes(attrs, !1, {
351
360
  type: AttributeUpdateType.STATE
352
361
  });
@@ -443,24 +452,40 @@ export class Graphic extends Node {
443
452
  needUpdateLayout() {
444
453
  return !!(this._updateTag & UpdateTag.UPDATE_LAYOUT);
445
454
  }
455
+ getAnchor(anchor, params) {
456
+ const _anchor = [ 0, 0 ], getBounds = () => {
457
+ if (params.b) return params.b;
458
+ const {scaleX: scaleX, scaleY: scaleY, angle: angle} = this.attribute;
459
+ return tempBounds.copy(this._AABBBounds), this.setAttributes({
460
+ scaleX: 1,
461
+ scaleY: 1,
462
+ angle: 0
463
+ }), params.b = this.AABBBounds.clone(), this._AABBBounds.copy(tempBounds), this.setAttributes({
464
+ scaleX: scaleX,
465
+ scaleY: scaleY,
466
+ angle: angle
467
+ }), params.b;
468
+ };
469
+ if ("string" == typeof anchor[0]) {
470
+ const ratio = parseFloat(anchor[0]) / 100, bounds = getBounds();
471
+ _anchor[0] = bounds.x1 + (bounds.x2 - bounds.x1) * ratio;
472
+ } else _anchor[0] = anchor[0];
473
+ if ("string" == typeof anchor[1]) {
474
+ const ratio = parseFloat(anchor[1]) / 100, bounds = getBounds();
475
+ _anchor[1] = bounds.y1 + (bounds.y2 - bounds.y1) * ratio;
476
+ } else _anchor[1] = anchor[1];
477
+ return _anchor;
478
+ }
446
479
  doUpdateLocalMatrix() {
447
- const {x: x = DefaultTransform.x, y: y = DefaultTransform.y, scaleX: scaleX = DefaultTransform.scaleX, scaleY: scaleY = DefaultTransform.scaleY, angle: angle = DefaultTransform.angle, scaleCenter: scaleCenter, anchor: anchor, postMatrix: postMatrix} = this.attribute, _anchor = [ 0, 0 ];
448
- if (anchor) {
449
- if ("string" == typeof anchor[0]) {
450
- const ratio = parseFloat(anchor[0]) / 100, bounds = this.AABBBounds;
451
- _anchor[0] = bounds.x1 + (bounds.x2 - bounds.x1) * ratio;
452
- } else _anchor[0] = anchor[0];
453
- if ("string" == typeof anchor[1]) {
454
- const ratio = parseFloat(anchor[1]) / 100, bounds = this.AABBBounds;
455
- _anchor[1] = bounds.x1 + (bounds.x2 - bounds.x1) * ratio;
456
- } else _anchor[1] = anchor[1];
457
- }
458
- if (!scaleCenter || 1 === scaleX && 1 === scaleY) normalTransform(this._transMatrix, this._transMatrix.reset(), x, y, scaleX, scaleY, angle, anchor && _anchor); else {
480
+ const {x: x = DefaultTransform.x, y: y = DefaultTransform.y, scaleX: scaleX = DefaultTransform.scaleX, scaleY: scaleY = DefaultTransform.scaleY, angle: angle = DefaultTransform.angle, scaleCenter: scaleCenter, anchor: anchor, postMatrix: postMatrix} = this.attribute;
481
+ let _anchor = [ 0, 0 ];
482
+ const params = {};
483
+ if (anchor && (_anchor = this.getAnchor(anchor, params)), !scaleCenter || 1 === scaleX && 1 === scaleY) normalTransform(this._transMatrix, this._transMatrix.reset(), x, y, scaleX, scaleY, angle, anchor && _anchor); else {
459
484
  const m = this._transMatrix;
460
485
  m.reset(), m.translate(_anchor[0], _anchor[1]), m.rotate(angle), m.translate(-_anchor[0], -_anchor[1]),
461
- m.translate(x, y), application.transformUtil.fromMatrix(m, m).scale(scaleX, scaleY, {
462
- x: scaleCenter[0],
463
- y: scaleCenter[1]
486
+ m.translate(x, y), _anchor = this.getAnchor(scaleCenter, params), application.transformUtil.fromMatrix(m, m).scale(scaleX, scaleY, {
487
+ x: _anchor[0],
488
+ y: _anchor[1]
464
489
  });
465
490
  }
466
491
  const p = this.getOffsetXY(DefaultTransform);