@visactor/vrender 0.15.3 → 0.15.5-alpha.0

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
@@ -42,4 +42,5 @@ class DefaultCanvasAllocate {
42
42
  }
43
43
  }
44
44
 
45
- exports.DefaultCanvasAllocate = DefaultCanvasAllocate, exports.canvasAllocate = new DefaultCanvasAllocate;
45
+ exports.DefaultCanvasAllocate = DefaultCanvasAllocate, exports.canvasAllocate = new DefaultCanvasAllocate;
46
+ //# sourceMappingURL=canvas-allocate.js.map
@@ -10,5 +10,4 @@ exports.defaultTicker = new default_ticker_1.DefaultTicker, exports.defaultTicke
10
10
 
11
11
  const TICKER_FPS = 60;
12
12
 
13
- exports.defaultTicker.setFPS(60);
14
- //# sourceMappingURL=default-ticker.js.map
13
+ exports.defaultTicker.setFPS(60);
@@ -4,4 +4,4 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: !0
5
5
  }), exports.Context2dFactory = exports.CanvasFactory = void 0, exports.CanvasFactory = Symbol.for("CanvasFactory"),
6
6
  exports.Context2dFactory = Symbol.for("Context2dFactory");
7
- //# sourceMappingURL=constants.js.map
7
+ //# sourceMappingURL=constants.js.map
@@ -206,4 +206,4 @@ let EmptyContext2d = class {
206
206
 
207
207
  EmptyContext2d = __decorate([ (0, inversify_1.injectable)(), __metadata("design:paramtypes", [ Object, Number ]) ], EmptyContext2d),
208
208
  exports.EmptyContext2d = EmptyContext2d;
209
- //# sourceMappingURL=empty-context.js.map
209
+ //# sourceMappingURL=empty-context.js.map
@@ -19,4 +19,4 @@ Object.defineProperty(exports, "__esModule", {
19
19
  value: !0
20
20
  }), __exportStar(require("./constants"), exports), __exportStar(require("./empty-context"), exports),
21
21
  __exportStar(require("./contributions/browser"), exports);
22
- //# sourceMappingURL=index.js.map
22
+ //# sourceMappingURL=index.js.map
@@ -396,4 +396,4 @@ function containStroke(commands, lineWidth, x, y) {
396
396
  }
397
397
 
398
398
  exports.contain = contain, exports.containStroke = containStroke;
399
- //# sourceMappingURL=util.js.map
399
+ //# sourceMappingURL=util.js.map
@@ -329,5 +329,4 @@ function scale(current, sX, sY) {
329
329
  temp[3] = current[3], temp[4] = current[4], temp[5] = current[5], temp[6] = sX * current[6],
330
330
  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];
331
331
  return temp;
332
- }
333
- //# sourceMappingURL=custom-path2d.js.map
332
+ }
@@ -291,4 +291,5 @@ function bezierCurversToPath(bezierCurves) {
291
291
  }
292
292
 
293
293
  exports.pathToBezierCurves = pathToBezierCurves, exports.applyTransformOnBezierCurves = applyTransformOnBezierCurves,
294
- exports.bezierCurversToPath = bezierCurversToPath;
294
+ exports.bezierCurversToPath = bezierCurversToPath;
295
+ //# sourceMappingURL=morphing-utils.js.map
@@ -2,5 +2,4 @@
2
2
 
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: !0
5
- }), exports.ApplicationContribution = void 0, exports.ApplicationContribution = Symbol("ApplicationContribution");
6
- //# sourceMappingURL=application.js.map
5
+ }), exports.ApplicationContribution = void 0, exports.ApplicationContribution = Symbol("ApplicationContribution");
@@ -1,3 +1 @@
1
-
2
-
3
1
  //# sourceMappingURL=global-module.js.map
@@ -55,4 +55,4 @@ let DefaultLayerService = class {
55
55
  DefaultLayerService = __decorate([ (0, inversify_1.injectable)(), __param(0, (0,
56
56
  inversify_1.inject)(constants_1.VGlobal)), __metadata("design:paramtypes", [ Object ]) ], DefaultLayerService),
57
57
  exports.DefaultLayerService = DefaultLayerService;
58
- //# sourceMappingURL=layer-service.js.map
58
+ //# sourceMappingURL=layer-service.js.map
package/cjs/core/layer.js CHANGED
@@ -129,4 +129,4 @@ class Layer extends group_1.Group {
129
129
  }
130
130
 
131
131
  exports.Layer = Layer;
132
- //# sourceMappingURL=layer.js.map
132
+ //# sourceMappingURL=layer.js.map
package/cjs/core/light.js CHANGED
@@ -25,4 +25,4 @@ class DirectionalLight {
25
25
  }
26
26
 
27
27
  exports.DirectionalLight = DirectionalLight;
28
- //# sourceMappingURL=light.js.map
28
+ //# sourceMappingURL=light.js.map
package/cjs/core/stage.js CHANGED
@@ -432,4 +432,4 @@ class Stage extends graphic_1.Group {
432
432
  }
433
433
 
434
434
  exports.Stage = Stage;
435
- //# sourceMappingURL=stage.js.map
435
+ //# 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
  }
@@ -17,7 +17,7 @@ let DefaultOuterBorderBoundsContribution = class {
17
17
  const {outerBorder: outerBorder, shadowBlur: shadowBlur = theme.shadowBlur} = attribute;
18
18
  if (outerBorder) {
19
19
  const defaultOuterBorder = theme.outerBorder, {distance: distance = defaultOuterBorder.distance, lineWidth: lineWidth = defaultOuterBorder.lineWidth} = outerBorder;
20
- aabbBounds.expand(distance + shadowBlur + lineWidth / 2);
20
+ aabbBounds.expand(distance + (shadowBlur + lineWidth) / 2);
21
21
  }
22
22
  return aabbBounds;
23
23
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/graphic/graphic-service/common-contribution.ts"],"names":[],"mappings":";;;;;;;;;AACA,yCAAuC;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,IAAA,sBAAU,GAAE;GACA,oCAAoC,CAiBhD;AAjBY,oFAAoC","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,yCAAuC;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,IAAA,sBAAU,GAAE;GACA,oCAAoC,CAiBhD;AAjBY,oFAAoC","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"]}
@@ -19,7 +19,7 @@ let DefaultSymbolOuterBorderBoundsContribution = class extends common_contributi
19
19
  const {outerBorder: outerBorder, shadowBlur: shadowBlur = symbolTheme.shadowBlur, strokeBoundsBuffer: strokeBoundsBuffer = symbolTheme.strokeBoundsBuffer} = attribute;
20
20
  if (outerBorder) {
21
21
  const defaultOuterBorder = symbolTheme.outerBorder, {distance: distance = defaultOuterBorder.distance, lineWidth: lineWidth = defaultOuterBorder.lineWidth} = outerBorder;
22
- (0, tools_1.boundStroke)(aabbBounds, distance + shadowBlur + lineWidth / 2, !0, strokeBoundsBuffer);
22
+ (0, tools_1.boundStroke)(aabbBounds, distance + (shadowBlur + lineWidth) / 2, !0, strokeBoundsBuffer);
23
23
  }
24
24
  return aabbBounds;
25
25
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/graphic/graphic-service/symbol-contribution.ts"],"names":[],"mappings":";;;;;;;;;AACA,yCAAuC;AACvC,oCAAuC;AAEvC,+DAA6E;AAEhE,QAAA,wBAAwB,GAAG,MAAM,CAAC,GAAG,CAAC,0BAA0B,CAAC,CAAC;AAGxE,IAAM,0CAA0C,GAAhD,MAAM,0CACX,SAAQ,0DAAoC;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,IAAA,mBAAW,EAAC,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,IAAA,sBAAU,GAAE;GACA,0CAA0C,CAyBtD;AAzBY,gGAA0C","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,yCAAuC;AACvC,oCAAuC;AAEvC,+DAA6E;AAEhE,QAAA,wBAAwB,GAAG,MAAM,CAAC,GAAG,CAAC,0BAA0B,CAAC,CAAC;AAGxE,IAAM,0CAA0C,GAAhD,MAAM,0CACX,SAAQ,0DAAoC;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,IAAA,mBAAW,EAAC,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,IAAA,sBAAU,GAAE;GACA,0CAA0C,CAyBtD;AAzBY,gGAA0C","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;
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: !0
5
5
  }), exports.Graphic = exports.NOWORK_ANIMATE_ATTR = exports.GRAPHIC_UPDATE_TAG_KEY = exports.PURE_STYLE_KEY = void 0;
6
6
 
7
- const vutils_1 = require("@visactor/vutils"), node_tree_1 = require("./node-tree"), event_1 = require("../event"), config_1 = require("./config"), application_1 = require("../application"), animate_1 = require("../animate"), interpolate_1 = require("../color-string/interpolate"), custom_path2d_1 = require("../common/custom-path2d"), theme_1 = require("./theme"), loader_1 = require("../resource-loader/loader"), enums_1 = require("../common/enums"), tempMatrix = new vutils_1.Matrix;
7
+ const vutils_1 = require("@visactor/vutils"), node_tree_1 = require("./node-tree"), event_1 = require("../event"), config_1 = require("./config"), application_1 = require("../application"), animate_1 = require("../animate"), interpolate_1 = require("../color-string/interpolate"), custom_path2d_1 = require("../common/custom-path2d"), theme_1 = require("./theme"), loader_1 = require("../resource-loader/loader"), enums_1 = require("../common/enums"), tempMatrix = new vutils_1.Matrix, tempBounds = new vutils_1.AABBBounds;
8
8
 
9
9
  exports.PURE_STYLE_KEY = [ "stroke", "opacity", "strokeOpacity", "lineDash", "lineDashOffset", "lineCap", "lineJoin", "miterLimit", "fill", "fillOpacity" ],
10
10
  exports.GRAPHIC_UPDATE_TAG_KEY = [ "lineWidth", "lineCap", "lineJoin", "miterLimit", "scaleX", "scaleY", "angle", "anchor" ];
@@ -329,9 +329,18 @@ class Graphic extends node_tree_1.Node {
329
329
  applyStateAttrs(attrs, stateNames, hasAnimation, isClear) {
330
330
  var _a, _b, _c, _d;
331
331
  if (hasAnimation) {
332
- const keys = Object.keys(attrs), animateAttrs = isClear ? keys.reduce(((res, key) => (res[key] = void 0 === attrs[key] ? this.getDefaultAttribute(key) : attrs[key],
333
- res)), {}) : attrs, animate = this.animate();
334
- animate.stateNames = stateNames, animate.to(animateAttrs, null !== (_b = null === (_a = this.stateAnimateConfig) || void 0 === _a ? void 0 : _a.duration) && void 0 !== _b ? _b : animate_1.DefaultStateAnimateConfig.duration, null !== (_d = null === (_c = this.stateAnimateConfig) || void 0 === _c ? void 0 : _c.easing) && void 0 !== _d ? _d : animate_1.DefaultStateAnimateConfig.easing);
332
+ const keys = Object.keys(attrs), noWorkAAttr = this.getNoWorkAnimateAttr(), animateAttrs = {};
333
+ let noAnimateAttrs;
334
+ isClear ? keys.forEach((key => {
335
+ noWorkAAttr[key] ? (noAnimateAttrs || (noAnimateAttrs = {}), noAnimateAttrs[key] = attrs[key]) : animateAttrs[key] = void 0 === attrs[key] ? this.getDefaultAttribute(key) : attrs[key];
336
+ })) : keys.forEach((key => {
337
+ noWorkAAttr[key] ? (noAnimateAttrs || (noAnimateAttrs = {}), noAnimateAttrs[key] = attrs[key]) : animateAttrs[key] = attrs[key];
338
+ }));
339
+ const animate = this.animate();
340
+ animate.stateNames = stateNames, animate.to(animateAttrs, null !== (_b = null === (_a = this.stateAnimateConfig) || void 0 === _a ? void 0 : _a.duration) && void 0 !== _b ? _b : animate_1.DefaultStateAnimateConfig.duration, null !== (_d = null === (_c = this.stateAnimateConfig) || void 0 === _c ? void 0 : _c.easing) && void 0 !== _d ? _d : animate_1.DefaultStateAnimateConfig.easing),
341
+ noAnimateAttrs && this.setAttributes(noAnimateAttrs, !1, {
342
+ type: enums_1.AttributeUpdateType.STATE
343
+ });
335
344
  } else this.setAttributes(attrs, !1, {
336
345
  type: enums_1.AttributeUpdateType.STATE
337
346
  });
@@ -428,24 +437,41 @@ class Graphic extends node_tree_1.Node {
428
437
  needUpdateLayout() {
429
438
  return !!(this._updateTag & enums_1.UpdateTag.UPDATE_LAYOUT);
430
439
  }
440
+ getAnchor(anchor, params) {
441
+ const _anchor = [ 0, 0 ], getBounds = () => {
442
+ if (params.b) return params.b;
443
+ const {scaleX: scaleX, scaleY: scaleY, angle: angle} = this.attribute;
444
+ return tempBounds.copy(this._AABBBounds), this.setAttributes({
445
+ scaleX: 1,
446
+ scaleY: 1,
447
+ angle: 0
448
+ }), params.b = this.AABBBounds.clone(), this._AABBBounds.copy(tempBounds), this.setAttributes({
449
+ scaleX: scaleX,
450
+ scaleY: scaleY,
451
+ angle: angle
452
+ }), params.b;
453
+ };
454
+ if ("string" == typeof anchor[0]) {
455
+ const ratio = parseFloat(anchor[0]) / 100, bounds = getBounds();
456
+ _anchor[0] = bounds.x1 + (bounds.x2 - bounds.x1) * ratio;
457
+ } else _anchor[0] = anchor[0];
458
+ if ("string" == typeof anchor[1]) {
459
+ const ratio = parseFloat(anchor[1]) / 100, bounds = getBounds();
460
+ _anchor[1] = bounds.y1 + (bounds.y2 - bounds.y1) * ratio;
461
+ } else _anchor[1] = anchor[1];
462
+ return _anchor;
463
+ }
431
464
  doUpdateLocalMatrix() {
432
- const {x: x = config_1.DefaultTransform.x, y: y = config_1.DefaultTransform.y, scaleX: scaleX = config_1.DefaultTransform.scaleX, scaleY: scaleY = config_1.DefaultTransform.scaleY, angle: angle = config_1.DefaultTransform.angle, scaleCenter: scaleCenter, anchor: anchor, postMatrix: postMatrix} = this.attribute, _anchor = [ 0, 0 ];
433
- if (anchor) {
434
- if ("string" == typeof anchor[0]) {
435
- const ratio = parseFloat(anchor[0]) / 100, bounds = this.AABBBounds;
436
- _anchor[0] = bounds.x1 + (bounds.x2 - bounds.x1) * ratio;
437
- } else _anchor[0] = anchor[0];
438
- if ("string" == typeof anchor[1]) {
439
- const ratio = parseFloat(anchor[1]) / 100, bounds = this.AABBBounds;
440
- _anchor[1] = bounds.x1 + (bounds.x2 - bounds.x1) * ratio;
441
- } else _anchor[1] = anchor[1];
442
- }
443
- if (!scaleCenter || 1 === scaleX && 1 === scaleY) (0, vutils_1.normalTransform)(this._transMatrix, this._transMatrix.reset(), x, y, scaleX, scaleY, angle, anchor && _anchor); else {
465
+ const {x: x = config_1.DefaultTransform.x, y: y = config_1.DefaultTransform.y, scaleX: scaleX = config_1.DefaultTransform.scaleX, scaleY: scaleY = config_1.DefaultTransform.scaleY, angle: angle = config_1.DefaultTransform.angle, scaleCenter: scaleCenter, anchor: anchor, postMatrix: postMatrix} = this.attribute;
466
+ let _anchor = [ 0, 0 ];
467
+ const params = {};
468
+ if (anchor && (_anchor = this.getAnchor(anchor, params)), !scaleCenter || 1 === scaleX && 1 === scaleY) (0,
469
+ vutils_1.normalTransform)(this._transMatrix, this._transMatrix.reset(), x, y, scaleX, scaleY, angle, anchor && _anchor); else {
444
470
  const m = this._transMatrix;
445
471
  m.reset(), m.translate(_anchor[0], _anchor[1]), m.rotate(angle), m.translate(-_anchor[0], -_anchor[1]),
446
- m.translate(x, y), application_1.application.transformUtil.fromMatrix(m, m).scale(scaleX, scaleY, {
447
- x: scaleCenter[0],
448
- y: scaleCenter[1]
472
+ m.translate(x, y), _anchor = this.getAnchor(scaleCenter, params), application_1.application.transformUtil.fromMatrix(m, m).scale(scaleX, scaleY, {
473
+ x: _anchor[0],
474
+ y: _anchor[1]
449
475
  });
450
476
  }
451
477
  const p = this.getOffsetXY(config_1.DefaultTransform);