File tree Expand file tree Collapse file tree 4 files changed +13
-13
lines changed
packages/mermaid/src/rendering-util/rendering-elements/shapes Expand file tree Collapse file tree 4 files changed +13
-13
lines changed Original file line number Diff line number Diff line change @@ -116,11 +116,10 @@ export async function curlyBraceLeft<T extends SVGGraphicsElement>(
116
116
117
117
curlyBraceLeftShape . attr ( 'transform' , `translate(${ radius } , 0)` ) ;
118
118
119
- label . attr ( 'transform' , `translate(${ - bbox . width / 2 } , ${ - bbox . height / 2 } )` ) ;
120
- // label.attr(
121
- // 'transform',
122
- // `translate(${-w / 2 + radius - (bbox.x - (bbox.left ?? 0))},${-paddingY / 2 - (bbox.y - (bbox.top ?? 0))})`
123
- // );
119
+ label . attr (
120
+ 'transform' ,
121
+ `translate(${ - w / 2 + ( paddingX ?? 0 ) - ( bbox . x - ( bbox . left ?? 0 ) ) } , ${ - bbox . height / 2 } )`
122
+ ) ;
124
123
125
124
updateNodeBounds ( node , curlyBraceLeftShape ) ;
126
125
Original file line number Diff line number Diff line change @@ -119,12 +119,10 @@ export async function curlyBraceRight<T extends SVGGraphicsElement>(
119
119
120
120
curlyBraceRightShape . attr ( 'transform' , `translate(${ - radius } , 0)` ) ;
121
121
122
- label . attr ( 'transform' , `translate(${ - bbox . width / 2 } , ${ - bbox . height / 2 } )` ) ;
123
-
124
- // label.attr(
125
- // 'transform',
126
- // `translate(${-w / 2 + labelPaddingX / 2 - (bbox.x - (bbox.left ?? 0))},${-(labelPaddingY / 2) - (bbox.y - (bbox.top ?? 0))})`
127
- // );
122
+ label . attr (
123
+ 'transform' ,
124
+ `translate(${ - w / 2 + ( labelPaddingX ?? 0 ) - ( bbox . x - ( bbox . left ?? 0 ) ) } , ${ - bbox . height / 2 } )`
125
+ ) ;
128
126
129
127
updateNodeBounds ( node , curlyBraceRightShape ) ;
130
128
Original file line number Diff line number Diff line change @@ -137,7 +137,10 @@ export async function curlyBraces<T extends SVGGraphicsElement>(
137
137
138
138
curlyBracesShape . attr ( 'transform' , `translate(${ radius - radius / 4 } , 0)` ) ;
139
139
140
- label . attr ( 'transform' , `translate(${ - bbox . width / 2 } , ${ - bbox . height / 2 } )` ) ;
140
+ label . attr (
141
+ 'transform' ,
142
+ `translate(${ - w / 2 + ( labelPaddingX ?? 0 ) - ( bbox . x - ( bbox . left ?? 0 ) ) } , ${ - bbox . height / 2 } )`
143
+ ) ;
141
144
updateNodeBounds ( node , curlyBracesShape ) ;
142
145
143
146
node . intersect = function ( point ) {
Original file line number Diff line number Diff line change @@ -75,7 +75,7 @@ export async function dividedRectangle<T extends SVGGraphicsElement>(
75
75
// place the label in the center of the lower half of the divided rectangle
76
76
label . attr (
77
77
'transform' ,
78
- `translate(${ - bbox . width / 2 } , ${ - bbox . height / 2 - rectOffset / 2 + rectOffset } )`
78
+ `translate(${ - w / 2 + ( paddingX ?? 0 ) - ( bbox . x - ( bbox . left ?? 0 ) ) } , ${ - bbox . height / 2 - rectOffset / 2 + rectOffset } )`
79
79
) ;
80
80
81
81
updateNodeBounds ( node , polygon ) ;
You can’t perform that action at this time.
0 commit comments