@visactor/vrender-core 0.16.15 → 0.16.16

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 (99) hide show
  1. package/cjs/common/Reflect-metadata.js +1 -1
  2. package/cjs/common/bezier-utils.js +1 -2
  3. package/cjs/common/bounds-context.js +1 -1
  4. package/cjs/common/canvas-utils.js +1 -1
  5. package/cjs/common/contribution-provider.js +1 -1
  6. package/cjs/common/custom-path2d.js +1 -1
  7. package/cjs/common/enums.js +1 -1
  8. package/cjs/common/generator.js +1 -1
  9. package/cjs/common/matrix.js +1 -1
  10. package/cjs/common/morphing-utils.js +1 -1
  11. package/cjs/common/path-svg.js +1 -1
  12. package/cjs/common/polygon.js +2 -2
  13. package/cjs/common/render-area.js +1 -1
  14. package/cjs/common/render-command-list.js +1 -1
  15. package/cjs/common/render-curve.js +2 -2
  16. package/cjs/common/seg-context.js +1 -1
  17. package/cjs/common/sort.js +1 -1
  18. package/cjs/common/split-path.js +1 -2
  19. package/cjs/common/store.js +1 -1
  20. package/cjs/common/text.js +1 -1
  21. package/cjs/common/utils.js +1 -1
  22. package/cjs/core/camera.js +2 -1
  23. package/cjs/core/global-module.js +2 -0
  24. package/cjs/core/global.js +1 -1
  25. package/cjs/core/graphic-utils.js +1 -1
  26. package/cjs/core/index.js +1 -1
  27. package/cjs/core/layer-service.js +1 -1
  28. package/cjs/core/layer.js +1 -1
  29. package/cjs/core/light.js +1 -1
  30. package/cjs/core/stage.js +1 -1
  31. package/cjs/core/window.js +1 -1
  32. package/cjs/event/constant.js +1 -1
  33. package/cjs/event/event-manager.js +1 -1
  34. package/cjs/event/event-system.js +1 -1
  35. package/cjs/event/event-target.js +1 -1
  36. package/cjs/event/index.js +2 -1
  37. package/cjs/event/util.js +1 -1
  38. package/cjs/graphic/builtin-symbol/index.js +0 -1
  39. package/cjs/graphic/builtin-symbol/index.js.map +1 -1
  40. package/cjs/graphic/builtin-symbol/rect.d.ts +2 -1
  41. package/cjs/graphic/builtin-symbol/rect.js +11 -6
  42. package/cjs/graphic/builtin-symbol/rect.js.map +1 -1
  43. package/cjs/interface/allocator.js +1 -1
  44. package/cjs/interface/animate.js +1 -1
  45. package/cjs/interface/camera.js +1 -1
  46. package/cjs/interface/canvas.js +1 -1
  47. package/cjs/interface/color.js +1 -1
  48. package/cjs/interface/common.js +1 -1
  49. package/dist/index.js +18 -11
  50. package/dist/index.min.js +1 -1
  51. package/es/common/Reflect-metadata.js +1 -1
  52. package/es/common/bezier-utils.js +1 -2
  53. package/es/common/bounds-context.js +1 -1
  54. package/es/common/canvas-utils.js +1 -1
  55. package/es/common/contribution-provider.js +1 -1
  56. package/es/common/custom-path2d.js +1 -1
  57. package/es/common/enums.js +1 -1
  58. package/es/common/generator.js +1 -1
  59. package/es/common/matrix.js +1 -1
  60. package/es/common/morphing-utils.js +1 -1
  61. package/es/common/path-svg.js +1 -1
  62. package/es/common/polygon.js +1 -1
  63. package/es/common/render-area.js +1 -1
  64. package/es/common/render-command-list.js +1 -1
  65. package/es/common/render-curve.js +1 -1
  66. package/es/common/seg-context.js +1 -1
  67. package/es/common/sort.js +1 -1
  68. package/es/common/split-path.js +1 -2
  69. package/es/common/store.js +1 -1
  70. package/es/common/text.js +1 -1
  71. package/es/common/utils.js +1 -1
  72. package/es/core/camera.js +2 -1
  73. package/es/core/global-module.js +2 -0
  74. package/es/core/global.js +1 -1
  75. package/es/core/graphic-utils.js +1 -1
  76. package/es/core/index.js +1 -1
  77. package/es/core/layer-service.js +1 -1
  78. package/es/core/layer.js +1 -1
  79. package/es/core/light.js +1 -1
  80. package/es/core/stage.js +1 -1
  81. package/es/core/window.js +1 -1
  82. package/es/event/constant.js +1 -1
  83. package/es/event/event-manager.js +1 -1
  84. package/es/event/event-system.js +1 -1
  85. package/es/event/event-target.js +1 -1
  86. package/es/event/index.js +2 -1
  87. package/es/event/util.js +1 -1
  88. package/es/graphic/builtin-symbol/index.js +0 -1
  89. package/es/graphic/builtin-symbol/index.js.map +1 -1
  90. package/es/graphic/builtin-symbol/rect.d.ts +2 -1
  91. package/es/graphic/builtin-symbol/rect.js +9 -4
  92. package/es/graphic/builtin-symbol/rect.js.map +1 -1
  93. package/es/interface/allocator.js +1 -1
  94. package/es/interface/animate.js +1 -1
  95. package/es/interface/camera.js +1 -1
  96. package/es/interface/canvas.js +1 -1
  97. package/es/interface/color.js +1 -1
  98. package/es/interface/common.js +1 -1
  99. package/package.json +4 -4
@@ -389,4 +389,4 @@ Object.defineProperty(exports, "__esModule", {
389
389
  }(exporter);
390
390
  }(), Reflect;
391
391
  }(Reflect || (Reflect = {}));
392
- //# sourceMappingURL=Reflect-metadata.js.map
392
+ //# sourceMappingURL=Reflect-metadata.js.map
@@ -31,5 +31,4 @@ function cubicPointAt(p0, p1, p2, p3, t) {
31
31
  }
32
32
 
33
33
  exports.snapLength = snapLength, exports.cubicLength = cubicLength, exports.cubicCalc = cubicCalc,
34
- exports.cubicPointAt = cubicPointAt;
35
- //# sourceMappingURL=bezier-utils.js.map
34
+ exports.cubicPointAt = cubicPointAt;
@@ -57,4 +57,4 @@ class BoundsContext {
57
57
  }
58
58
 
59
59
  exports.BoundsContext = BoundsContext;
60
- //# sourceMappingURL=bounds-context.js.map
60
+ //# sourceMappingURL=bounds-context.js.map
@@ -69,5 +69,5 @@ function createConicGradient(context, color, params, offsetX = 0, offsetY = 0) {
69
69
  })), canvasGradient.GetPattern(w + x, h + y, undefined);
70
70
  }
71
71
 
72
- exports.getScaledStroke = getScaledStroke, exports.createColor = createColor;
73
72
  //# sourceMappingURL=canvas-utils.js.map
73
+ exports.getScaledStroke = getScaledStroke, exports.createColor = createColor;
@@ -24,4 +24,4 @@ function bindContributionProviderNoSingletonScope(bind, id) {
24
24
  }
25
25
 
26
26
  exports.bindContributionProvider = bindContributionProvider, exports.bindContributionProviderNoSingletonScope = bindContributionProviderNoSingletonScope;
27
- //# sourceMappingURL=contribution-provider.js.map
27
+ //# sourceMappingURL=contribution-provider.js.map
@@ -330,4 +330,4 @@ function scale(current, sX, sY) {
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
332
  }
333
- //# sourceMappingURL=custom-path2d.js.map
333
+ //# sourceMappingURL=custom-path2d.js.map
@@ -46,4 +46,4 @@ function(Direction) {
46
46
  BaseRenderContributionTime[BaseRenderContributionTime.beforeFillStroke = 0] = "beforeFillStroke",
47
47
  BaseRenderContributionTime[BaseRenderContributionTime.afterFillStroke = 1] = "afterFillStroke";
48
48
  }(BaseRenderContributionTime = exports.BaseRenderContributionTime || (exports.BaseRenderContributionTime = {}));
49
- //# sourceMappingURL=enums.js.map
49
+ //# sourceMappingURL=enums.js.map
@@ -11,4 +11,4 @@ class Generator {
11
11
  }
12
12
 
13
13
  exports.Generator = Generator, Generator.auto_increment_id = 0;
14
- //# sourceMappingURL=generator.js.map
14
+ //# sourceMappingURL=generator.js.map
@@ -51,4 +51,4 @@ function transformMat4(out, a, m) {
51
51
  }
52
52
 
53
53
  exports.lookAt = lookAt, exports.ortho = ortho, exports.multiply = multiply, exports.transformMat4 = transformMat4;
54
- //# sourceMappingURL=matrix.js.map
54
+ //# sourceMappingURL=matrix.js.map
@@ -292,4 +292,4 @@ function bezierCurversToPath(bezierCurves) {
292
292
 
293
293
  exports.pathToBezierCurves = pathToBezierCurves, exports.applyTransformOnBezierCurves = applyTransformOnBezierCurves,
294
294
  exports.bezierCurversToPath = bezierCurversToPath;
295
- //# sourceMappingURL=morphing-utils.js.map
295
+ //# sourceMappingURL=morphing-utils.js.map
@@ -61,4 +61,4 @@ exports.enumCommandMap = {
61
61
  Q: 7,
62
62
  R: 8
63
63
  }, exports.parseSvgPath = parseSvgPath;
64
- //# sourceMappingURL=path-svg.js.map
64
+ //# sourceMappingURL=path-svg.js.map
@@ -39,8 +39,8 @@ function getProportionPoint(point, segment, length, dx, dy) {
39
39
  };
40
40
  }
41
41
 
42
+ //# sourceMappingURL=polygon.js.map
42
43
  Object.defineProperty(exports, "__esModule", {
43
44
  value: !0
44
45
  }), exports.drawRoundedPolygon = exports.drawPolygon = void 0, exports.drawPolygon = drawPolygon,
45
- exports.drawRoundedPolygon = drawRoundedPolygon;
46
- //# sourceMappingURL=polygon.js.map
46
+ exports.drawRoundedPolygon = drawRoundedPolygon;
@@ -132,5 +132,5 @@ function drawSegItem(ctx, curve, endPercent, params) {
132
132
  }
133
133
  }
134
134
 
135
- exports.drawAreaSegments = drawAreaSegments;
136
135
  //# sourceMappingURL=render-area.js.map
136
+ exports.drawAreaSegments = drawAreaSegments;
@@ -14,4 +14,4 @@ function renderCommandList(commandList, context, x = 0, y = 0, sx = 1, sy = 1, z
14
14
  }
15
15
 
16
16
  exports.renderCommandList = renderCommandList;
17
- //# sourceMappingURL=render-command-list.js.map
17
+ //# sourceMappingURL=render-command-list.js.map
@@ -118,6 +118,6 @@ function drawSegItem(ctx, curve, endPercent, params) {
118
118
  }
119
119
  }
120
120
 
121
- exports.drawSegments = drawSegments, exports.drawIncrementalSegments = drawIncrementalSegments,
122
- exports.drawIncrementalAreaSegments = drawIncrementalAreaSegments;
123
121
  //# sourceMappingURL=render-curve.js.map
122
+ exports.drawSegments = drawSegments, exports.drawIncrementalSegments = drawIncrementalSegments,
123
+ exports.drawIncrementalAreaSegments = drawIncrementalAreaSegments;
@@ -95,4 +95,4 @@ class ReflectSegContext extends SegContext {
95
95
  }
96
96
 
97
97
  exports.ReflectSegContext = ReflectSegContext;
98
- //# sourceMappingURL=seg-context.js.map
98
+ //# sourceMappingURL=seg-context.js.map
@@ -98,4 +98,4 @@ Object.defineProperty(exports, "__esModule", {
98
98
  value: !0
99
99
  }), exports.findNextGraphic = exports.foreachAsync = exports.foreach = void 0, exports.foreach = foreach,
100
100
  exports.foreachAsync = foreachAsync, exports.findNextGraphic = findNextGraphic;
101
- //# sourceMappingURL=sort.js.map
101
+ //# sourceMappingURL=sort.js.map
@@ -268,5 +268,4 @@ const splitPath = (path, count) => {
268
268
  return res;
269
269
  };
270
270
 
271
- exports.splitPath = splitPath;
272
- //# sourceMappingURL=split-path.js.map
271
+ exports.splitPath = splitPath;
@@ -1,2 +1,2 @@
1
1
  class StageStore {}
2
- //# sourceMappingURL=store.js.map
2
+ //# sourceMappingURL=store.js.map
@@ -24,4 +24,4 @@ Object.defineProperty(exports, "__esModule", {
24
24
  }), exports.textLayoutOffsetY = exports.textDrawOffsetX = exports.textDrawOffsetY = exports.getContextFont = void 0,
25
25
  exports.getContextFont = getContextFont, exports.textDrawOffsetY = textDrawOffsetY,
26
26
  exports.textDrawOffsetX = textDrawOffsetX, exports.textLayoutOffsetY = textLayoutOffsetY;
27
- //# sourceMappingURL=text.js.map
27
+ //# sourceMappingURL=text.js.map
@@ -160,4 +160,4 @@ const calculateLineHeight = (lineHeight, fontSize) => {
160
160
  };
161
161
 
162
162
  exports.calculateLineHeight = calculateLineHeight;
163
- //# sourceMappingURL=utils.js.map
163
+ //# sourceMappingURL=utils.js.map
@@ -64,4 +64,5 @@ class OrthoCamera {
64
64
  }
65
65
  }
66
66
 
67
- exports.OrthoCamera = OrthoCamera;
67
+ exports.OrthoCamera = OrthoCamera;
68
+ //# sourceMappingURL=camera.js.map
@@ -1 +1,3 @@
1
+
2
+
1
3
  //# sourceMappingURL=global-module.js.map
@@ -173,4 +173,4 @@ DefaultGlobal = __decorate([ (0, inversify_lite_1.injectable)(), __param(0, (0,
173
173
  inversify_lite_1.inject)(contribution_provider_1.ContributionProvider)), __param(0, (0,
174
174
  inversify_lite_1.named)(constants_1.EnvContribution)), __metadata("design:paramtypes", [ Object ]) ], DefaultGlobal),
175
175
  exports.DefaultGlobal = DefaultGlobal;
176
- //# sourceMappingURL=global.js.map
176
+ //# sourceMappingURL=global.js.map
@@ -136,4 +136,4 @@ let DefaultTransformUtil = class {
136
136
 
137
137
  DefaultTransformUtil = __decorate([ (0, inversify_lite_1.injectable)(), __metadata("design:paramtypes", []) ], DefaultTransformUtil),
138
138
  exports.DefaultTransformUtil = DefaultTransformUtil;
139
- //# sourceMappingURL=graphic-utils.js.map
139
+ //# sourceMappingURL=graphic-utils.js.map
package/cjs/core/index.js CHANGED
@@ -22,4 +22,4 @@ __exportStar(require("./layer"), exports), __exportStar(require("./stage"), expo
22
22
  __exportStar(require("./graphic-utils"), exports), __exportStar(require("./contributions"), exports),
23
23
  __exportStar(require("./layer-service"), exports), __exportStar(require("./constants"), exports),
24
24
  __exportStar(require("../interface/core"), exports);
25
- //# sourceMappingURL=index.js.map
25
+ //# sourceMappingURL=index.js.map
@@ -77,4 +77,4 @@ let DefaultLayerService = class {
77
77
  DefaultLayerService = __decorate([ (0, inversify_lite_1.injectable)(), __param(0, (0,
78
78
  inversify_lite_1.inject)(constants_1.VGlobal)), __metadata("design:paramtypes", [ Object ]) ], DefaultLayerService),
79
79
  exports.DefaultLayerService = DefaultLayerService;
80
- //# sourceMappingURL=layer-service.js.map
80
+ //# sourceMappingURL=layer-service.js.map
package/cjs/core/layer.js CHANGED
@@ -134,4 +134,4 @@ class Layer extends group_1.Group {
134
134
  }
135
135
 
136
136
  exports.Layer = Layer;
137
- //# sourceMappingURL=layer.js.map
137
+ //# sourceMappingURL=layer.js.map
package/cjs/core/light.js CHANGED
@@ -23,4 +23,4 @@ class DirectionalLight {
23
23
  }
24
24
 
25
25
  exports.DirectionalLight = DirectionalLight;
26
- //# sourceMappingURL=light.js.map
26
+ //# sourceMappingURL=light.js.map
package/cjs/core/stage.js CHANGED
@@ -442,4 +442,4 @@ class Stage extends graphic_1.Group {
442
442
  }
443
443
 
444
444
  exports.Stage = Stage;
445
- //# sourceMappingURL=stage.js.map
445
+ //# sourceMappingURL=stage.js.map
@@ -123,4 +123,4 @@ __decorate([ (0, inversify_lite_1.postConstruct)(), __metadata("design:type", Fu
123
123
  DefaultWindow = __decorate([ (0, inversify_lite_1.injectable)(), __param(0, (0,
124
124
  inversify_lite_1.inject)(constants_1.VGlobal)), __metadata("design:paramtypes", [ Object ]) ], DefaultWindow),
125
125
  exports.DefaultWindow = DefaultWindow;
126
- //# sourceMappingURL=window.js.map
126
+ //# sourceMappingURL=window.js.map
@@ -3,4 +3,4 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: !0
5
5
  }), exports.WILDCARD = void 0, exports.WILDCARD = "*";
6
- //# sourceMappingURL=constant.js.map
6
+ //# sourceMappingURL=constant.js.map
@@ -274,4 +274,4 @@ class EventManager {
274
274
  }
275
275
 
276
276
  exports.EventManager = EventManager;
277
- //# sourceMappingURL=event-manager.js.map
277
+ //# sourceMappingURL=event-manager.js.map
@@ -198,4 +198,4 @@ class EventSystem {
198
198
  }
199
199
 
200
200
  exports.EventSystem = EventSystem;
201
- //# sourceMappingURL=event-system.js.map
201
+ //# sourceMappingURL=event-system.js.map
@@ -19,4 +19,4 @@ exports.EventTarget = {
19
19
  return this.dispatchEvent(new federated_event_1.CustomEvent(eventName, object));
20
20
  }
21
21
  };
22
- //# sourceMappingURL=event-target.js.map
22
+ //# sourceMappingURL=event-target.js.map
@@ -20,4 +20,5 @@ Object.defineProperty(exports, "__esModule", {
20
20
  }), __exportStar(require("./federated-event"), exports), __exportStar(require("./event-manager"), exports),
21
21
  __exportStar(require("./event-target"), exports), __exportStar(require("./event-system"), exports),
22
22
  __exportStar(require("../interface/event"), exports), __exportStar(require("./util"), exports),
23
- __exportStar(require("./constant"), exports);
23
+ __exportStar(require("./constant"), exports);
24
+ //# sourceMappingURL=index.js.map
package/cjs/event/util.js CHANGED
@@ -3,4 +3,4 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: !0
5
5
  }), exports.clock = void 0, exports.clock = "object" == typeof performance && performance.now ? performance : Date;
6
- //# sourceMappingURL=util.js.map
6
+ //# sourceMappingURL=util.js.map
@@ -31,7 +31,6 @@ exports.builtinSymbolsMap = {}, exports.builtinSymbols.forEach((symbol => {
31
31
  })), exports.builtInSymbolStrMap = {
32
32
  arrowLeft: "M 0.25 -0.5 L -0.25 0 l 0.5 0.5",
33
33
  arrowRight: "M -0.25 -0.5 l 0.5 0.5 l -0.5 0.5",
34
- rect: "M -0.5,0.25 L 0.5,0.25 L 0.5,-0.25,L -0.5,-0.25 Z",
35
34
  rectRound: "M 0.3 -0.5 C 0.41 -0.5 0.5 -0.41 0.5 -0.3 C 0.5 -0.3 0.5 0.3 0.5 0.3 C 0.5 0.41 0.41 0.5 0.3 0.5 C 0.3 0.5 -0.3 0.5 -0.3 0.5 C -0.41 0.5 -0.5 0.41 -0.5 0.3 C -0.5 0.3 -0.5 -0.3 -0.5 -0.3 C -0.5 -0.41 -0.41 -0.5 -0.3 -0.5 C -0.3 -0.5 0.3 -0.5 0.3 -0.5 Z",
36
35
  roundLine: "M 1.2392 -0.258 L -1.3432 -0.258 C -1.4784 -0.258 -1.588 -0.1436 -1.588 -0.002 c 0 0.1416 0.1096 0.256 0.2448 0.256 l 2.5824 0 c 0.1352 0 0.2448 -0.1144 0.2448 -0.256 C 1.484 -0.1436 1.3744 -0.258 1.2392 -0.258 z"
37
36
  }, __exportStar(require("./utils"), exports);
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/graphic/builtin-symbol/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,sDAA8B;AAC9B,oDAA4B;AAC5B,wDAAgC;AAChC,sDAA8B;AAC9B,0DAAkC;AAClC,kDAA0B;AAC1B,oDAA4B;AAC5B,oDAA4B;AAC5B,sDAA8B;AAC9B,gDAAwB;AACxB,oEAA2C;AAC3C,sEAA6C;AAC7C,gEAAuC;AACvC,oEAA2C;AAC3C,oEAA2C;AAC3C,gEAAuC;AACvC,kEAAyC;AACzC,4DAAmC;AACnC,gEAAuC;AACvC,sDAA6B;AAC7B,sDAA6B;AAC7B,oDAA4B;AAC5B,kDAA0B;AAGb,QAAA,cAAc,GAAG;IAC5B,gBAAM;IACN,eAAK;IACL,iBAAO;IACP,gBAAM;IACN,uBAAY;IACZ,kBAAQ;IACR,cAAI;IACJ,eAAK;IACL,eAAK;IACL,gBAAM;IACN,aAAG;IACH,uBAAY;IACZ,wBAAa;IACb,qBAAU;IACV,uBAAY;IACZ,qBAAU;IACV,sBAAW;IACX,mBAAQ;IACR,qBAAU;IACV,cAAI;IACJ,gBAAK;IACL,gBAAK;IACL,eAAK;CACN,CAAC;AACW,QAAA,iBAAiB,GAAiC,EAAE,CAAC;AAElE,sBAAc,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;IAC9B,yBAAiB,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AAC1C,CAAC,CAAC,CAAC;AAEU,QAAA,mBAAmB,GAA2B;IACzD,SAAS,EAAE,iCAAiC;IAC5C,UAAU,EAAE,mCAAmC;IAC/C,IAAI,EAAE,mDAAmD;IACzD,SAAS,EAEP,8PAA8P;IAChQ,SAAS,EACP,sNAAsN;CACzN,CAAC;AAEF,0CAAwB","file":"index.js","sourcesContent":["import circle from './circle';\nimport cross from './cross';\nimport diamond from './diamond';\nimport square from './square';\nimport triangle from './triangle';\nimport star from './star';\nimport arrow from './arrow';\nimport wedge from './wedge';\nimport stroke from './stroke';\nimport wye from './wye';\nimport triangleLeft from './triangle-left';\nimport triangleRight from './triangle-right';\nimport triangleUp from './triangle-up';\nimport triangleDown from './triangle-down';\nimport thinTriangle from './thin-triangle';\nimport arrow2Left from './arrow2-left';\nimport arrow2Right from './arrow2-right';\nimport arrow2Up from './arrow2-up';\nimport arrow2Down from './arrow2-down';\nimport lineV from './line-v';\nimport lineH from './line-h';\nimport close from './close';\nimport rect from './rect';\nimport type { ISymbolClass } from '../../interface';\n\nexport const builtinSymbols = [\n circle,\n cross,\n diamond,\n square,\n thinTriangle,\n triangle,\n star,\n arrow,\n wedge,\n stroke,\n wye,\n triangleLeft,\n triangleRight,\n triangleUp,\n triangleDown,\n arrow2Left,\n arrow2Right,\n arrow2Up,\n arrow2Down,\n rect,\n lineV,\n lineH,\n close\n];\nexport const builtinSymbolsMap: Record<string, ISymbolClass> = {};\n\nbuiltinSymbols.forEach(symbol => {\n builtinSymbolsMap[symbol.type] = symbol;\n});\n\nexport const builtInSymbolStrMap: Record<string, string> = {\n arrowLeft: 'M 0.25 -0.5 L -0.25 0 l 0.5 0.5',\n arrowRight: 'M -0.25 -0.5 l 0.5 0.5 l -0.5 0.5',\n rect: 'M -0.5,0.25 L 0.5,0.25 L 0.5,-0.25,L -0.5,-0.25 Z',\n rectRound:\n // eslint-disable-next-line max-len\n 'M 0.3 -0.5 C 0.41 -0.5 0.5 -0.41 0.5 -0.3 C 0.5 -0.3 0.5 0.3 0.5 0.3 C 0.5 0.41 0.41 0.5 0.3 0.5 C 0.3 0.5 -0.3 0.5 -0.3 0.5 C -0.41 0.5 -0.5 0.41 -0.5 0.3 C -0.5 0.3 -0.5 -0.3 -0.5 -0.3 C -0.5 -0.41 -0.41 -0.5 -0.3 -0.5 C -0.3 -0.5 0.3 -0.5 0.3 -0.5 Z',\n roundLine:\n 'M 1.2392 -0.258 L -1.3432 -0.258 C -1.4784 -0.258 -1.588 -0.1436 -1.588 -0.002 c 0 0.1416 0.1096 0.256 0.2448 0.256 l 2.5824 0 c 0.1352 0 0.2448 -0.1144 0.2448 -0.256 C 1.484 -0.1436 1.3744 -0.258 1.2392 -0.258 z'\n};\n\nexport * from './utils';\n"]}
1
+ {"version":3,"sources":["../src/graphic/builtin-symbol/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,sDAA8B;AAC9B,oDAA4B;AAC5B,wDAAgC;AAChC,sDAA8B;AAC9B,0DAAkC;AAClC,kDAA0B;AAC1B,oDAA4B;AAC5B,oDAA4B;AAC5B,sDAA8B;AAC9B,gDAAwB;AACxB,oEAA2C;AAC3C,sEAA6C;AAC7C,gEAAuC;AACvC,oEAA2C;AAC3C,oEAA2C;AAC3C,gEAAuC;AACvC,kEAAyC;AACzC,4DAAmC;AACnC,gEAAuC;AACvC,sDAA6B;AAC7B,sDAA6B;AAC7B,oDAA4B;AAC5B,kDAA0B;AAGb,QAAA,cAAc,GAAG;IAC5B,gBAAM;IACN,eAAK;IACL,iBAAO;IACP,gBAAM;IACN,uBAAY;IACZ,kBAAQ;IACR,cAAI;IACJ,eAAK;IACL,eAAK;IACL,gBAAM;IACN,aAAG;IACH,uBAAY;IACZ,wBAAa;IACb,qBAAU;IACV,uBAAY;IACZ,qBAAU;IACV,sBAAW;IACX,mBAAQ;IACR,qBAAU;IACV,cAAI;IACJ,gBAAK;IACL,gBAAK;IACL,eAAK;CACN,CAAC;AACW,QAAA,iBAAiB,GAAiC,EAAE,CAAC;AAElE,sBAAc,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;IAC9B,yBAAiB,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AAC1C,CAAC,CAAC,CAAC;AAEU,QAAA,mBAAmB,GAA2B;IACzD,SAAS,EAAE,iCAAiC;IAC5C,UAAU,EAAE,mCAAmC;IAE/C,SAAS,EAEP,8PAA8P;IAChQ,SAAS,EACP,sNAAsN;CACzN,CAAC;AAEF,0CAAwB","file":"index.js","sourcesContent":["import circle from './circle';\nimport cross from './cross';\nimport diamond from './diamond';\nimport square from './square';\nimport triangle from './triangle';\nimport star from './star';\nimport arrow from './arrow';\nimport wedge from './wedge';\nimport stroke from './stroke';\nimport wye from './wye';\nimport triangleLeft from './triangle-left';\nimport triangleRight from './triangle-right';\nimport triangleUp from './triangle-up';\nimport triangleDown from './triangle-down';\nimport thinTriangle from './thin-triangle';\nimport arrow2Left from './arrow2-left';\nimport arrow2Right from './arrow2-right';\nimport arrow2Up from './arrow2-up';\nimport arrow2Down from './arrow2-down';\nimport lineV from './line-v';\nimport lineH from './line-h';\nimport close from './close';\nimport rect from './rect';\nimport type { ISymbolClass } from '../../interface';\n\nexport const builtinSymbols = [\n circle,\n cross,\n diamond,\n square,\n thinTriangle,\n triangle,\n star,\n arrow,\n wedge,\n stroke,\n wye,\n triangleLeft,\n triangleRight,\n triangleUp,\n triangleDown,\n arrow2Left,\n arrow2Right,\n arrow2Up,\n arrow2Down,\n rect,\n lineV,\n lineH,\n close\n];\nexport const builtinSymbolsMap: Record<string, ISymbolClass> = {};\n\nbuiltinSymbols.forEach(symbol => {\n builtinSymbolsMap[symbol.type] = symbol;\n});\n\nexport const builtInSymbolStrMap: Record<string, string> = {\n arrowLeft: 'M 0.25 -0.5 L -0.25 0 l 0.5 0.5',\n arrowRight: 'M -0.25 -0.5 l 0.5 0.5 l -0.5 0.5',\n // rect: 'M -0.5,0.25 L 0.5,0.25 L 0.5,-0.25,L -0.5,-0.25 Z',\n rectRound:\n // eslint-disable-next-line max-len\n 'M 0.3 -0.5 C 0.41 -0.5 0.5 -0.41 0.5 -0.3 C 0.5 -0.3 0.5 0.3 0.5 0.3 C 0.5 0.41 0.41 0.5 0.3 0.5 C 0.3 0.5 -0.3 0.5 -0.3 0.5 C -0.41 0.5 -0.5 0.41 -0.5 0.3 C -0.5 0.3 -0.5 -0.3 -0.5 -0.3 C -0.5 -0.41 -0.41 -0.5 -0.3 -0.5 C -0.3 -0.5 0.3 -0.5 0.3 -0.5 Z',\n roundLine:\n 'M 1.2392 -0.258 L -1.3432 -0.258 C -1.4784 -0.258 -1.588 -0.1436 -1.588 -0.002 c 0 0.1416 0.1096 0.256 0.2448 0.256 l 2.5824 0 c 0.1352 0 0.2448 -0.1144 0.2448 -0.256 C 1.484 -0.1436 1.3744 -0.258 1.2392 -0.258 z'\n};\n\nexport * from './utils';\n"]}
@@ -1,6 +1,7 @@
1
1
  import type { IContext2d, SymbolType, ISymbolClass } from '../../interface';
2
2
  import { BaseSymbol } from './base';
3
- export declare function rect(ctx: IContext2d, size: [number, number], x: number, y: number): boolean;
3
+ export declare function rectSizeArray(ctx: IContext2d, size: [number, number], x: number, y: number): boolean;
4
+ export declare function rectSize(ctx: IContext2d, size: number, x: number, y: number): boolean;
4
5
  export declare class RectSymbol extends BaseSymbol implements ISymbolClass {
5
6
  type: SymbolType;
6
7
  pathStr: string;
@@ -2,25 +2,30 @@
2
2
 
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: !0
5
- }), exports.RectSymbol = exports.rect = void 0;
5
+ }), exports.RectSymbol = exports.rectSize = exports.rectSizeArray = void 0;
6
6
 
7
7
  const vutils_1 = require("@visactor/vutils"), base_1 = require("./base");
8
8
 
9
- function rect(ctx, size, x, y) {
9
+ function rectSizeArray(ctx, size, x, y) {
10
10
  return ctx.rect(x - size[0] / 2, y - size[1] / 2, size[0], size[1]), !1;
11
11
  }
12
12
 
13
- exports.rect = rect;
13
+ function rectSize(ctx, size, x, y) {
14
+ const w = size, h = size / 2;
15
+ return ctx.rect(x - w / 2, y - h / 2, w, h), !1;
16
+ }
17
+
18
+ exports.rectSizeArray = rectSizeArray, exports.rectSize = rectSize;
14
19
 
15
20
  class RectSymbol extends base_1.BaseSymbol {
16
21
  constructor() {
17
- super(...arguments), this.type = "rect", this.pathStr = "M-0.5,-0.5h1v1h-1Z";
22
+ super(...arguments), this.type = "rect", this.pathStr = "M -0.5,0.25 L 0.5,0.25 L 0.5,-0.25,L -0.5,-0.25 Z";
18
23
  }
19
24
  draw(ctx, size, x, y) {
20
- return rect(ctx, (0, vutils_1.isNumber)(size) ? [ size, size ] : size, x, y);
25
+ return (0, vutils_1.isNumber)(size) ? rectSize(ctx, size, x, y) : rectSizeArray(ctx, size, x, y);
21
26
  }
22
27
  drawOffset(ctx, size, x, y, offset) {
23
- return rect(ctx, (0, vutils_1.isNumber)(size) ? [ size + 2 * offset, size + 2 * offset ] : [ size[0] + 2 * offset, size[1] + 2 * offset ], x, y);
28
+ return (0, vutils_1.isNumber)(size) ? rectSize(ctx, size + 2 * offset, x, y) : rectSizeArray(ctx, [ size[0] + 2 * offset, size[1] + 2 * offset ], x, y);
24
29
  }
25
30
  }
26
31
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/graphic/builtin-symbol/rect.ts"],"names":[],"mappings":";;;AACA,6CAA4C;AAE5C,iCAAoC;AAiCpC,SAAgB,IAAI,CAAC,GAAe,EAAE,IAAsB,EAAE,CAAS,EAAE,CAAS;IAChF,GAAG,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;IAC7D,OAAO,KAAK,CAAC;AACf,CAAC;AAHD,oBAGC;AAGD,MAAa,UAAW,SAAQ,iBAAU;IAA1C;;QACE,SAAI,GAAe,MAAM,CAAC;QAC1B,YAAO,GAAW,oBAAoB,CAAC;IAazC,CAAC;IAXC,IAAI,CAAC,GAAe,EAAE,IAA+B,EAAE,CAAS,EAAE,CAAS;QACzE,MAAM,QAAQ,GAAqB,IAAA,iBAAQ,EAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;QACxE,OAAO,IAAI,CAAC,GAAG,EAAE,QAAQ,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IACnC,CAAC;IAED,UAAU,CAAC,GAAe,EAAE,IAA+B,EAAE,CAAS,EAAE,CAAS,EAAE,MAAc;QAC/F,MAAM,QAAQ,GAAqB,IAAA,iBAAQ,EAAC,IAAI,CAAC;YAC/C,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,GAAG,MAAM,EAAE,IAAI,GAAG,CAAC,GAAG,MAAM,CAAC;YACxC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,CAAC;QACjD,OAAO,IAAI,CAAC,GAAG,EAAE,QAAQ,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IACnC,CAAC;CACF;AAfD,gCAeC;AAED,kBAAe,IAAI,UAAU,EAAE,CAAC","file":"rect.js","sourcesContent":["import type { IBounds } from '@visactor/vutils';\nimport { isNumber } from '@visactor/vutils';\nimport type { IContext2d, SymbolType, ISymbolClass } from '../../interface';\nimport { BaseSymbol } from './base';\n\n/**\n * 部分源码参考 https://github.com/vega/vega/blob/main/packages/vega-scenegraph/src/path/symbols.js\n * Copyright (c) 2015-2023, University of Washington Interactive Data Lab\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 1. Redistributions of source code must retain the above copyright notice, this\n list of conditions and the following disclaimer.\n\n 2. 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 3. Neither the name of the copyright holder nor the names of its contributors\n may be used to endorse or promote products derived from this software\n 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 OWNER 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\nexport function rect(ctx: IContext2d, size: [number, number], x: number, y: number) {\n ctx.rect(x - size[0] / 2, y - size[1] / 2, size[0], size[1]);\n return false;\n}\n\n// 以中心为锚点,size为circle外接正方形的面积\nexport class RectSymbol extends BaseSymbol implements ISymbolClass {\n type: SymbolType = 'rect';\n pathStr: string = 'M-0.5,-0.5h1v1h-1Z';\n\n draw(ctx: IContext2d, size: number | [number, number], x: number, y: number) {\n const rectSize: [number, number] = isNumber(size) ? [size, size] : size;\n return rect(ctx, rectSize, x, y);\n }\n\n drawOffset(ctx: IContext2d, size: number | [number, number], x: number, y: number, offset: number) {\n const rectSize: [number, number] = isNumber(size)\n ? [size + 2 * offset, size + 2 * offset]\n : [size[0] + 2 * offset, size[1] + 2 * offset];\n return rect(ctx, rectSize, x, y);\n }\n}\n\nexport default new RectSymbol();\n"]}
1
+ {"version":3,"sources":["../src/graphic/builtin-symbol/rect.ts"],"names":[],"mappings":";;;AACA,6CAA4C;AAE5C,iCAAoC;AAiCpC,SAAgB,aAAa,CAAC,GAAe,EAAE,IAAsB,EAAE,CAAS,EAAE,CAAS;IACzF,GAAG,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;IAC7D,OAAO,KAAK,CAAC;AACf,CAAC;AAHD,sCAGC;AAED,SAAgB,QAAQ,CAAC,GAAe,EAAE,IAAY,EAAE,CAAS,EAAE,CAAS;IAC1E,MAAM,CAAC,GAAG,IAAI,CAAC;IACf,MAAM,CAAC,GAAG,IAAI,GAAG,CAAC,CAAC;IACnB,GAAG,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IACrC,OAAO,KAAK,CAAC;AACf,CAAC;AALD,4BAKC;AAGD,MAAa,UAAW,SAAQ,iBAAU;IAA1C;;QACE,SAAI,GAAe,MAAM,CAAC;QAC1B,YAAO,GAAW,mDAAmD,CAAC;IAiBxE,CAAC;IAfC,IAAI,CAAC,GAAe,EAAE,IAA+B,EAAE,CAAS,EAAE,CAAS;QACzE,IAAI,IAAA,iBAAQ,EAAC,IAAI,CAAC,EAAE;YAClB,OAAO,QAAQ,CAAC,GAAG,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;SAClC;QACD,OAAO,aAAa,CAAC,GAAG,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IAGxC,CAAC;IAED,UAAU,CAAC,GAAe,EAAE,IAA+B,EAAE,CAAS,EAAE,CAAS,EAAE,MAAc;QAC/F,IAAI,IAAA,iBAAQ,EAAC,IAAI,CAAC,EAAE;YAClB,OAAO,QAAQ,CAAC,GAAG,EAAE,IAAI,GAAG,CAAC,GAAG,MAAM,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;SAC/C;QACD,OAAO,aAAa,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IAChF,CAAC;CACF;AAnBD,gCAmBC;AAED,kBAAe,IAAI,UAAU,EAAE,CAAC","file":"rect.js","sourcesContent":["import type { IBounds } from '@visactor/vutils';\nimport { isNumber } from '@visactor/vutils';\nimport type { IContext2d, SymbolType, ISymbolClass } from '../../interface';\nimport { BaseSymbol } from './base';\n\n/**\n * 部分源码参考 https://github.com/vega/vega/blob/main/packages/vega-scenegraph/src/path/symbols.js\n * Copyright (c) 2015-2023, University of Washington Interactive Data Lab\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 1. Redistributions of source code must retain the above copyright notice, this\n list of conditions and the following disclaimer.\n\n 2. 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 3. Neither the name of the copyright holder nor the names of its contributors\n may be used to endorse or promote products derived from this software\n 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 OWNER 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\nexport function rectSizeArray(ctx: IContext2d, size: [number, number], x: number, y: number) {\n ctx.rect(x - size[0] / 2, y - size[1] / 2, size[0], size[1]);\n return false;\n}\n\nexport function rectSize(ctx: IContext2d, size: number, x: number, y: number) {\n const w = size;\n const h = size / 2;\n ctx.rect(x - w / 2, y - h / 2, w, h);\n return false;\n}\n\n// 以中心为锚点,size为circle外接正方形的面积\nexport class RectSymbol extends BaseSymbol implements ISymbolClass {\n type: SymbolType = 'rect';\n pathStr: string = 'M -0.5,0.25 L 0.5,0.25 L 0.5,-0.25,L -0.5,-0.25 Z';\n\n draw(ctx: IContext2d, size: number | [number, number], x: number, y: number) {\n if (isNumber(size)) {\n return rectSize(ctx, size, x, y);\n }\n return rectSizeArray(ctx, size, x, y);\n // const rectSize: [number, number] = ? [size, size] : size;\n // return rect(ctx, rectSize, x, y);\n }\n\n drawOffset(ctx: IContext2d, size: number | [number, number], x: number, y: number, offset: number) {\n if (isNumber(size)) {\n return rectSize(ctx, size + 2 * offset, x, y);\n }\n return rectSizeArray(ctx, [size[0] + 2 * offset, size[1] + 2 * offset], x, y);\n }\n}\n\nexport default new RectSymbol();\n"]}
@@ -3,4 +3,4 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: !0
5
5
  });
6
- //# sourceMappingURL=allocator.js.map
6
+ //# sourceMappingURL=allocator.js.map
@@ -3,4 +3,4 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: !0
5
5
  });
6
- //# sourceMappingURL=animate.js.map
6
+ //# sourceMappingURL=animate.js.map
@@ -3,4 +3,4 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: !0
5
5
  });
6
- //# sourceMappingURL=camera.js.map
6
+ //# sourceMappingURL=camera.js.map
@@ -3,4 +3,4 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: !0
5
5
  });
6
- //# sourceMappingURL=canvas.js.map
6
+ //# sourceMappingURL=canvas.js.map
@@ -3,4 +3,4 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: !0
5
5
  });
6
- //# sourceMappingURL=color.js.map
6
+ //# sourceMappingURL=color.js.map
@@ -3,4 +3,4 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: !0
5
5
  });
6
- //# sourceMappingURL=common.js.map
6
+ //# sourceMappingURL=common.js.map
package/dist/index.js CHANGED
@@ -15569,28 +15569,36 @@
15569
15569
  }
15570
15570
  var close$1 = new CloseSymbol();
15571
15571
 
15572
- function rect(ctx, size, x, y) {
15572
+ function rectSizeArray(ctx, size, x, y) {
15573
15573
  ctx.rect(x - size[0] / 2, y - size[1] / 2, size[0], size[1]);
15574
15574
  return false;
15575
15575
  }
15576
+ function rectSize(ctx, size, x, y) {
15577
+ const w = size;
15578
+ const h = size / 2;
15579
+ ctx.rect(x - w / 2, y - h / 2, w, h);
15580
+ return false;
15581
+ }
15576
15582
  class RectSymbol extends BaseSymbol {
15577
15583
  constructor() {
15578
15584
  super(...arguments);
15579
15585
  this.type = 'rect';
15580
- this.pathStr = 'M-0.5,-0.5h1v1h-1Z';
15586
+ this.pathStr = 'M -0.5,0.25 L 0.5,0.25 L 0.5,-0.25,L -0.5,-0.25 Z';
15581
15587
  }
15582
15588
  draw(ctx, size, x, y) {
15583
- const rectSize = vutils.isNumber(size) ? [size, size] : size;
15584
- return rect(ctx, rectSize, x, y);
15589
+ if (vutils.isNumber(size)) {
15590
+ return rectSize(ctx, size, x, y);
15591
+ }
15592
+ return rectSizeArray(ctx, size, x, y);
15585
15593
  }
15586
15594
  drawOffset(ctx, size, x, y, offset) {
15587
- const rectSize = vutils.isNumber(size)
15588
- ? [size + 2 * offset, size + 2 * offset]
15589
- : [size[0] + 2 * offset, size[1] + 2 * offset];
15590
- return rect(ctx, rectSize, x, y);
15595
+ if (vutils.isNumber(size)) {
15596
+ return rectSize(ctx, size + 2 * offset, x, y);
15597
+ }
15598
+ return rectSizeArray(ctx, [size[0] + 2 * offset, size[1] + 2 * offset], x, y);
15591
15599
  }
15592
15600
  }
15593
- var rect$1 = new RectSymbol();
15601
+ var rect = new RectSymbol();
15594
15602
 
15595
15603
  const tempBounds = new vutils.AABBBounds();
15596
15604
  class CustomSymbolClass {
@@ -15680,7 +15688,7 @@
15680
15688
  arrow2Right$1,
15681
15689
  arrow2Up$1,
15682
15690
  arrow2Down$1,
15683
- rect$1,
15691
+ rect,
15684
15692
  lineV$1,
15685
15693
  lineH$1,
15686
15694
  close$1
@@ -15692,7 +15700,6 @@
15692
15700
  const builtInSymbolStrMap = {
15693
15701
  arrowLeft: 'M 0.25 -0.5 L -0.25 0 l 0.5 0.5',
15694
15702
  arrowRight: 'M -0.25 -0.5 l 0.5 0.5 l -0.5 0.5',
15695
- rect: 'M -0.5,0.25 L 0.5,0.25 L 0.5,-0.25,L -0.5,-0.25 Z',
15696
15703
  rectRound: 'M 0.3 -0.5 C 0.41 -0.5 0.5 -0.41 0.5 -0.3 C 0.5 -0.3 0.5 0.3 0.5 0.3 C 0.5 0.41 0.41 0.5 0.3 0.5 C 0.3 0.5 -0.3 0.5 -0.3 0.5 C -0.41 0.5 -0.5 0.41 -0.5 0.3 C -0.5 0.3 -0.5 -0.3 -0.5 -0.3 C -0.5 -0.41 -0.41 -0.5 -0.3 -0.5 C -0.3 -0.5 0.3 -0.5 0.3 -0.5 Z',
15697
15704
  roundLine: 'M 1.2392 -0.258 L -1.3432 -0.258 C -1.4784 -0.258 -1.588 -0.1436 -1.588 -0.002 c 0 0.1416 0.1096 0.256 0.2448 0.256 l 2.5824 0 c 0.1352 0 0.2448 -0.1144 0.2448 -0.256 C 1.484 -0.1436 1.3744 -0.258 1.2392 -0.258 z'
15698
15705
  };