From 00de6ae960f6299bc08349a6a3645716281a6453 Mon Sep 17 00:00:00 2001 From: Chenlei Hu Date: Mon, 3 Feb 2025 09:42:27 -0800 Subject: [PATCH] Fix LGraphNode.height (#438) * Fix LGraphNode.height * nit --- src/LGraphNode.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/LGraphNode.ts b/src/LGraphNode.ts index 457297e7ea..6a748bf84d 100644 --- a/src/LGraphNode.ts +++ b/src/LGraphNode.ts @@ -2725,9 +2725,12 @@ export class LGraphNode implements Positionable, IPinnable { : this.size[0] } + /** + * Returns the height of the node, including the title bar. + */ get height() { - // @ts-expect-error Not impl. - return this.collapsed ? LiteGraph.NODE_COLLAPSED_HEIGHT : this.size[1] + const bodyHeight = this.collapsed ? 0 : this.size[1] + return LiteGraph.NODE_TITLE_HEIGHT + bodyHeight } drawBadges(ctx: CanvasRenderingContext2D, { gap = 2 } = {}): void {