mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-18 06:49:47 +02:00
fix for label positioning for brace-l & brace-r shapes
This commit is contained in:
@@ -112,10 +112,11 @@ export const curlyBraceLeft = async (parent: SVGAElement, node: Node) => {
|
||||
|
||||
curlyBraceLeftShape.attr('transform', `translate(${radius}, 0)`);
|
||||
|
||||
label.attr(
|
||||
'transform',
|
||||
`translate(${-w / 2 + radius - (bbox.x - (bbox.left ?? 0))},${-paddingY / 2 - (bbox.y - (bbox.top ?? 0))})`
|
||||
);
|
||||
label.attr('transform', `translate(${-bbox.width / 2}, ${-bbox.height / 2})`);
|
||||
// label.attr(
|
||||
// 'transform',
|
||||
// `translate(${-w / 2 + radius - (bbox.x - (bbox.left ?? 0))},${-paddingY / 2 - (bbox.y - (bbox.top ?? 0))})`
|
||||
// );
|
||||
|
||||
updateNodeBounds(node, curlyBraceLeftShape);
|
||||
|
||||
|
@@ -115,10 +115,12 @@ export const curlyBraceRight = async (parent: SVGAElement, node: Node) => {
|
||||
|
||||
curlyBraceRightShape.attr('transform', `translate(${-radius}, 0)`);
|
||||
|
||||
label.attr(
|
||||
'transform',
|
||||
`translate(${-w / 2 + labelPaddingX / 2 - (bbox.x - (bbox.left ?? 0))},${-(labelPaddingY / 2) - (bbox.y - (bbox.top ?? 0))})`
|
||||
);
|
||||
label.attr('transform', `translate(${-bbox.width / 2}, ${-bbox.height / 2})`);
|
||||
|
||||
// label.attr(
|
||||
// 'transform',
|
||||
// `translate(${-w / 2 + labelPaddingX / 2 - (bbox.x - (bbox.left ?? 0))},${-(labelPaddingY / 2) - (bbox.y - (bbox.top ?? 0))})`
|
||||
// );
|
||||
|
||||
updateNodeBounds(node, curlyBraceRightShape);
|
||||
|
||||
|
Reference in New Issue
Block a user