Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Group2d, StateNode, TLPointerEventInfo, TLShape } from '@tldraw/editor'
import { StateNode, TLPointerEventInfo, TLShape } from '@tldraw/editor'
import { isOverArrowLabel } from '../../../shapes/arrow/arrowLabel'
import { getTextLabels } from '../../../utils/shapes/shapes'

Expand All @@ -11,7 +11,6 @@ export class PointingShape extends StateNode {

didCtrlOnEnter = false
didSelectOnEnter = false
didHitGridLabel = false

override onEnter(info: TLPointerEventInfo & { target: 'shape' }) {
const selectedShapeIds = this.editor.getSelectedShapeIds()
Expand All @@ -23,19 +22,6 @@ export class PointingShape extends StateNode {
this.hitShape = info.shape
this.isDoubleClick = false
this.didCtrlOnEnter = accelKey
this.didHitGridLabel = false
if ((info.shape as any).type === 'grid') {
const geometry = this.editor.getShapeGeometry(info.shape)
if (geometry instanceof Group2d) {
const pointInShapeSpace = this.editor.getPointInShapeSpace(info.shape, currentPagePoint)
for (const child of geometry.children) {
if (child.isLabel && child.isPointInBounds(pointInShapeSpace)) {
this.didHitGridLabel = true
break
}
}
}
}
const outermostSelectingShape = this.editor.getOutermostSelectableShape(info.shape)
const selectedAncestor = this.editor.findShapeAncestor(outermostSelectingShape, (parent) =>
selectedShapeIds.includes(parent.id)
Expand Down
Loading