mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
fix z-index action to account for deleted elems and add tests (#1077)
This commit is contained in:
parent
fb82715ef7
commit
6fd2a3b2e5
5 changed files with 254 additions and 31 deletions
|
@ -1,6 +1,5 @@
|
|||
export { isOverScrollBars } from "./scrollbars";
|
||||
export {
|
||||
getSelectedIndices,
|
||||
deleteSelectedElements,
|
||||
isSomeElementSelected,
|
||||
getElementsWithinSelection,
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue