8e0206cc1e
* Make Undo & Redo and the menu buttons into actions; add undo/redo buttons * Create variables for the ToolIcon colors * Darken the menu buttons when they’re active * Put the more intensive test in `perform` * Fix & restyle hint viewer * Add pinch zoom for macOS Safari * Chrome/Firefox trackpad pinch zoom * openedMenu → openMenu * needsShapeEditor.ts → showSelectedShapeActions.ts * Call showSelectedShapeActions
14 lines
379 B
TypeScript
14 lines
379 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).length ||
|
|
appState.elementType !== "selection",
|
|
);
|