Skip to content

Commit ac70b19

Browse files
committed
Move zoom to constants and increase max zoom
1 parent 5cf49d4 commit ac70b19

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

webview-ui/src/components/common/MermaidButton.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ import { TabButton } from "./TabButton"
77
import { IconButton } from "./IconButton"
88
import { ZoomControls } from "./ZoomControls"
99

10+
const MIN_ZOOM = 0.5
11+
const MAX_ZOOM = 20
12+
1013
export interface MermaidButtonProps {
1114
containerRef: React.RefObject<HTMLDivElement>
1215
code: string
@@ -59,7 +62,7 @@ export function MermaidButton({ containerRef, code, isLoading, children }: Merma
5962
const adjustZoom = (amount: number) => {
6063
setZoomLevel((prev) => {
6164
const newZoom = prev + amount
62-
return Math.max(0.5, Math.min(3, newZoom))
65+
return Math.max(MIN_ZOOM, Math.min(MAX_ZOOM, newZoom))
6366
})
6467
}
6568

0 commit comments

Comments
 (0)