excalidraw/src/element/showSelectedShapeActions.ts
Pete Hunt ccbbdb75a6
Refactor ExcalidrawElement (#874)
* Get rid of isSelected, canvas, canvasZoom, canvasOffsetX and canvasOffsetY on ExcalidrawElement.

* Fix most unit tests. Fix cmd a. Fix alt drag

* Focus on paste

* shift select should include previously selected items

* Fix last test

* Move this.shape out of ExcalidrawElement and into a WeakMap
2020-03-08 10:20:55 -07:00

14 lines
389 B
TypeScript

import { AppState } from "../types";
import { ExcalidrawElement } from "./types";
import { getSelectedElements } from "../scene";
export const showSelectedShapeActions = (
appState: AppState,
elements: readonly ExcalidrawElement[],
) =>
Boolean(
appState.editingElement ||
getSelectedElements(elements, appState).length ||
appState.elementType !== "selection",
);