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 authored and Vincent Lam committed Oct 24, 2023
1 parent 1058e86 commit a3bd4c4
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 @@ -866,8 +866,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 a3bd4c4

Please sign in to comment.