Browse Source

fix: badge drawer is overriding node.onDrawForeground

pull/365/head
dr.lt.data 10 months ago
parent
commit
86ecc194ac
  1. 2
      __init__.py
  2. 5
      js/comfyui-manager.js

2
__init__.py

@ -29,7 +29,7 @@ except:
print(f"[WARN] ComfyUI-Manager: Your ComfyUI version is outdated. Please update to the latest version.") print(f"[WARN] ComfyUI-Manager: Your ComfyUI version is outdated. Please update to the latest version.")
version = [2, 3, 1] version = [2, 3, 2]
version_str = f"V{version[0]}.{version[1]}" + (f'.{version[2]}' if len(version) > 2 else '') version_str = f"V{version[0]}.{version[1]}" + (f'.{version[2]}' if len(version) > 2 else '')
print(f"### Loading: ComfyUI-Manager ({version_str})") print(f"### Loading: ComfyUI-Manager ({version_str})")

5
js/comfyui-manager.js vendored

@ -1271,7 +1271,10 @@ app.registerExtension({
async nodeCreated(node, app) { async nodeCreated(node, app) {
if(!node.badge_enabled) { if(!node.badge_enabled) {
node.getNickname = function () { return getNickname(node, node.comfyClass.trim()) }; 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) { node.onDrawForeground = function (ctx) {
drawBadge(node, orig, arguments) drawBadge(node, orig, arguments)
}; };

Loading…
Cancel
Save