fix: badge drawer is overriding node.onDrawForeground

This commit is contained in:
dr.lt.data
2024-01-26 13:31:01 +09:00
parent 62c9c00b20
commit 86ecc194ac
2 changed files with 5 additions and 2 deletions

View File

@@ -1271,7 +1271,10 @@ app.registerExtension({
async nodeCreated(node, app) {
if(!node.badge_enabled) {
node.getNickname = function () { return getNickname(node, node.comfyClass.trim()) };
const orig = node.__proto__.onDrawForeground;
let orig = node.onDrawForeground;
if(!orig)
orig = node.__proto__.onDrawForeground;
node.onDrawForeground = function (ctx) {
drawBadge(node, orig, arguments)
};