mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-08-15 06:19:24 +02:00
the title is centered at vert line
This commit is contained in:
@@ -393,12 +393,11 @@ export const draw = function (text, id, version, diagObj) {
|
||||
let endX = timeScale(d.renderEndTime || d.endTime);
|
||||
if (d.milestone) {
|
||||
startX += 0.5 * (timeScale(d.endTime) - timeScale(d.startTime)) - 0.5 * theBarHeight;
|
||||
}
|
||||
if (d.milestone) {
|
||||
endX = startX + theBarHeight;
|
||||
}
|
||||
|
||||
if (d.vert) {
|
||||
return startX + theSidePad + (endX - startX) / 2 - this.getBBox().width / 2;
|
||||
return timeScale(d.startTime) + theSidePad;
|
||||
}
|
||||
|
||||
const textWidth = this.getBBox().width;
|
||||
@@ -429,9 +428,6 @@ export const draw = function (text, id, version, diagObj) {
|
||||
if (d.milestone) {
|
||||
endX = startX + theBarHeight;
|
||||
}
|
||||
// if (d.vert) {
|
||||
// return startX + theSidePad + (endX - startX) / 2 - this.getBBox().width / 2;
|
||||
// }
|
||||
|
||||
const textWidth = this.getBBox().width;
|
||||
|
||||
|
@@ -242,8 +242,9 @@ const getStyles = (options) =>
|
||||
}
|
||||
|
||||
.vertText {
|
||||
fill: navy;
|
||||
font-size: 15px;
|
||||
text-anchor: middle;
|
||||
fill: navy;
|
||||
}
|
||||
|
||||
.activeCritText0,
|
||||
|
Reference in New Issue
Block a user