Resize handler detection should not be active when moving multip… (#767)

* Fix bug.

* Implement `getSelectedElements`.

* Explicit condition.

* Respect variable naming.

* Keep state consistent.

* Use `isSomeElementSelected` abstraction.

* Missing ones.
This commit is contained in:
Enzo Ferey 2020-02-16 22:54:50 +01:00 committed by GitHub
parent ad72946131
commit 6ebd41734f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 53 additions and 37 deletions

View file

@ -1,4 +1,5 @@
import { ExcalidrawElement } from "./element/types";
import { getSelectedElements } from "./scene";
let CLIPBOARD = "";
let PREFER_APP_CLIPBOARD = false;
@ -19,9 +20,7 @@ export async function copyToAppClipboard(
elements: readonly ExcalidrawElement[],
) {
CLIPBOARD = JSON.stringify(
elements
.filter(element => element.isSelected)
.map(({ shape, ...el }) => el),
getSelectedElements(elements).map(({ shape, ...el }) => el),
);
try {
// when copying to in-app clipboard, clear system clipboard so that if