From 3321f6472f48b310ebda19d3a59e5c6284da2b67 Mon Sep 17 00:00:00 2001 From: Knut Sveidqvist Date: Tue, 6 Aug 2024 14:29:33 +0200 Subject: [PATCH] Adding subroutine fill --- .../rendering-elements/shapes/subroutine.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/mermaid/src/rendering-util/rendering-elements/shapes/subroutine.ts b/packages/mermaid/src/rendering-util/rendering-elements/shapes/subroutine.ts index 035faa8f0..6f9363073 100644 --- a/packages/mermaid/src/rendering-util/rendering-elements/shapes/subroutine.ts +++ b/packages/mermaid/src/rendering-util/rendering-elements/shapes/subroutine.ts @@ -76,7 +76,7 @@ export const subroutine = async (parent: SVGAElement, node: Node) => { // options.strokeWidth = 0 } - rc.rectangle(x - 8, y, w + 16, h, options); + const roughNode = rc.rectangle(x - 8, y, w + 16, h, options); const l1 = rc.line(x, y, x, y + h, options); const l2 = rc.line(x + w, y, x + w, y + h, options); @@ -84,9 +84,9 @@ export const subroutine = async (parent: SVGAElement, node: Node) => { const l2El = shapeSvg.insert(() => l2, ':first-child'); l1El.attr('class', 'neo-line'); l2El.attr('class', 'neo-line'); - // rect = shapeSvg.insert(() => roughNode, ':first-child'); - - // rect.attr('class', 'basic label-container').attr('style', cssStyles); + let rect = shapeSvg.insert(() => roughNode, ':first-child'); + const { cssStyles } = node; + rect.attr('class', 'basic label-container').attr('style', cssStyles); } else { const el = insertPolygonShape(shapeSvg, w, h, points); if (nodeStyles) {