minor updates

This commit is contained in:
Haoming
2023-12-11 18:23:42 +08:00
parent 0feed60d6e
commit 23d15207b0
2 changed files with 5 additions and 6 deletions
+2 -2
View File
@@ -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],
};
+3 -4
View File
@@ -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]);
});
});