fix: exporting frame-overlapping elements belonging to other frames (#7584)

This commit is contained in:
David Luzar 2024-01-19 14:41:22 +01:00 committed by GitHub
parent 3b0593baa7
commit 46da032626
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 92 additions and 19 deletions

View file

@ -348,6 +348,7 @@ import {
updateFrameMembershipOfSelectedElements,
isElementInFrame,
getFrameLikeTitle,
getElementsOverlappingFrame,
} from "../frame";
import {
excludeElementsInFramesFromSelection,
@ -395,7 +396,7 @@ import {
import { Emitter } from "../emitter";
import { ElementCanvasButtons } from "../element/ElementCanvasButtons";
import { MagicCacheData, diagramToHTML } from "../data/magic";
import { elementsOverlappingBBox, exportToBlob } from "../../utils/export";
import { exportToBlob } from "../../utils/export";
import { COLOR_PALETTE } from "../colors";
import { ElementCanvasButton } from "./MagicButton";
import { MagicIcon, copyIcon, fullscreenIcon } from "./icons";
@ -1803,11 +1804,10 @@ class App extends React.Component<AppProps, AppState> {
return;
}
const magicFrameChildren = elementsOverlappingBBox({
elements: this.scene.getNonDeletedElements(),
bounds: magicFrame,
type: "overlap",
}).filter((el) => !isMagicFrameElement(el));
const magicFrameChildren = getElementsOverlappingFrame(
this.scene.getNonDeletedElements(),
magicFrame,
).filter((el) => !isMagicFrameElement(el));
if (!magicFrameChildren.length) {
if (source === "button") {