Fix group element removing (#1676)
This commit is contained in:
@ -1,6 +1,5 @@
|
||||
export { isOverScrollBars } from "./scrollbars";
|
||||
export {
|
||||
deleteSelectedElements,
|
||||
isSomeElementSelected,
|
||||
getElementsWithinSelection,
|
||||
getCommonAttributeOfSelectedElements,
|
||||
|
@ -4,7 +4,6 @@ import {
|
||||
} from "../element/types";
|
||||
import { getElementAbsoluteCoords, getElementBounds } from "../element";
|
||||
import { AppState } from "../types";
|
||||
import { newElementWith } from "../element/mutateElement";
|
||||
|
||||
export const getElementsWithinSelection = (
|
||||
elements: readonly NonDeletedExcalidrawElement[],
|
||||
@ -31,24 +30,6 @@ export const getElementsWithinSelection = (
|
||||
});
|
||||
};
|
||||
|
||||
export const deleteSelectedElements = (
|
||||
elements: readonly ExcalidrawElement[],
|
||||
appState: AppState,
|
||||
) => {
|
||||
return {
|
||||
elements: elements.map((el) => {
|
||||
if (appState.selectedElementIds[el.id]) {
|
||||
return newElementWith(el, { isDeleted: true });
|
||||
}
|
||||
return el;
|
||||
}),
|
||||
appState: {
|
||||
...appState,
|
||||
selectedElementIds: {},
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
export const isSomeElementSelected = (
|
||||
elements: readonly NonDeletedExcalidrawElement[],
|
||||
appState: AppState,
|
||||
|
Reference in New Issue
Block a user