fix z-index action to account for deleted elems and add tests (#1077)

This commit is contained in:
David Luzar 2020-03-26 08:28:50 +01:00 committed by GitHub
parent fb82715ef7
commit 6fd2a3b2e5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 254 additions and 31 deletions

View file

@ -1,6 +1,5 @@
export { isOverScrollBars } from "./scrollbars";
export {
getSelectedIndices,
deleteSelectedElements,
isSomeElementSelected,
getElementsWithinSelection,

View file

@ -49,19 +49,6 @@ export function deleteSelectedElements(
};
}
export function getSelectedIndices(
elements: readonly ExcalidrawElement[],
appState: AppState,
) {
const selectedIndices: number[] = [];
elements.forEach((element, index) => {
if (appState.selectedElementIds[element.id]) {
selectedIndices.push(index);
}
});
return selectedIndices;
}
export function isSomeElementSelected(
elements: readonly ExcalidrawElement[],
appState: AppState,