fix default to hand tool
This commit is contained in:
parent
7f497ae8d8
commit
949062941f
|
|
@ -95,6 +95,7 @@ export function Board() {
|
|||
onSelect: () => {
|
||||
if (editor.getSelectedShapeIds().length > 0) {
|
||||
zoomToSelection(editor);
|
||||
editor.setCurrentTool('hand');
|
||||
}
|
||||
},
|
||||
readonlyOk: true,
|
||||
|
|
@ -110,6 +111,7 @@ export function Board() {
|
|||
url.searchParams.set('y', camera.y.toString());
|
||||
url.searchParams.set('zoom', camera.z.toString());
|
||||
navigator.clipboard.writeText(url.toString());
|
||||
editor.setCurrentTool('hand');
|
||||
},
|
||||
readonlyOk: true,
|
||||
},
|
||||
|
|
@ -119,6 +121,7 @@ export function Board() {
|
|||
kbd: 'b',
|
||||
onSelect: () => {
|
||||
revertCamera();
|
||||
editor.setCurrentTool('hand');
|
||||
},
|
||||
readonlyOk: true,
|
||||
},
|
||||
|
|
|
|||
|
|
@ -310,8 +310,9 @@ export const uiOverrides: TLUiOverrides = {
|
|||
label: 'Revert Camera',
|
||||
kbd: 'b',
|
||||
onSelect: () => {
|
||||
console.log('Reverting camera position');
|
||||
revertCamera(editor);
|
||||
if (cameraHistory.length > 0) {
|
||||
revertCamera(editor);
|
||||
}
|
||||
},
|
||||
readonlyOk: true,
|
||||
}
|
||||
|
|
@ -387,8 +388,11 @@ export const components: TLComponents = {
|
|||
label="Revert Camera"
|
||||
icon="undo"
|
||||
kbd="b"
|
||||
disabled={!hasCameraHistory}
|
||||
onSelect={() => revertCamera(editor)}
|
||||
onSelect={() => {
|
||||
if (hasCameraHistory) {
|
||||
revertCamera(editor);
|
||||
}
|
||||
}}
|
||||
/>
|
||||
|
||||
{/* Shape Creation Tools */}
|
||||
|
|
@ -419,25 +423,6 @@ export const components: TLComponents = {
|
|||
editor.setCurrentTool('Embed');
|
||||
}}
|
||||
/>
|
||||
|
||||
Frame-specific actions
|
||||
{isFrame && (
|
||||
<>
|
||||
<TldrawUiMenuItem
|
||||
id="copy-frame-link"
|
||||
label="Copy Frame Link"
|
||||
icon="link"
|
||||
onSelect={() => copyFrameLink(editor, selectedShape.id)}
|
||||
/>
|
||||
<TldrawUiMenuItem
|
||||
id="zoom-to-frame"
|
||||
label="Zoom to Frame"
|
||||
icon="zoom-in"
|
||||
onSelect={() => zoomToSelection(editor)}
|
||||
/>
|
||||
</>
|
||||
)}
|
||||
|
||||
</DefaultContextMenu>
|
||||
)
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in New Issue