mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-04-14 16:40:58 -04:00
feat: allow any precision when zooming (#4730)
This commit is contained in:
parent
08115ef311
commit
339636caab
1 changed files with 1 additions and 3 deletions
|
@ -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 = (
|
||||
|
|
Loading…
Add table
Reference in a new issue