From 5c1ecab56d75a7661a0c4ffeed76228460ea71df Mon Sep 17 00:00:00 2001 From: akram Date: Thu, 25 Jan 2024 13:57:47 +0530 Subject: [PATCH] fix: fix image upload --- src/modules/artboard/helpers.ts | 2 +- src/modules/image/helpers.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modules/artboard/helpers.ts b/src/modules/artboard/helpers.ts index 4fd7b96..5aa57a0 100644 --- a/src/modules/artboard/helpers.ts +++ b/src/modules/artboard/helpers.ts @@ -21,7 +21,7 @@ export const getArtboardDimensions = ( const width = artboard.width; const height = artboard.height; - if (!width || !height) { + if (width === undefined || height === undefined) { throw new Error('Artboard dimensions not found'); } diff --git a/src/modules/image/helpers.ts b/src/modules/image/helpers.ts index a8e8fc1..12a16e8 100644 --- a/src/modules/image/helpers.ts +++ b/src/modules/image/helpers.ts @@ -44,7 +44,7 @@ export const getScaledPosition = (artboard: fabric.Rect): { left: number; top: n const width = artboard.width; const height = artboard.height; - if (!left || !top || !width || !height) { + if (left === undefined || top === undefined || width === undefined || height === undefined) { throw new Error('Artboard dimensions not found'); }