the title is centered at vert line

This commit is contained in:
udvale
2025-04-10 16:35:41 -04:00
parent 81fa2a675f
commit 2009177375
2 changed files with 4 additions and 7 deletions

View File

@@ -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;

View File

@@ -242,8 +242,9 @@ const getStyles = (options) =>
}
.vertText {
fill: navy;
font-size: 15px;
text-anchor: middle;
fill: navy;
}
.activeCritText0,