From f1c2d0ef6a5f68d6ea9005b2a41661a10d00ecee Mon Sep 17 00:00:00 2001 From: Austin Mroz Date: Thu, 25 Sep 2025 11:00:19 -0500 Subject: [PATCH] Add promoted border to DOMWidgets --- src/scripts/domWidget.ts | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/scripts/domWidget.ts b/src/scripts/domWidget.ts index a94ddb2ac..4b08053d4 100644 --- a/src/scripts/domWidget.ts +++ b/src/scripts/domWidget.ts @@ -160,16 +160,24 @@ abstract class BaseDOMWidgetImpl widget_height: number, lowQuality?: boolean ): void { - if (this.options.hideOnZoom && lowQuality && this.isVisible()) { + if ( + (this.promoted || (this.options.hideOnZoom && lowQuality)) && + this.isVisible() + ) { // Draw a placeholder rectangle const originalFillStyle = ctx.fillStyle ctx.beginPath() ctx.fillStyle = LiteGraph.WIDGET_BGCOLOR + let margin = this.margin + if (this.promoted) { + ctx.fillStyle = LiteGraph.WIDGET_PROMOTED_OUTLINE_COLOR + margin -= 1 + } ctx.rect( - this.margin, - y + this.margin, - widget_width - this.margin * 2, - (this.computedHeight ?? widget_height) - 2 * this.margin + margin, + y + margin, + widget_width - margin * 2, + (this.computedHeight ?? widget_height) - 2 * margin ) ctx.fill() ctx.fillStyle = originalFillStyle