From d1ef9292ccec43eafb0ad325803b5eea1455bdc2 Mon Sep 17 00:00:00 2001 From: Makary Hryshkin Date: Sun, 8 Dec 2024 18:04:31 +0100 Subject: [PATCH] fix: handle delayed/conditional rendering of TransformComponent --- src/core/bounds/bounds.utils.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/core/bounds/bounds.utils.ts b/src/core/bounds/bounds.utils.ts index aa4e2b9a..b1723fe5 100644 --- a/src/core/bounds/bounds.utils.ts +++ b/src/core/bounds/bounds.utils.ts @@ -67,7 +67,12 @@ export const calculateBounds = ( const { centerZoomedOut } = contextInstance.setup; if (!wrapperComponent || !contentComponent) { - throw new Error("Components are not mounted"); + return { + minPositionX: 0, + maxPositionX: 0, + minPositionY: 0, + maxPositionY: 0, + } } const {