mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-24 16:29:45 +00:00
Add CanvasPointer callback for node widgets (#363)
* Add CanvasPointer callback for node widgets * Add API documentation * nit - Docs
This commit is contained in:
@@ -2517,6 +2517,13 @@ export class LGraphCanvas {
|
||||
|
||||
#processWidgetClick(e: CanvasPointerEvent, node: LGraphNode, widget: IWidget) {
|
||||
const { pointer } = this
|
||||
|
||||
// Custom widget - CanvasPointer
|
||||
if (typeof widget.onPointerDown === "function") {
|
||||
const handled = widget.onPointerDown(pointer, node, this)
|
||||
if (handled) return
|
||||
}
|
||||
|
||||
const width = widget.width || node.width
|
||||
|
||||
const oldValue = widget.value
|
||||
|
||||
Reference in New Issue
Block a user