revert: remove bound-arrows from frames (#7190)

This commit is contained in:
David Luzar 2023-10-25 10:39:19 +02:00 committed by GitHub
parent 71ad3c5356
commit 104f64f1dc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 16 additions and 81 deletions

View file

@ -2554,12 +2554,18 @@ class App extends React.Component<AppProps, AppState> {
const lineHeight = getDefaultLineHeight(textElementProps.fontFamily);
if (text.length) {
const topLayerFrame = this.getTopLayerFrameAtSceneCoords({
x,
y: currentY,
});
const element = newTextElement({
...textElementProps,
x,
y: currentY,
text,
lineHeight,
frameId: topLayerFrame ? topLayerFrame.id : null,
});
acc.push(element);
currentY += element.height + LINE_GAP;
@ -3574,11 +3580,6 @@ class App extends React.Component<AppProps, AppState> {
return getElementsAtPosition(elements, (element) =>
hitTest(element, this.state, this.frameNameBoundsCache, x, y),
).filter((element) => {
// arrows don't clip even if they're children of frames,
// so always allow hitbox regardless of beinging contained in frame
if (isArrowElement(element)) {
return true;
}
// hitting a frame's element from outside the frame is not considered a hit
const containingFrame = getContainingFrame(element);
return containingFrame &&