diff --git a/src/components/workspace/index.tsx b/src/components/workspace/index.tsx index 4803da1..a2e4d2a 100644 --- a/src/components/workspace/index.tsx +++ b/src/components/workspace/index.tsx @@ -43,6 +43,8 @@ export const Workspace: React.FC = (props) => { [selectedElementIds] ); + const showZoomControls = props.options?.showZoomControls ?? true; + return (
= (props) => { )} - + {showZoomControls && }
); }; diff --git a/src/components/workspace/zoom.tsx b/src/components/workspace/zoom.tsx index 9a6f6f9..f182fa1 100644 --- a/src/components/workspace/zoom.tsx +++ b/src/components/workspace/zoom.tsx @@ -101,7 +101,11 @@ const Zoom = (props: ISTKProps) => { return (
{ const scaleFactor = 1.05; panAndZoom({ k: scaleFactor, - y: (workspaceheight - (wgOffsetTop * scaleFactor * 2 + workspaceGroupHeight * scaleFactor)) / 2 - 5, + y: (workspaceheight - (wgOffsetTop * scaleFactor * 2 + workspaceGroupHeight * scaleFactor)) / 2 - 7, x: (workspaceWidth - (wgOffsetLeft * scaleFactor * 2 + workspaceGroupWidth * scaleFactor)) / 2 }); }, 0); diff --git a/src/types/index.ts b/src/types/index.ts index 1905626..91991e1 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -43,6 +43,7 @@ export interface ISTKProps { showGridSwitch?: boolean; showSeatLabels?: boolean; showFooter?: boolean; + showZoomControls?: boolean; exportButtonText?: string; operationTriggerIcon?: React.FC; };