Skip to content

Commit 25a543a

Browse files
committed
Remove unnecessary patch
1 parent 657c574 commit 25a543a

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

packages/editor/src/lib/editor/Editor.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5330,18 +5330,17 @@ export class Editor extends EventEmitter<TLEventMap> {
53305330
}
53315331
}
53325332

5333-
if (this.isShapeFrame(shape)) {
5333+
if (this.isShapeOfType(shape, 'frame')) {
53345334
// On the rare case that we've hit a frame (not its label), test again hitInside to be forced true;
53355335
// this prevents clicks from passing through the body of a frame to shapes behind it.
53365336

53375337
// If the hit is within the frame's outer margin, then select the frame
53385338
const distance = geometry.distanceToPoint(pointInShapeSpace, hitFrameInside)
53395339
if (
5340-
(shape as any).type !== 'grid' &&
5341-
(hitFrameInside
5340+
hitFrameInside
53425341
? (distance > 0 && distance <= outerMargin) ||
53435342
(distance <= 0 && distance > -innerMargin)
5344-
: distance > 0 && distance <= outerMargin)
5343+
: distance > 0 && distance <= outerMargin
53455344
) {
53465345
return inMarginClosestToEdgeHit || shape
53475346
}
@@ -5356,7 +5355,7 @@ export class Editor extends EventEmitter<TLEventMap> {
53565355
return (
53575356
inMarginClosestToEdgeHit ||
53585357
inHollowSmallestAreaHit ||
5359-
(hitFrameInside || (shape as any).type === 'grid' ? shape : undefined)
5358+
(hitFrameInside ? shape : undefined)
53605359
)
53615360
}
53625361
continue

0 commit comments

Comments
 (0)