From 339636caab4d70e76f6d68eb145054b964c1e2de Mon Sep 17 00:00:00 2001 From: David Luzar Date: Sun, 6 Feb 2022 21:58:59 +0100 Subject: [PATCH] feat: allow any precision when zooming (#4730) --- src/scene/zoom.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/scene/zoom.ts b/src/scene/zoom.ts index 2832a8bc..9c0a933a 100644 --- a/src/scene/zoom.ts +++ b/src/scene/zoom.ts @@ -1,9 +1,7 @@ import { AppState, NormalizedZoomValue } from "../types"; export const getNormalizedZoom = (zoom: number): NormalizedZoomValue => { - const normalizedZoom = parseFloat(zoom.toFixed(2)); - const clampedZoom = Math.max(0.1, Math.min(normalizedZoom, 30)); - return clampedZoom as NormalizedZoomValue; + return Math.max(0.1, Math.min(zoom, 30)) as NormalizedZoomValue; }; export const getStateForZoom = (