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