diff --git a/src/Components/SVG/SVG.tsx b/src/Components/SVG/SVG.tsx index 4b49213..c56ce18 100644 --- a/src/Components/SVG/SVG.tsx +++ b/src/Components/SVG/SVG.tsx @@ -109,6 +109,9 @@ export function SVG(props: ISVGProps): JSX.Element { const value = event as Value; setScale(value.a); }} + onDoubleClick={() => { + svgViewer?.current?.setPointOnViewerCenter(props.width / 2, props.height / 2, 0.8); + }} background={'#ffffff'} defaultTool='pan' miniatureProps={{ @@ -131,6 +134,7 @@ export function SVG(props: ISVGProps): JSX.Element { function UseFitOnce(svgViewer: React.RefObject, width: number, height: number): void { React.useEffect(() => { - svgViewer?.current?.fitToViewer(); + // TODO: Fix this + svgViewer?.current?.setPointOnViewerCenter(width / 2, height / 2, 0.8); }, [svgViewer, width, height]); }