Center element on paste (#248)

* Center element on paste

* paste on cursor position

* correctly center elements

* rename vars
This commit is contained in:
Faustino Kialungila 2020-01-09 12:34:46 +01:00 committed by GitHub
parent a73e4e28aa
commit 1ea72e9134
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 75 additions and 29 deletions

View file

@ -22,9 +22,7 @@ export const hasStroke = (elements: ExcalidrawElement[]) =>
);
export const hasText = (elements: ExcalidrawElement[]) =>
elements.some(
element => element.isSelected && element.type === "text"
);
elements.some(element => element.isSelected && element.type === "text");
export function getElementAtPosition(
elements: ExcalidrawElement[],