mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-25 08:49:36 +00:00
[TS] Use strict mode in CanvasPointer, measure, and polyfills (#617)
- Adds runtime type guard - Adds ts-ignore that must be removed later * [ ] #578
This commit is contained in:
@@ -2535,14 +2535,17 @@ export class LGraphCanvas implements ConnectionColorContext {
|
||||
const x = pos[0] - node.pos[0]
|
||||
const y = pos[1] - node.pos[1]
|
||||
|
||||
// @ts-ignore https://github.com/Comfy-Org/litegraph.js/issues/616
|
||||
const WidgetClass = WIDGET_TYPE_MAP[widget.type]
|
||||
if (WidgetClass) {
|
||||
const widgetInstance = toClass(WidgetClass, widget)
|
||||
// @ts-ignore https://github.com/Comfy-Org/litegraph.js/issues/616
|
||||
pointer.onClick = () => widgetInstance.onClick({
|
||||
e,
|
||||
node,
|
||||
canvas: this,
|
||||
})
|
||||
// @ts-ignore https://github.com/Comfy-Org/litegraph.js/issues/616
|
||||
pointer.onDrag = eMove => widgetInstance.onDrag?.({
|
||||
e: eMove,
|
||||
node,
|
||||
|
||||
Reference in New Issue
Block a user