From 23d15207b0729a25a6828ead699b5c189b86ac18 Mon Sep 17 00:00:00 2001 From: Haoming Date: Mon, 11 Dec 2023 18:23:42 +0800 Subject: [PATCH] minor updates --- js/configs.js | 4 ++-- js/functions.js | 7 +++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/js/configs.js b/js/configs.js index 2f7dbe9..815a11b 100644 --- a/js/configs.js +++ b/js/configs.js @@ -1,10 +1,10 @@ // Round to the cloest multiples of this value export const GRID_SIZE = 10; -// NodeType, (Width, Height) +// "NodeType": [Width, Height] export const FIXED_SIZE = { - "CLIPTextEncode": [400.0, 160.0], + "CLIPTextEncode": [400.0, 150.0], "PreviewImage": [420.0, 420.0], }; diff --git a/js/functions.js b/js/functions.js index 239b4c4..44d84d7 100644 --- a/js/functions.js +++ b/js/functions.js @@ -11,10 +11,9 @@ export function Process(graph) { node["size"] = FIXED_SIZE[node["type"]]; } - ["pos", "size"].forEach((mode) => { - [0, 1].forEach((index) => { - node[mode][index] = round(node[mode][index]); - }); + ["pos", "size"].forEach((prop) => { + node[prop][0] = round(node[prop][0]); + node[prop][1] = round(node[prop][1]); }); });