mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-03-10 23:50:00 +00:00
Hint for empty canvas when invoking Comfy.Canvas.FitView (#1826)
This commit is contained in:
@@ -231,7 +231,17 @@ export function useCoreCommands(): ComfyCommand[] {
|
||||
id: 'Comfy.Canvas.FitView',
|
||||
icon: 'pi pi-expand',
|
||||
label: 'Fit view to selected nodes',
|
||||
function: () => app.canvas.fitViewToSelectionAnimated()
|
||||
function: () => {
|
||||
if (app.canvas.empty) {
|
||||
useToastStore().add({
|
||||
severity: 'error',
|
||||
summary: 'Empty canvas',
|
||||
life: 3000
|
||||
})
|
||||
return
|
||||
}
|
||||
app.canvas.fitViewToSelectionAnimated()
|
||||
}
|
||||
},
|
||||
{
|
||||
id: 'Comfy.Canvas.ToggleLock',
|
||||
|
||||
Reference in New Issue
Block a user