mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
Use meta key + wheel to zoom in/out (#769)
This commit is contained in:
parent
360864ef3d
commit
eee961d65f
4 changed files with 20 additions and 11 deletions
|
@ -28,3 +28,9 @@ export function getZoomTranslation(canvas: HTMLCanvasElement, zoom: number) {
|
|||
y: parseFloat(diffMiddleOfTheCanvas.y.toFixed(8)),
|
||||
};
|
||||
}
|
||||
|
||||
export function getNormalizedZoom(zoom: number): number {
|
||||
const normalizedZoom = parseFloat(zoom.toFixed(2));
|
||||
const clampedZoom = Math.max(0.1, Math.min(normalizedZoom, 2));
|
||||
return clampedZoom;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue