Skip to content

Commit

Permalink
fixed title bounds calculation, removed extra title from merging issues
Browse files Browse the repository at this point in the history
  • Loading branch information
itsalam committed Sep 19, 2023
1 parent e7e91a6 commit 2503929
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -860,8 +860,6 @@ export const draw = async function (text, id, _version, diagObj) {
const doc = securityLevel === 'sandbox' ? sandboxElement.nodes()[0].contentDocument : document;

const svg = root.select(`[id="${id}"]`);

utils.insertTitle(svg, 'flowchartTitleText', conf.titleTopMargin, diagObj.db.getDiagramTitle());
// Define the supported markers for the diagram
const markers = ['point', 'circle', 'cross'];

Expand Down
2 changes: 1 addition & 1 deletion packages/mermaid/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -829,7 +829,7 @@ export const insertTitle = (
parent
.append('text')
.text(title)
.attr('x', '50%')
.attr('x', bounds.x + bounds.width / 2)
.attr('y', -titleTopMargin)
.attr('class', cssClass);
};
Expand Down

0 comments on commit 2503929

Please sign in to comment.