From b9e8bea1ce46e105bff5bf9ec6b76bdddcabe2fa Mon Sep 17 00:00:00 2001 From: Elar Huik Date: Tue, 13 Jun 2023 13:45:43 +0300 Subject: [PATCH] feat(exhibit): enable toggling if the model bounces back to center after rotation --- src/components/Exhibit/Exhibit.component.tsx | 9 +++++++-- src/components/Exhibit/Exhibit.stories.tsx | 6 ++++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/components/Exhibit/Exhibit.component.tsx b/src/components/Exhibit/Exhibit.component.tsx index 739de010..2d8a8df1 100644 --- a/src/components/Exhibit/Exhibit.component.tsx +++ b/src/components/Exhibit/Exhibit.component.tsx @@ -42,6 +42,10 @@ export interface ExhibitProps extends CameraProps, EnvironmentProps { * Return base64 image after making screenshot of the canvas. */ capture?: CaptureType; + /** + * Enables snap-back to center after rotating model. + */ + snap?: boolean; } /** @@ -57,7 +61,8 @@ export const Exhibit: FC = ({ shadows = false, float = false, fit = false, - capture + capture, + snap = false }) => { const model = useMemo(() => { if (!isValidGlbFormat(modelSrc)) { @@ -79,7 +84,7 @@ export const Exhibit: FC = ({