Line data Source code
1 : import type { LGraphCanvas } from '@/lib/litegraph/src/LGraphCanvas'
2 : import type { LGraphNode } from '@/lib/litegraph/src/LGraphNode'
3 : import type { CanvasPointerEvent } from '@comfyorg/graph-model/events'
4 :
5 36 : export function augmentToCanvasPointerEvent(
6 : e: PointerEvent,
7 : node: LGraphNode,
8 : canvas: LGraphCanvas
9 : ): asserts e is CanvasPointerEvent {
10 36 : canvas.adjustMouseEvent(e)
11 36 : canvas.graph_mouse[0] = e.offsetX + node.pos[0]
12 36 : canvas.graph_mouse[1] = e.offsetY + node.pos[1]
13 : }
|