Pure node rendering (#443)

This commit is contained in:
Christopher Chedeau 2020-01-19 13:21:33 -08:00 committed by GitHub
parent 5ce5e5ac1e
commit 7f6e1f420e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 647 additions and 84 deletions

View file

@ -35,7 +35,7 @@ import { AppState } from "./types";
import { ExcalidrawElement, ExcalidrawTextElement } from "./element/types";
import { isInputLike, measureText, debounce, capitalizeString } from "./utils";
import { KEYS, META_KEY, isArrowKey } from "./keys";
import { KEYS, isArrowKey } from "./keys";
import { findShapeByKey, shapesShortcutKeys, SHAPES } from "./shapes";
import { createHistory } from "./history";
@ -303,7 +303,7 @@ export class App extends React.Component<{}, AppState> {
this.state.elementType !== "selection")
) {
this.setState({ elementType: findShapeByKey(event.key) });
} else if (event[META_KEY] && event.code === "KeyZ") {
} else if (event[KEYS.META] && event.code === "KeyZ") {
if (event.shiftKey) {
// Redo action
const data = history.redoOnce();