diff --git a/packages/tldraw/src/lib/Tldraw.tsx b/packages/tldraw/src/lib/Tldraw.tsx index bc93feb6f..fac1307bb 100644 --- a/packages/tldraw/src/lib/Tldraw.tsx +++ b/packages/tldraw/src/lib/Tldraw.tsx @@ -5,12 +5,14 @@ import { LoadingScreen, StoreSnapshot, TLEditorComponents, + TLNoteShape, TLOnMountHandler, TLRecord, TLStore, TLStoreWithStatus, TldrawEditor, TldrawEditorBaseProps, + createShapeId, stopEventPropagation, track, useEditor, @@ -242,6 +244,7 @@ const NoteDuplicationHandles = track(() => { if (shapes.length === 0) return null if (shapes.length > 1) return null if (shapes[0].type !== 'note') return null + if (editor.isIn('note.dragging')) return null return (
{ }} onPointerDown={stopEventPropagation} > - - + + - +
) }) @@ -270,11 +293,20 @@ function DuplicateInDirectionButton({ x, y, rotation, + shape, + direction, }: { x: number y: number rotation: number + shape: TLNoteShape + direction: 'above' | 'below' | 'left' | 'right' }) { + const editor = useEditor() + + const offsetX = direction === 'left' ? -230 : direction === 'right' ? 230 : 0 + const offsetY = direction === 'above' ? -230 : direction === 'below' ? 230 : 0 + return (