mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-08-30 21:56:43 +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);
|
let endX = timeScale(d.renderEndTime || d.endTime);
|
||||||
if (d.milestone) {
|
if (d.milestone) {
|
||||||
startX += 0.5 * (timeScale(d.endTime) - timeScale(d.startTime)) - 0.5 * theBarHeight;
|
startX += 0.5 * (timeScale(d.endTime) - timeScale(d.startTime)) - 0.5 * theBarHeight;
|
||||||
}
|
|
||||||
if (d.milestone) {
|
|
||||||
endX = startX + theBarHeight;
|
endX = startX + theBarHeight;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (d.vert) {
|
if (d.vert) {
|
||||||
return startX + theSidePad + (endX - startX) / 2 - this.getBBox().width / 2;
|
return timeScale(d.startTime) + theSidePad;
|
||||||
}
|
}
|
||||||
|
|
||||||
const textWidth = this.getBBox().width;
|
const textWidth = this.getBBox().width;
|
||||||
@@ -429,9 +428,6 @@ export const draw = function (text, id, version, diagObj) {
|
|||||||
if (d.milestone) {
|
if (d.milestone) {
|
||||||
endX = startX + theBarHeight;
|
endX = startX + theBarHeight;
|
||||||
}
|
}
|
||||||
// if (d.vert) {
|
|
||||||
// return startX + theSidePad + (endX - startX) / 2 - this.getBBox().width / 2;
|
|
||||||
// }
|
|
||||||
|
|
||||||
const textWidth = this.getBBox().width;
|
const textWidth = this.getBBox().width;
|
||||||
|
|
||||||
|
@@ -242,8 +242,9 @@ const getStyles = (options) =>
|
|||||||
}
|
}
|
||||||
|
|
||||||
.vertText {
|
.vertText {
|
||||||
fill: navy;
|
|
||||||
font-size: 15px;
|
font-size: 15px;
|
||||||
|
text-anchor: middle;
|
||||||
|
fill: navy;
|
||||||
}
|
}
|
||||||
|
|
||||||
.activeCritText0,
|
.activeCritText0,
|
||||||
|
Reference in New Issue
Block a user