Add fixed scale for ComfyUI zoom

This commit is contained in:
Jordan Thompson
2025-12-30 19:09:27 -08:00
parent e2c9a1bad2
commit f886b1b117
2 changed files with 7 additions and 5 deletions
+1 -1
View File
@@ -9,7 +9,7 @@ class ComfyRetroArchPlayer:
RETURN_TYPES = ()
OUTPUT_NODE = True
FUNCTION = "run"
CATEGORY = "fun"
CATEGORY = "WAS/Play"
def run(self):
return ()
+6 -4
View File
@@ -93,7 +93,7 @@ function getContainer() {
el.style.width = "0";
el.style.height = "0";
el.style.pointerEvents = "none";
el.style.zIndex = "1000";
el.style.zIndex = "100";
document.body.appendChild(el);
STATE.container = el;
return el;
@@ -110,7 +110,7 @@ function ensureIframeForNode(node) {
const iframe = document.createElement("iframe");
iframe.setAttribute(
"sandbox",
"allow-scripts allow-same-origin allow-forms allow-popups allow-downloads allow-pointer-lock"
"allow-scripts allow-forms allow-popups allow-downloads allow-pointer-lock"
);
iframe.style.position = "absolute";
iframe.style.border = "0";
@@ -183,8 +183,10 @@ function updateIframeRect(node, iframe) {
iframe.style.left = `${Math.round(nx)}px`;
iframe.style.top = `${Math.round(ny)}px`;
iframe.style.width = `${Math.max(0, Math.round(nw))}px`;
iframe.style.height = `${Math.max(0, Math.round(nh))}px`;
iframe.style.width = `${Math.max(0, Math.round(nw / scale))}px`;
iframe.style.height = `${Math.max(0, Math.round(nh / scale))}px`;
iframe.style.transform = `scale(${scale})`;
iframe.style.transformOrigin = 'top left';
const isCollapsed = !!node.flags?.collapsed;
const hasArea = nw >= 2 && nh >= 2;