Add CanvasPointer callback for node widgets (#363)

* Add CanvasPointer callback for node widgets

* Add API documentation

* nit - Docs
This commit is contained in:
filtered
2024-12-02 12:31:48 +11:00
committed by GitHub
parent a0b50dcf15
commit 8cda1ac48a
4 changed files with 228 additions and 1 deletions

View File

@@ -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