mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
Fix group element removing (#1676)
This commit is contained in:
parent
17e9cc4506
commit
f413bab3de
11 changed files with 478 additions and 43 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue