fix: consistent use of ZOOM_STEP (#5801)

introduce MIN_ZOOM, consistent use of ZOOM_STEP
This commit is contained in:
zsviczian 2022-10-31 06:23:05 +01:00 committed by GitHub
parent f5379d1563
commit 1e69609ce4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 4 deletions

View file

@ -1,7 +1,8 @@
import { MIN_ZOOM } from "../constants";
import { AppState, NormalizedZoomValue } from "../types";
export const getNormalizedZoom = (zoom: number): NormalizedZoomValue => {
return Math.max(0.1, Math.min(zoom, 30)) as NormalizedZoomValue;
return Math.max(MIN_ZOOM, Math.min(zoom, 30)) as NormalizedZoomValue;
};
export const getStateForZoom = (