@@ -65,41 +65,27 @@ export function ZoomControls({
6565 }
6666 } , [ ] )
6767
68- // If using continuous zoom, render buttons with mouse down/up handlers
69- if ( useContinuousZoom && adjustZoom ) {
70- return (
71- < div className = "flex items-center gap-2" >
72- < button
73- className = "w-7 h-7 flex items-center justify-center border-none text-vscode-editor-foreground cursor-pointer rounded-[3px] bg-transparent hover:bg-vscode-toolbar-hoverBackground"
74- onMouseDown = { ( ) => startContinuousZoom ( zoomOutStep ) }
75- onMouseUp = { stopContinuousZoom }
76- onMouseLeave = { stopContinuousZoom }
77- title = { zoomOutTitle } >
78- < span className = "codicon codicon-zoom-out" > </ span >
79- </ button >
80- < div className = "text-sm text-vscode-editor-foreground min-w-[50px] text-center" >
81- { Math . round ( zoomLevel * 100 ) } %
82- </ div >
83- < button
84- className = "w-7 h-7 flex items-center justify-center border-none text-vscode-editor-foreground cursor-pointer rounded-[3px] bg-transparent hover:bg-vscode-toolbar-hoverBackground"
85- onMouseDown = { ( ) => startContinuousZoom ( zoomInStep ) }
86- onMouseUp = { stopContinuousZoom }
87- onMouseLeave = { stopContinuousZoom }
88- title = { zoomInTitle } >
89- < span className = "codicon codicon-zoom-in" > </ span >
90- </ button >
91- </ div >
92- )
93- }
94-
95- // Default rendering with simple click handlers
9668 return (
9769 < div className = "flex items-center gap-2" >
98- < IconButton icon = "zoom-out" onClick = { onZoomOut || ( ( ) => adjustZoom ?.( zoomOutStep ) ) } title = { zoomOutTitle } />
70+ < IconButton
71+ icon = "zoom-out"
72+ title = { zoomOutTitle }
73+ onClick = { ! useContinuousZoom ? onZoomOut || ( ( ) => adjustZoom ?.( zoomOutStep ) ) : undefined }
74+ onMouseDown = { useContinuousZoom && adjustZoom ? ( ) => startContinuousZoom ( zoomOutStep ) : undefined }
75+ onMouseUp = { useContinuousZoom && adjustZoom ? stopContinuousZoom : undefined }
76+ onMouseLeave = { useContinuousZoom && adjustZoom ? stopContinuousZoom : undefined }
77+ />
9978 < div className = "text-sm text-vscode-editor-foreground min-w-[50px] text-center" >
10079 { Math . round ( zoomLevel * 100 ) } %
10180 </ div >
102- < IconButton icon = "zoom-in" onClick = { onZoomIn || ( ( ) => adjustZoom ?.( zoomInStep ) ) } title = { zoomInTitle } />
81+ < IconButton
82+ icon = "zoom-in"
83+ title = { zoomInTitle }
84+ onClick = { ! useContinuousZoom ? onZoomIn || ( ( ) => adjustZoom ?.( zoomInStep ) ) : undefined }
85+ onMouseDown = { useContinuousZoom && adjustZoom ? ( ) => startContinuousZoom ( zoomInStep ) : undefined }
86+ onMouseUp = { useContinuousZoom && adjustZoom ? stopContinuousZoom : undefined }
87+ onMouseLeave = { useContinuousZoom && adjustZoom ? stopContinuousZoom : undefined }
88+ />
10389 </ div >
10490 )
10591}
0 commit comments