fabric-vectr 6.7.13 → 6.7.14
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/dist/index.js +21 -14
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/dist/index.min.mjs +1 -1
- package/dist/index.min.mjs.map +1 -1
- package/dist/index.mjs +21 -14
- package/dist/index.mjs.map +1 -1
- package/dist/index.node.cjs +21 -14
- package/dist/index.node.cjs.map +1 -1
- package/dist/index.node.mjs +21 -14
- package/dist/index.node.mjs.map +1 -1
- package/dist/package.json.min.mjs +1 -1
- package/dist/package.json.mjs +1 -1
- package/dist/src/canvas/StaticCanvas.d.ts.map +1 -1
- package/dist/src/canvas/StaticCanvas.min.mjs +1 -1
- package/dist/src/canvas/StaticCanvas.min.mjs.map +1 -1
- package/dist/src/canvas/StaticCanvas.mjs +15 -12
- package/dist/src/canvas/StaticCanvas.mjs.map +1 -1
- package/dist/src/shapes/Object/FabricObjectSVGExportMixin.d.ts.map +1 -1
- package/dist/src/shapes/Object/FabricObjectSVGExportMixin.min.mjs +1 -1
- package/dist/src/shapes/Object/FabricObjectSVGExportMixin.min.mjs.map +1 -1
- package/dist/src/shapes/Object/FabricObjectSVGExportMixin.mjs +5 -1
- package/dist/src/shapes/Object/FabricObjectSVGExportMixin.mjs.map +1 -1
- package/dist-extensions/src/canvas/StaticCanvas.d.ts.map +1 -1
- package/dist-extensions/src/shapes/Object/FabricObjectSVGExportMixin.d.ts.map +1 -1
- package/package.json +33 -33
- package/src/canvas/StaticCanvas.spec.ts +23 -0
- package/src/canvas/StaticCanvas.ts +19 -12
- package/src/shapes/Object/FabricObjectSVGExportMixin.ts +5 -1
- package/src/shapes/Text/TextSVGExportMixin.spec.ts +16 -0
package/dist/index.js
CHANGED
|
@@ -366,7 +366,7 @@
|
|
|
366
366
|
}
|
|
367
367
|
const cache = new Cache();
|
|
368
368
|
|
|
369
|
-
var version = "6.7.
|
|
369
|
+
var version = "6.7.14";
|
|
370
370
|
|
|
371
371
|
// use this syntax so babel plugin see this import here
|
|
372
372
|
const VERSION = version;
|
|
@@ -3080,25 +3080,28 @@
|
|
|
3080
3080
|
*/
|
|
3081
3081
|
_createPathForText() {
|
|
3082
3082
|
const pathMarkups = [];
|
|
3083
|
-
|
|
3084
|
-
|
|
3085
|
-
|
|
3086
|
-
|
|
3087
|
-
|
|
3088
|
-
|
|
3083
|
+
const objects = [];
|
|
3084
|
+
this._objects.forEach(function add(object) {
|
|
3085
|
+
objects.push(object);
|
|
3086
|
+
if (isCollection(object)) {
|
|
3087
|
+
object._objects.forEach(add);
|
|
3088
|
+
}
|
|
3089
|
+
});
|
|
3090
|
+
objects.forEach(instance => {
|
|
3089
3091
|
if (instance.excludeFromExport) {
|
|
3090
|
-
|
|
3092
|
+
return;
|
|
3091
3093
|
}
|
|
3092
3094
|
if (!isTextObject(instance) || !instance.path) {
|
|
3093
|
-
|
|
3095
|
+
return;
|
|
3094
3096
|
}
|
|
3095
|
-
|
|
3096
|
-
|
|
3097
|
-
|
|
3097
|
+
const pathId = `TEXTPATH_${instance.id}`;
|
|
3098
|
+
const pathMarkup = instance.path._toSVG();
|
|
3099
|
+
const index = pathMarkup.indexOf('COMMON_PARTS');
|
|
3100
|
+
|
|
3098
3101
|
// 加上id, 和路径偏移
|
|
3099
3102
|
pathMarkup[index] = ['id="' + pathId + '" ', 'transform="translate(' + -instance.path.pathOffset.x + ',' + -instance.path.pathOffset.y + ')" '].join('');
|
|
3100
3103
|
pathMarkups.push(pathMarkup.join(''));
|
|
3101
|
-
}
|
|
3104
|
+
});
|
|
3102
3105
|
return pathMarkups.join('\n');
|
|
3103
3106
|
}
|
|
3104
3107
|
createSVGClipPathMarkup(options) {
|
|
@@ -5051,13 +5054,17 @@
|
|
|
5051
5054
|
commonPieces = [styleInfo, vectorEffect, noStyle ? '' : this.addPaintOrder(), ' ', additionalTransform ? `transform="${additionalTransform}" ` : ''].join('');
|
|
5052
5055
|
|
|
5053
5056
|
// James added shadow 放在上面
|
|
5057
|
+
// 文本等调用方已经通过 withShadow 挂载 filter 时,避免再额外复制一份可见对象,
|
|
5058
|
+
// 但仍然需要输出 filter 定义,否则普通 SVG 会丢失阴影。
|
|
5054
5059
|
if (shadow) {
|
|
5060
|
+
markup.push(shadow.toSVG(this));
|
|
5061
|
+
}
|
|
5062
|
+
if (shadow && !withShadow) {
|
|
5055
5063
|
const styleInfoWithShadow = 'style="' + this.getSvgStyles(false) + '" ';
|
|
5056
5064
|
const commonPiecesWithShadow = [styleInfoWithShadow, vectorEffect, noStyle ? '' : this.addPaintOrder(), ' ', additionalTransform ? 'transform="' + additionalTransform + '" ' : ''].join('');
|
|
5057
5065
|
const objectMarkupCopy = JSON.parse(JSON.stringify(objectMarkup));
|
|
5058
5066
|
objectMarkupCopy[index] = commonPiecesWithShadow;
|
|
5059
5067
|
markup.push(objectMarkupCopy.join(''));
|
|
5060
|
-
markup.push(shadow.toSVG(this));
|
|
5061
5068
|
}
|
|
5062
5069
|
// objectMarkup中是导出主对象(如path)的svg,index下标是style,放在commonPieces
|
|
5063
5070
|
objectMarkup[index] = commonPieces;
|