This commit is contained in:
Feng 2025-05-01 13:24:21 +02:00 committed by GitHub
commit 21c59ad80c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -8,6 +8,8 @@ import { KEYS, arrayToMap, getShortcutKey } from "@excalidraw/common";
import { alignElements } from "@excalidraw/element/align";
import { getMaximumGroups } from "@excalidraw/element/groups";
import type { ExcalidrawElement } from "@excalidraw/element/types";
import type { Alignment } from "@excalidraw/element/align";
@ -36,8 +38,12 @@ export const alignActionsPredicate = (
app: AppClassProperties,
) => {
const selectedElements = app.scene.getSelectedElements(appState);
const groups = getMaximumGroups(
selectedElements,
app.scene.getNonDeletedElementsMap(),
);
return (
selectedElements.length > 1 &&
groups.length > 1 &&
// TODO enable aligning frames when implemented properly
!selectedElements.some((el) => isFrameLikeElement(el))
);