|
|
@ -1,9 +1,7 @@
|
|
|
|
import { AppState, NormalizedZoomValue } from "../types";
|
|
|
|
import { AppState, NormalizedZoomValue } from "../types";
|
|
|
|
|
|
|
|
|
|
|
|
export const getNormalizedZoom = (zoom: number): NormalizedZoomValue => {
|
|
|
|
export const getNormalizedZoom = (zoom: number): NormalizedZoomValue => {
|
|
|
|
const normalizedZoom = parseFloat(zoom.toFixed(2));
|
|
|
|
return Math.max(0.1, Math.min(zoom, 30)) as NormalizedZoomValue;
|
|
|
|
const clampedZoom = Math.max(0.1, Math.min(normalizedZoom, 30));
|
|
|
|
|
|
|
|
return clampedZoom as NormalizedZoomValue;
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
export const getStateForZoom = (
|
|
|
|
export const getStateForZoom = (
|
|
|
|