Zoom on cursor | Issue #940 (#2319)

This commit is contained in:
João Forja 2020-11-04 17:49:15 +00:00 committed by GitHub
parent facde7ace0
commit 566e6a5ede
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
24 changed files with 912 additions and 357 deletions

View file

@ -73,7 +73,7 @@ export type AppState = {
isCollaborating: boolean;
isResizing: boolean;
isRotating: boolean;
zoom: number;
zoom: Zoom;
openMenu: "canvas" | "shape" | null;
lastPointerDownWith: PointerType;
selectedElementIds: { [id: string]: boolean };
@ -99,6 +99,16 @@ export type AppState = {
fileHandle: import("browser-nativefs").FileSystemHandle | null;
};
export type NormalizedZoomValue = number & { _brand: "normalizedZoom" };
export type Zoom = Readonly<{
value: NormalizedZoomValue;
translation: Readonly<{
x: number;
y: number;
}>;
}>;
export type PointerCoords = Readonly<{
x: number;
y: number;