mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
feat: add pasted elements to frame under cursor (#7590)
This commit is contained in:
parent
46da032626
commit
1e7df58b5b
4 changed files with 56 additions and 2 deletions
|
@ -3099,12 +3099,18 @@ class App extends React.Component<AppProps, AppState> {
|
|||
},
|
||||
);
|
||||
|
||||
const nextElements = [
|
||||
const allElements = [
|
||||
...this.scene.getElementsIncludingDeleted(),
|
||||
...newElements,
|
||||
];
|
||||
|
||||
this.scene.replaceAllElements(nextElements);
|
||||
const topLayerFrame = this.getTopLayerFrameAtSceneCoords({ x, y });
|
||||
|
||||
if (topLayerFrame) {
|
||||
addElementsToFrame(allElements, newElements, topLayerFrame);
|
||||
}
|
||||
|
||||
this.scene.replaceAllElements(allElements);
|
||||
|
||||
newElements.forEach((newElement) => {
|
||||
if (isTextElement(newElement) && isBoundToContainer(newElement)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue