Fix group element removing (#1676)

This commit is contained in:
David Luzar 2020-05-30 22:48:57 +02:00 committed by GitHub
parent 17e9cc4506
commit f413bab3de
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 478 additions and 43 deletions

View file

@ -12,6 +12,7 @@ import { measureText, getFontString } from "../utils";
import { randomInteger, randomId } from "../random";
import { newElementWith } from "./mutateElement";
import { getNewGroupIdsForDuplication } from "../groups";
import { AppState } from "../types";
type ElementConstructorOpts = {
x: ExcalidrawGenericElement["x"];
@ -169,7 +170,7 @@ export const deepCopyElement = (val: any, depth: number = 0) => {
* @param overrides Any element properties to override
*/
export const duplicateElement = <TElement extends Mutable<ExcalidrawElement>>(
editingGroupId: GroupId | null,
editingGroupId: AppState["editingGroupId"],
groupIdMapForOperation: Map<GroupId, GroupId>,
element: TElement,
overrides?: Partial<TElement>,