mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-01-28 07:03:17 +08:00
Fix for text alignment issue
This commit is contained in:
parent
029a444d32
commit
99ee235e75
@ -36,6 +36,7 @@ async function addHtmlSpan(element, node, width, classes, addBackground = false)
|
||||
div.style('white-space', 'nowrap');
|
||||
div.style('line-height', '1.5');
|
||||
div.style('max-width', width + 'px');
|
||||
div.style('text-align', 'center');
|
||||
div.attr('xmlns', 'http://www.w3.org/1999/xhtml');
|
||||
if (addBackground) {
|
||||
div.attr('class', 'labelBkg');
|
||||
|
@ -62,13 +62,13 @@ export const rectWithTitle = async (parent: SVGElement, node: Node) => {
|
||||
)
|
||||
);
|
||||
|
||||
if (evaluate(getConfig()?.flowchart?.htmlLabels)) {
|
||||
const div = descr.children[0];
|
||||
const dv = select(descr);
|
||||
bbox = div.getBoundingClientRect();
|
||||
dv.attr('width', bbox.width);
|
||||
dv.attr('height', bbox.height);
|
||||
}
|
||||
//if (evaluate(getConfig()?.flowchart?.htmlLabels)) {
|
||||
const div = descr.children[0];
|
||||
const dv = select(descr);
|
||||
bbox = div.getBoundingClientRect();
|
||||
dv.attr('width', bbox.width);
|
||||
dv.attr('height', bbox.height);
|
||||
// }
|
||||
|
||||
const halfPadding = (node.padding || 0) / 2;
|
||||
select(descr).attr(
|
||||
|
Loading…
x
Reference in New Issue
Block a user