@bwp-web/canvas 0.6.0 → 0.6.1
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.cjs +48 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +48 -0
- package/dist/index.js.map +1 -1
- package/dist/serialization.d.ts +7 -5
- package/dist/serialization.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/serialization.d.ts
CHANGED
|
@@ -53,11 +53,13 @@ export declare function getBaseStrokeWidth(obj: FabricObject): number;
|
|
|
53
53
|
/**
|
|
54
54
|
* Serialize the canvas to a plain object, ready for `JSON.stringify`.
|
|
55
55
|
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
*
|
|
56
|
+
* The output uses Fabric 6 conventions (`originX: 'left'`, `originY: 'top'`,
|
|
57
|
+
* `backgroundFilters`, `data.strokeWidthBase`) so saved data is readable by
|
|
58
|
+
* both old (Fabric 6) and new (Fabric 7) canvas implementations.
|
|
59
|
+
*
|
|
60
|
+
* Internally, the canvas keeps `center/center` origins at runtime. This
|
|
61
|
+
* function temporarily converts objects to `left/top` origin before calling
|
|
62
|
+
* `toObject()`, then restores the runtime state immediately after.
|
|
61
63
|
*/
|
|
62
64
|
export declare function serializeCanvas(canvas: FabricCanvas, options?: SerializeOptions): CanvasJSON;
|
|
63
65
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serialization.d.ts","sourceRoot":"","sources":["../src/serialization.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,MAAM,IAAI,YAAY,EAGtB,KAAK,YAAY,
|
|
1
|
+
{"version":3,"file":"serialization.d.ts","sourceRoot":"","sources":["../src/serialization.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,MAAM,IAAI,YAAY,EAGtB,KAAK,YAAY,EAGlB,MAAM,QAAQ,CAAC;AAIhB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,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