Update PointingShape.ts

pull/3225/head
Steve Ruiz 2024-03-20 12:37:14 +00:00
rodzic c28f11e4ba
commit a0ca46f98c
1 zmienionych plików z 8 dodań i 0 usunięć

Wyświetl plik

@ -5,6 +5,7 @@ import {
TLArrowShape,
TLEventHandlers,
TLGeoShape,
TLNoteShape,
TLPointerEventInfo,
TLShape,
} from '@tldraw/editor'
@ -28,6 +29,13 @@ export class PointingShape extends StateNode {
this.hitShape = info.shape
const outermostSelectingShape = this.editor.getOutermostSelectableShape(info.shape)
// Bring sticky notes to front on pointer down;
// consider changing the logic to "move to front of any overlapping shapes"
// rather than move to front of all shapes in the page / parent
if (this.editor.isShapeOfType<TLNoteShape>(info.shape, 'note')) {
this.editor.bringToFront([info.shape.id])
}
if (
// If the shape has an onClick handler
this.editor.getShapeUtil(info.shape).onClick ||