mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-26 09:19:43 +00:00
Support on slot click listeners in vue (#7059)
Adds support for the `node.onInputDblClick` and `node.onInputClick` callbacks in vue - Fixes vue link drop code so that a link which is not dropped on the canvas does not fallback to the dropped on canvas code.  Resolves #7037 ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-7059-Support-on-slot-click-listeners-in-vue-2bb6d73d3650812993fdef244e91683b) by [Unito](https://www.unito.io)
This commit is contained in:
13
src/renderer/extensions/vueNodes/utils/eventUtils.ts
Normal file
13
src/renderer/extensions/vueNodes/utils/eventUtils.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import type { LGraphCanvas } from '@/lib/litegraph/src/LGraphCanvas'
|
||||
import type { LGraphNode } from '@/lib/litegraph/src/LGraphNode'
|
||||
import type { CanvasPointerEvent } from '@/lib/litegraph/src/types/events'
|
||||
|
||||
export function augmentToCanvasPointerEvent(
|
||||
e: PointerEvent,
|
||||
node: LGraphNode,
|
||||
canvas: LGraphCanvas
|
||||
): asserts e is CanvasPointerEvent {
|
||||
canvas.adjustMouseEvent(e)
|
||||
canvas.graph_mouse[0] = e.offsetX + node.pos[0]
|
||||
canvas.graph_mouse[1] = e.offsetY + node.pos[1]
|
||||
}
|
||||
Reference in New Issue
Block a user