Set shape background to be transparent by default (#330)

Also makes "Clear canvas" reset the entire app state
This commit is contained in:
Christopher Chedeau 2020-01-11 20:34:21 -08:00 committed by GitHub
parent 3db7d69849
commit d45f48e60f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 27 additions and 23 deletions

22
src/appState.ts Normal file
View file

@ -0,0 +1,22 @@
import { AppState } from "./types";
import { getDateTime } from "./utils";
const DEFAULT_PROJECT_NAME = `excalidraw-${getDateTime()}`;
export function getDefaultAppState(): AppState {
return {
draggingElement: null,
resizingElement: null,
elementType: "selection",
exportBackground: true,
currentItemStrokeColor: "#000000",
currentItemBackgroundColor: "transparent",
currentItemFont: "20px Virgil",
viewBackgroundColor: "#ffffff",
scrollX: 0,
scrollY: 0,
cursorX: 0,
cursorY: 0,
name: DEFAULT_PROJECT_NAME
};
}