Fix collapsed regression in #114 (#126)

This commit is contained in:
filtered
2024-09-06 22:02:10 +10:00
committed by GitHub
parent 49944a0745
commit 009ef1c84b

View File

@@ -10111,6 +10111,7 @@ const globalExport = {};
title_height,
title_mode,
fgcolor,
collapsed: node.flags?.collapsed
}
);
}
@@ -10140,7 +10141,8 @@ const globalExport = {};
title_height = LiteGraph.NODE_TITLE_HEIGHT,
title_mode = LiteGraph.NORMAL_TITLE,
fgcolor = LiteGraph.NODE_BOX_OUTLINE_COLOR,
padding = 6
padding = 6,
collapsed = false
} = {}
) {
// Adjust area if title is transparent
@@ -10164,7 +10166,7 @@ const globalExport = {};
case LiteGraph.ROUND_SHAPE:
case LiteGraph.CARD_SHAPE: {
const radius = this.round_radius * 2;
const isCollapsed = shape === LiteGraph.CARD_SHAPE && node.flags.collapsed;
const isCollapsed = shape === LiteGraph.CARD_SHAPE && collapsed;
const cornerRadii = isCollapsed || shape === LiteGraph.ROUND_SHAPE ? [radius] : [radius, 2, radius, 2];
ctx.roundRect(x - padding, y - padding, width + 2 * padding, height + 2 * padding, cornerRadii);
break;