mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
* [WIP] Fast & Furious * ensure we translate before scaling * implement canvas caching for rest of elements * remove unnecessary ts-ignore * fix for devicePixelRatio * initialize missing element props on restore * factor out canvas padding * remove unnecessary filtering * simplify renderElement * regenerate canvas on prop changes * revert swapping shape resetting with canvas * fix blurry rendering * apply devicePixelRatio when clearing canvas * improve blurriness; fix arrow canvas offset * revert canvas clearing changes in anticipation of merge * normalize scrollX/Y on update * fix getDerivedStateFromProps * swap derivedState for type brands * tweak types * remove renderScene offsets * move selection element translations to renderElement * dry out canvas zoom transformations * fix padding offset * Render cached canvas based on the zoom level Co-authored-by: David Luzar <luzar.david@gmail.com> Co-authored-by: Preet <833927+pshihn@users.noreply.github.com>
21 lines
488 B
TypeScript
21 lines
488 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;
|
|
};
|
|
|
|
export type SceneScroll = {
|
|
scrollX: FlooredNumber;
|
|
scrollY: FlooredNumber;
|
|
};
|
|
|
|
export interface Scene {
|
|
elements: ExcalidrawTextElement[];
|
|
}
|
|
|
|
export type ExportType = "png" | "clipboard" | "backend" | "svg";
|