feat: splitting logic, memoization

This commit is contained in:
Arnošt Pleskot
2023-07-14 20:46:48 +02:00
parent 71eb3023b2
commit 132750f753
3 changed files with 300 additions and 161 deletions

View File

@@ -223,17 +223,7 @@ export type AppState = {
pendingImageElementId: ExcalidrawImageElement["id"] | null;
showHyperlinkPopup: false | "info" | "editor";
selectedLinearElement: LinearElementEditor | null;
scrollConstraints: {
x: number;
y: number;
width: number;
height: number;
isAnimating?: boolean;
opts?: {
viewportZoomFactor?: number;
lockZoom?: boolean;
};
} | null;
scrollConstraints: ScrollConstraints | null;
};
export type UIAppState = Omit<
@@ -590,3 +580,13 @@ export type FrameNameBoundsCache = {
}
>;
};
export type ScrollConstraints = {
x: number;
y: number;
width: number;
height: number;
isAnimating?: boolean;
viewportZoomFactor?: number;
lockZoom?: boolean;
};