mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
fix: filter out elements not overlapping frame on paste (#7591)
This commit is contained in:
parent
4997624a3a
commit
740a165452
3 changed files with 198 additions and 7 deletions
|
@ -349,6 +349,7 @@ import {
|
|||
isElementInFrame,
|
||||
getFrameLikeTitle,
|
||||
getElementsOverlappingFrame,
|
||||
filterElementsEligibleAsFrameChildren,
|
||||
} from "../frame";
|
||||
import {
|
||||
excludeElementsInFramesFromSelection,
|
||||
|
@ -3107,7 +3108,11 @@ class App extends React.Component<AppProps, AppState> {
|
|||
const topLayerFrame = this.getTopLayerFrameAtSceneCoords({ x, y });
|
||||
|
||||
if (topLayerFrame) {
|
||||
addElementsToFrame(allElements, newElements, topLayerFrame);
|
||||
const eligibleElements = filterElementsEligibleAsFrameChildren(
|
||||
newElements,
|
||||
topLayerFrame,
|
||||
);
|
||||
addElementsToFrame(allElements, eligibleElements, topLayerFrame);
|
||||
}
|
||||
|
||||
this.scene.replaceAllElements(allElements);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue