Skip to content

Commit e48ec43

Browse files
committed
fix(file-viewer): use exponential zoom formula to prevent zero/negative multiplier
1 parent 5e7e979 commit e48ec43

File tree

1 file changed

+1
-1
lines changed
  • apps/sim/app/workspace/[workspaceId]/files/components/file-viewer

1 file changed

+1
-1
lines changed

apps/sim/app/workspace/[workspaceId]/files/components/file-viewer/file-viewer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,7 @@ const ImagePreview = memo(function ImagePreview({ file }: { file: WorkspaceFileR
461461
const onWheel = (e: WheelEvent) => {
462462
e.preventDefault()
463463
if (e.ctrlKey || e.metaKey) {
464-
setZoom((z) => clampZoom(z * (1 - e.deltaY * ZOOM_WHEEL_SENSITIVITY)))
464+
setZoom((z) => clampZoom(z * Math.exp(-e.deltaY * ZOOM_WHEEL_SENSITIVITY)))
465465
} else {
466466
setOffset((o) => ({ x: o.x - e.deltaX, y: o.y - e.deltaY }))
467467
}

0 commit comments

Comments
 (0)