MC-1730 Fix for subroutine shape

This commit is contained in:
Knut Sveidqvist
2024-08-06 15:03:19 +02:00
parent 992095d0f8
commit 41484b2272
2 changed files with 4 additions and 3 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "@mermaid-chart/mermaid",
"version": "11.0.0-b.58",
"version": "11.0.0-b.59",
"description": "Markdown-ish syntax for generating flowcharts, sequence diagrams, class diagrams, gantt charts and git graphs.",
"type": "module",
"module": "./dist/mermaid.core.mjs",

View File

@@ -65,6 +65,7 @@ export const subroutine = async (parent: SVGAElement, node: Node) => {
];
if (node.look === 'handdrawn' || (node.look === 'neo' && !useGradient)) {
console.log('OXE points 1', points);
// @ts-ignore - rough is not typed
const rc = rough.svg(shapeSvg);
const options = userNodeOverrides(node, {});
@@ -72,8 +73,6 @@ export const subroutine = async (parent: SVGAElement, node: Node) => {
if (node.look === 'neo') {
options.roughness = 0;
options.fillStyle = 'solid';
// options.stroke = 'none';
// options.strokeWidth = 0
}
const roughNode = rc.rectangle(x - 8, y, w + 16, h, options);
@@ -87,7 +86,9 @@ export const subroutine = async (parent: SVGAElement, node: Node) => {
let rect = shapeSvg.insert(() => roughNode, ':first-child');
const { cssStyles } = node;
rect.attr('class', 'basic label-container').attr('style', cssStyles);
updateNodeBounds(node, rect);
} else {
console.log('OXE points 2', points);
const el = insertPolygonShape(shapeSvg, w, h, points);
if (nodeStyles) {
el.attr('style', nodeStyles);