Skip to content
Merged
7 changes: 6 additions & 1 deletion src/components/MultiGestureCanvas/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,11 @@ type MultiGestureCanvasProps = ChildrenProps & {
onSwipeDown?: OnSwipeDownCallback;
};

const defaultContentSize = {width: 1, height: 1};

function MultiGestureCanvas({
canvasSize,
contentSize = {width: 1, height: 1},
contentSize: contentSizeProp,
zoomRange: zoomRangeProp,
isActive = true,
children,
Expand All @@ -66,6 +68,7 @@ function MultiGestureCanvas({
const styles = useThemeStyles();
const StyleUtils = useStyleUtils();

const contentSize = contentSizeProp ?? defaultContentSize;
const shouldDisableTransformationGesturesFallback = useSharedValue(false);
const shouldDisableTransformationGestures = shouldDisableTransformationGesturesProp ?? shouldDisableTransformationGesturesFallback;

Expand Down Expand Up @@ -224,6 +227,8 @@ function MultiGestureCanvas({
},
{scale: totalScale.value},
],
// Hide the image if the size is not ready yet
opacity: contentSizeProp?.width ? 1 : 0,
};
});

Expand Down