mirror of
https://github.com/ramvignesh-b/pi-ku.git
synced 2026-05-04 08:56:52 +00:00
refactor: update ComposeCanvas and Editor data handling types
This commit is contained in:
@@ -27,7 +27,6 @@ export interface FabricImageJSON extends FabricObjectJSON {
|
||||
}
|
||||
|
||||
export interface CanvasJSON {
|
||||
version: string;
|
||||
objects: (FabricObjectJSON | FabricImageJSON)[];
|
||||
canvasWidth?: number;
|
||||
canvasHeight?: number;
|
||||
@@ -266,7 +265,7 @@ export const ComposeCanvas = forwardRef<
|
||||
});
|
||||
},
|
||||
getData: () => {
|
||||
if (!fabricRef.current) return { version: "", objects: [] };
|
||||
if (!fabricRef.current) return { objects: [] };
|
||||
const json = fabricRef.current.toJSON() as CanvasJSON;
|
||||
json.canvasWidth = BASE_WIDTH;
|
||||
json.canvasHeight =
|
||||
|
||||
Reference in New Issue
Block a user