feat: allow inner-drag-selecting with cmd/ctrl (#3603)

* feat: allow inner-drag-selecting with cmd/ctrl

* don't use  cursor when pressing cmd/ctrl

* ensure we reset deselected groups

* add tests

* add docs

* couple fixes around group selection
This commit is contained in:
David Luzar 2021-05-20 22:28:34 +02:00 committed by GitHub
parent f4e10c93e1
commit 6d40039f08
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 228 additions and 20 deletions

View file

@ -57,6 +57,7 @@ export class API {
width = 100,
height = width,
isDeleted = false,
groupIds = [],
...rest
}: {
type: T;
@ -66,6 +67,7 @@ export class API {
width?: number;
id?: string;
isDeleted?: boolean;
groupIds?: string[];
// generic element props
strokeColor?: ExcalidrawGenericElement["strokeColor"];
backgroundColor?: ExcalidrawGenericElement["backgroundColor"];
@ -152,6 +154,9 @@ export class API {
if (isDeleted) {
element.isDeleted = isDeleted;
}
if (groupIds) {
element.groupIds = groupIds;
}
return element as any;
};