Skip to content

Commit

Permalink
add name only when present in rectData
Browse files Browse the repository at this point in the history
  • Loading branch information
ad1992 committed Feb 14, 2024
1 parent bee88ac commit 23dd7b2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/mermaid/src/diagrams/common/svgDrawCommon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ export const drawRect = (element: SVG | Group, rectData: RectData): D3RectElemen
rectElement.attr('stroke', rectData.stroke);
rectElement.attr('width', rectData.width);
rectElement.attr('height', rectData.height);
rectElement.attr('name', rectData.name);
if (rectData.name) {
rectElement.attr('name', rectData.name);
}
rectData.rx !== undefined && rectElement.attr('rx', rectData.rx);
rectData.ry !== undefined && rectElement.attr('ry', rectData.ry);

Expand Down

0 comments on commit 23dd7b2

Please sign in to comment.