fixed title bounds calculation, removed extra title from merging issues

This commit is contained in:
itsalam 2023-09-19 10:40:14 -07:00 committed by Vincent Lam
parent 5e966d60b0
commit 55fac29b3e
2 changed files with 1 additions and 3 deletions

View File

@ -866,8 +866,6 @@ export const draw = async function (text, id, _version, diagObj) {
const doc = securityLevel === 'sandbox' ? sandboxElement.nodes()[0].contentDocument : document; const doc = securityLevel === 'sandbox' ? sandboxElement.nodes()[0].contentDocument : document;
const svg = root.select(`[id="${id}"]`); const svg = root.select(`[id="${id}"]`);
utils.insertTitle(svg, 'flowchartTitleText', conf.titleTopMargin, diagObj.db.getDiagramTitle());
// Define the supported markers for the diagram // Define the supported markers for the diagram
const markers = ['point', 'circle', 'cross']; const markers = ['point', 'circle', 'cross'];

View File

@ -829,7 +829,7 @@ export const insertTitle = (
parent parent
.append('text') .append('text')
.text(title) .text(title)
.attr('x', '50%') .attr('x', bounds.x + bounds.width / 2)
.attr('y', -titleTopMargin) .attr('y', -titleTopMargin)
.attr('class', cssClass); .attr('class', cssClass);
}; };