File tree Expand file tree Collapse file tree 4 files changed +10
-3
lines changed Expand file tree Collapse file tree 4 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -43,6 +43,8 @@ export const Workspace: React.FC<ISTKProps> = (props) => {
4343 [ selectedElementIds ]
4444 ) ;
4545
46+ const showZoomControls = props . options ?. showZoomControls ?? true ;
47+
4648 return (
4749 < div
4850 id = { ids . workspaceContainer }
@@ -119,7 +121,7 @@ export const Workspace: React.FC<ISTKProps> = (props) => {
119121 < Grid />
120122 </ >
121123 ) }
122- < Zoom { ...props } />
124+ { showZoomControls && < Zoom { ...props } /> }
123125 </ div >
124126 ) ;
125127} ;
Original file line number Diff line number Diff line change @@ -101,7 +101,11 @@ const Zoom = (props: ISTKProps) => {
101101 return (
102102 < div
103103 id = { ids . zoomControls }
104- className = { twMerge ( "fixed bottom-14 left-20 flex flex-col items-center gap-4" , zoomStyles ?. root ?. className ) }
104+ className = { twMerge (
105+ "fixed bottom-14 left-20 flex flex-col items-center gap-4" ,
106+ props . mode === "user" && "bottom-5 left-6 sm:bottom-6 sm:left-8 md:bottom-8 md:left-10" ,
107+ zoomStyles ?. root ?. className
108+ ) }
105109 style = { zoomStyles ?. root ?. properties }
106110 >
107111 < div
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ const useWorkspaceLoad = (props: ISTKProps) => {
2323 const scaleFactor = 1.05 ;
2424 panAndZoom ( {
2525 k : scaleFactor ,
26- y : ( workspaceheight - ( wgOffsetTop * scaleFactor * 2 + workspaceGroupHeight * scaleFactor ) ) / 2 - 5 ,
26+ y : ( workspaceheight - ( wgOffsetTop * scaleFactor * 2 + workspaceGroupHeight * scaleFactor ) ) / 2 - 7 ,
2727 x : ( workspaceWidth - ( wgOffsetLeft * scaleFactor * 2 + workspaceGroupWidth * scaleFactor ) ) / 2
2828 } ) ;
2929 } , 0 ) ;
Original file line number Diff line number Diff line change @@ -43,6 +43,7 @@ export interface ISTKProps {
4343 showGridSwitch ?: boolean ;
4444 showSeatLabels ?: boolean ;
4545 showFooter ?: boolean ;
46+ showZoomControls ?: boolean ;
4647 exportButtonText ?: string ;
4748 operationTriggerIcon ?: React . FC ;
4849 } ;
You can’t perform that action at this time.
0 commit comments