* Don't reset cache while zooming using a gesture This reuses the cached canvas while the gesture is happening. Once it has stop updating, then recompute the cache with the proper zoom. This should massively improve performance when panning on big scenes on mobile Fixes #1056 * update snapshot tests
39 lines
820 B
TypeScript
39 lines
820 B
TypeScript
import { ExcalidrawTextElement } from "../element/types";
|
|
import { FlooredNumber } from "../types";
|
|
|
|
export type SceneState = {
|
|
scrollX: FlooredNumber;
|
|
scrollY: FlooredNumber;
|
|
// null indicates transparent bg
|
|
viewBackgroundColor: string | null;
|
|
zoom: number;
|
|
shouldCacheIgnoreZoom: boolean;
|
|
remotePointerViewportCoords: { [id: string]: { x: number; y: number } };
|
|
};
|
|
|
|
export type SceneScroll = {
|
|
scrollX: FlooredNumber;
|
|
scrollY: FlooredNumber;
|
|
};
|
|
|
|
export interface Scene {
|
|
elements: ExcalidrawTextElement[];
|
|
}
|
|
|
|
export type ExportType = "png" | "clipboard" | "backend" | "svg";
|
|
|
|
export type ScrollBars = {
|
|
horizontal: {
|
|
x: number;
|
|
y: number;
|
|
width: number;
|
|
height: number;
|
|
} | null;
|
|
vertical: {
|
|
x: number;
|
|
y: number;
|
|
width: number;
|
|
height: number;
|
|
} | null;
|
|
};
|