From 5a321de29069e9e2434632e9872deda2bf98120a Mon Sep 17 00:00:00 2001 From: Palazzini Luca Date: Thu, 12 Sep 2024 16:58:32 +0200 Subject: [PATCH] Fix canvas position --- web/visual_area_prompt.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/web/visual_area_prompt.js b/web/visual_area_prompt.js index 33a4840..03954b4 100644 --- a/web/visual_area_prompt.js +++ b/web/visual_area_prompt.js @@ -20,7 +20,7 @@ function computeCanvasSize(node, size) { let widgetTotalHeight = 0; // Calculate total height for all non-custom widgets for (const widget of node.widgets) { - if (widget.type !== "customCanvas") { + if (widget.type !== "areaCondCanvas") { widgetTotalHeight += (widget.computeSize ? widget.computeSize()[1] : widgetBaseHeight) + 5; } } @@ -35,7 +35,7 @@ function computeCanvasSize(node, size) { let currentY = yBase; for (const widget of node.widgets) { widget.y = currentY; - currentY += (widget.type === "customCanvas" ? remainingHeight : (widget.computeSize ? widget.computeSize()[1] : widgetBaseHeight)) + 4; + currentY += (widget.type === "areaCondCanvas" ? remainingHeight : (widget.computeSize ? widget.computeSize()[1] : widgetBaseHeight)) + 4; } node.canvasHeight = remainingHeight; } @@ -73,8 +73,7 @@ function addAreaGraphWidget(node) { } let yOffset = margin if (backgroundHeight < widgetHeight) { - // Added 170 due to the other widgets being in the way - yOffset += ((widgetHeight - backgroundHeight) / 2 - margin) + 170; + yOffset += (widgetHeight - backgroundHeight) / 2 - margin; } const getDrawArea = (v) => { let x = v[0] * backgroudWidth