mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-21 23:09:39 +00:00
Add Fit Group to Contents keybind (#1658)
* Add Fit Group to Nodes keyboard command Fits all selected groups. * nit - Rename * Move to commandStore & Playwright test * nit * nit * Update test expectations [skip ci] --------- Co-authored-by: huchenlei <huchenlei@proton.me> Co-authored-by: github-actions <github-actions@github.com>
This commit is contained in:
@@ -493,6 +493,24 @@ export const useCommandStore = defineStore('command', () => {
|
||||
function: () => {
|
||||
useWorkspaceStore().toggleFocusMode()
|
||||
}
|
||||
},
|
||||
{
|
||||
id: 'Comfy.Graph.FitGroupToContents',
|
||||
icon: 'pi pi-expand',
|
||||
label: 'Fit Group To Contents',
|
||||
versionAdded: '1.4.9',
|
||||
function: () => {
|
||||
for (const group of app.canvas.selectedItems) {
|
||||
if (group instanceof LGraphGroup) {
|
||||
group.recomputeInsideNodes()
|
||||
const padding = useSettingStore().get(
|
||||
'Comfy.GroupSelectedNodes.Padding'
|
||||
)
|
||||
group.resizeTo(group.children, padding)
|
||||
app.graph.change()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user