@visactor/vrender-core 1.1.11 → 1.1.12
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.
- package/cjs/canvas/conical-gradient.js +1 -1
- package/cjs/canvas/constants.js +1 -1
- package/cjs/canvas/empty-context.js +1 -1
- package/cjs/canvas/index.js +1 -1
- package/cjs/canvas/util.js +1 -1
- package/cjs/common/bezier-utils.js +2 -1
- package/cjs/common/contribution-store-state.js +1 -2
- package/cjs/common/generator.d.ts +0 -1
- package/cjs/common/generator.js +13 -2
- package/cjs/common/generator.js.map +1 -1
- package/cjs/common/path-svg.js +2 -1
- package/cjs/common/render-command-list.js +1 -2
- package/cjs/common/seg-context.js +1 -1
- package/cjs/common/simplify.js +1 -1
- package/cjs/common/sort.js +1 -1
- package/cjs/common/split-path.js +1 -1
- package/cjs/common/text.js +1 -1
- package/cjs/graphic/graphic.js +1 -0
- package/cjs/graphic/graphic.js.map +1 -1
- package/cjs/graphic/text.js +17 -7
- package/cjs/graphic/text.js.map +1 -1
- package/cjs/graphic/wrap-text.js +4 -2
- package/cjs/graphic/wrap-text.js.map +1 -1
- package/dist/index.es.js +20 -12
- package/es/canvas/conical-gradient.js +1 -1
- package/es/canvas/constants.js +1 -1
- package/es/canvas/empty-context.js +1 -1
- package/es/canvas/index.js +1 -1
- package/es/canvas/util.js +1 -1
- package/es/common/bezier-utils.js +2 -1
- package/es/common/contribution-store-state.js +1 -2
- package/es/common/generator.d.ts +0 -1
- package/es/common/generator.js +12 -3
- package/es/common/generator.js.map +1 -1
- package/es/common/path-svg.js +2 -1
- package/es/common/render-command-list.js +1 -2
- package/es/common/seg-context.js +1 -1
- package/es/common/simplify.js +1 -1
- package/es/common/sort.js +1 -1
- package/es/common/split-path.js +1 -1
- package/es/common/text.js +1 -1
- package/es/graphic/graphic.js +1 -0
- package/es/graphic/graphic.js.map +1 -1
- package/es/graphic/text.js +17 -7
- package/es/graphic/text.js.map +1 -1
- package/es/graphic/wrap-text.js +4 -2
- package/es/graphic/wrap-text.js.map +1 -1
- package/package.json +3 -3
package/es/common/generator.js
CHANGED
|
@@ -1,8 +1,17 @@
|
|
|
1
|
+
const GENERATOR_STATE_SYMBOL = Symbol.for("@visactor/vrender-core/generator-state");
|
|
2
|
+
|
|
3
|
+
function getGeneratorState() {
|
|
4
|
+
const scope = globalThis;
|
|
5
|
+
return scope[GENERATOR_STATE_SYMBOL] || (scope[GENERATOR_STATE_SYMBOL] = {
|
|
6
|
+
autoIncrementId: 0
|
|
7
|
+
});
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const generatorState = getGeneratorState();
|
|
11
|
+
|
|
1
12
|
export class Generator {
|
|
2
13
|
static GenAutoIncrementId() {
|
|
3
|
-
return
|
|
14
|
+
return generatorState.autoIncrementId++;
|
|
4
15
|
}
|
|
5
16
|
}
|
|
6
|
-
|
|
7
|
-
Generator.auto_increment_id = 0;
|
|
8
17
|
//# sourceMappingURL=generator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/common/generator.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/common/generator.ts"],"names":[],"mappings":"AAIA,MAAM,sBAAsB,GAAG,MAAM,CAAC,GAAG,CAAC,wCAAwC,CAAC,CAAC;AAEpF,SAAS,iBAAiB;IACxB,MAAM,KAAK,GAAG,UAEb,CAAC;IACF,OAAO,KAAK,CAAC,sBAAsB,CAAC,IAAI,CAAC,KAAK,CAAC,sBAAsB,CAAC,GAAG,EAAE,eAAe,EAAE,CAAC,EAAE,CAAC,CAAC;AACnG,CAAC;AAID,MAAM,cAAc,GAAG,iBAAiB,EAAE,CAAC;AAE3C,MAAM,OAAO,SAAS;IACpB,MAAM,CAAC,kBAAkB;QACvB,OAAO,cAAc,CAAC,eAAe,EAAE,CAAC;IAC1C,CAAC;CACF","file":"generator.js","sourcesContent":["interface IGeneratorState {\n autoIncrementId: number;\n}\n\nconst GENERATOR_STATE_SYMBOL = Symbol.for('@visactor/vrender-core/generator-state');\n\nfunction getGeneratorState(): IGeneratorState {\n const scope = globalThis as typeof globalThis & {\n [GENERATOR_STATE_SYMBOL]?: IGeneratorState;\n };\n return scope[GENERATOR_STATE_SYMBOL] || (scope[GENERATOR_STATE_SYMBOL] = { autoIncrementId: 0 });\n}\n\n// Application and legacy runtime state are shared across bundles. Keep node ids in the same\n// global scope so a shared Stage cannot receive a Layer with a colliding id from another bundle.\nconst generatorState = getGeneratorState();\n\nexport class Generator {\n static GenAutoIncrementId(): number {\n return generatorState.autoIncrementId++;\n }\n}\n"]}
|
package/es/common/path-svg.js
CHANGED
package/es/common/seg-context.js
CHANGED
package/es/common/simplify.js
CHANGED
|
@@ -30,4 +30,4 @@ export function flatten_simplify(points, tolerance, highestQuality) {
|
|
|
30
30
|
if (points.length <= 10) return points;
|
|
31
31
|
return points = highestQuality ? points : simplifyRadialDist(points, void 0 !== tolerance ? tolerance * tolerance : 1);
|
|
32
32
|
}
|
|
33
|
-
//# sourceMappingURL=simplify.js.map
|
|
33
|
+
//# sourceMappingURL=simplify.js.map
|
package/es/common/sort.js
CHANGED
package/es/common/split-path.js
CHANGED
package/es/common/text.js
CHANGED
|
@@ -24,4 +24,4 @@ export function textAttributesToStyle(attrs) {
|
|
|
24
24
|
attrs.underline ? style["text-decoration"] = "underline" : attrs.lineThrough && (style["text-decoration"] = "line-through"),
|
|
25
25
|
attrs.fill && isString(attrs.fill) && (style.color = attrs.fill), style;
|
|
26
26
|
}
|
|
27
|
-
//# sourceMappingURL=text.js.map
|
|
27
|
+
//# sourceMappingURL=text.js.map
|
package/es/graphic/graphic.js
CHANGED
|
@@ -744,6 +744,7 @@ export class Graphic extends Node {
|
|
|
744
744
|
[key]: value
|
|
745
745
|
}, this.attribute, key, context);
|
|
746
746
|
if (params) this._setAttributes(params, forceUpdateTag, context); else if (this.canCommitBaseAttributesByTouchedKeys()) this.commitBaseAttributeBySingleKey(key, value, !!forceUpdateTag, context); else {
|
|
747
|
+
this.detachAttributeFromBaseAttributes();
|
|
747
748
|
const nextAttrs = {
|
|
748
749
|
[key]: value
|
|
749
750
|
};
|