mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2025-06-13 15:02:09 +08:00
Allow any node to draw images
This commit is contained in:
parent
1ee35fd909
commit
a8315a6fb8
@ -123,8 +123,9 @@ class ComfyApp {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (this.imgs) {
|
if (this.imgs && this.imgs.length) {
|
||||||
const canvas = graph.list_of_graphcanvas[0];
|
const canvas = graph.list_of_graphcanvas[0];
|
||||||
const mouse = canvas.graph_mouse;
|
const mouse = canvas.graph_mouse;
|
||||||
if (!canvas.pointer_is_down && this.pointerDown) {
|
if (!canvas.pointer_is_down && this.pointerDown) {
|
||||||
@ -226,14 +227,7 @@ class ComfyApp {
|
|||||||
ctx.drawImage(this.imgs[imageIndex], x, y, w, h);
|
ctx.drawImage(this.imgs[imageIndex], x, y, w, h);
|
||||||
|
|
||||||
const drawButton = (x, y, sz, text) => {
|
const drawButton = (x, y, sz, text) => {
|
||||||
const hovered = LiteGraph.isInsideRectangle(
|
const hovered = LiteGraph.isInsideRectangle(mouse[0], mouse[1], x + this.pos[0], y + this.pos[1], sz, sz);
|
||||||
mouse[0],
|
|
||||||
mouse[1],
|
|
||||||
x + this.pos[0],
|
|
||||||
y + this.pos[1],
|
|
||||||
sz,
|
|
||||||
sz
|
|
||||||
);
|
|
||||||
let fill = "#333";
|
let fill = "#333";
|
||||||
let textFill = "#fff";
|
let textFill = "#fff";
|
||||||
let isClicking = false;
|
let isClicking = false;
|
||||||
@ -279,7 +273,6 @@ class ComfyApp {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user