Fix crash due to latest comfyui changes

This commit is contained in:
pythongosssss
2023-05-23 20:43:47 +01:00
committed by GitHub
parent 387d4f7cb4
commit 32bc07da8e
+6 -2
View File
@@ -67,8 +67,8 @@ app.registerExtension({
ctx.resetTransform();
const style = document.defaultView.getComputedStyle(this.inputEl, null);
const x = parseInt(this.inputEl.style.left);
const y = parseInt(this.inputEl.style.top);
const x = parseInt(this.inputEl.style.left) + 10;
const y = parseInt(this.inputEl.style.top) + LiteGraph.NODE_TITLE_HEIGHT;
const w = parseInt(this.inputEl.style.width);
const h = parseInt(this.inputEl.style.height);
ctx.fillStyle = style.getPropertyValue("background-color");
@@ -118,6 +118,10 @@ app.registerExtension({
const svgCtx = new C2S(bounds[2] - bounds[0], bounds[3] - bounds[1]);
svgCtx.canvas.getBoundingClientRect = function () {
return { width: svgCtx.width, height: svgCtx.height };
};
// Override the c2s handling of images to draw images as canvases
const drawImage = svgCtx.drawImage;
svgCtx.drawImage = function (...args) {