mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-08 17:10:07 +00:00
Support Right Click -> Save for animated webp (#6095)
Allow for Right Click -> Save Image to work for the "SaveAnimatedWEBP" node. Fixing this revealed other existing issues: - Attempting to resize the node causes runaway scaling - Right clicking on the image directly causes a browser context menu without a save option. Significant rewriting has been performed to resolve both of these issues. ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-6095-Support-Right-Click-Save-for-animated-webp-28e6d73d3650818e85a2ec58c38c2aae) by [Unito](https://www.unito.io)
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import type { LGraphNode } from '@/lib/litegraph/src/LGraphNode'
|
||||
|
||||
import { app } from '../app'
|
||||
import { $el } from '../ui'
|
||||
|
||||
@@ -48,8 +50,8 @@ export function calculateImageGrid(
|
||||
return { cellWidth, cellHeight, cols, rows, shiftX }
|
||||
}
|
||||
|
||||
// @ts-expect-error fixme ts strict error
|
||||
export function createImageHost(node) {
|
||||
/** @knipIgnoreUnusedButUsedByCustomNodes */
|
||||
export function createImageHost(node: LGraphNode) {
|
||||
const el = $el('div.comfy-img-preview')
|
||||
// @ts-expect-error fixme ts strict error
|
||||
let currentImgs
|
||||
@@ -108,8 +110,8 @@ export function createImageHost(node) {
|
||||
}
|
||||
el.replaceChildren(...imgs)
|
||||
currentImgs = imgs
|
||||
node.onResize(node.size)
|
||||
node.graph.setDirtyCanvas(true, true)
|
||||
node.onResize?.(node.size)
|
||||
node.graph?.setDirtyCanvas(true, true)
|
||||
}
|
||||
},
|
||||
getHeight() {
|
||||
|
||||
Reference in New Issue
Block a user