vert is now a copy of milestone tag

This commit is contained in:
megantriplett
2025-03-21 15:28:34 -04:00
parent 1125f5a283
commit 2bc3a0f97c

View File

@@ -284,6 +284,14 @@ export const draw = function (text, id, version, diagObj) {
0.5 * theBarHeight
);
}
if (d.vert) {
return (
timeScale(d.startTime) +
theSidePad +
0.5 * (timeScale(d.endTime) - timeScale(d.startTime)) -
0.5 * theBarHeight
);
}
return timeScale(d.startTime) + theSidePad;
})
.attr('y', function (d, i) {
@@ -295,6 +303,9 @@ export const draw = function (text, id, version, diagObj) {
if (d.milestone) {
return theBarHeight;
}
if (d.vert) {
return theBarHeight;
}
return timeScale(d.renderEndTime || d.endTime) - timeScale(d.startTime);
})
.attr('height', theBarHeight)
@@ -354,6 +365,9 @@ export const draw = function (text, id, version, diagObj) {
if (d.milestone) {
taskClass = ' milestone ' + taskClass;
}
if (d.vert) {
taskClass = ' vert ' + taskClass;
}
taskClass += secNum;
@@ -381,6 +395,13 @@ export const draw = function (text, id, version, diagObj) {
if (d.milestone) {
endX = startX + theBarHeight;
}
if (d.vert) {
startX += 0.5 * (timeScale(d.endTime) - timeScale(d.startTime)) - 0.5 * theBarHeight;
}
if (d.vert) {
endX = startX + theBarHeight;
}
const textWidth = this.getBBox().width;
// Check id text width > width of rectangle
@@ -406,6 +427,9 @@ export const draw = function (text, id, version, diagObj) {
if (d.milestone) {
endX = startX + theBarHeight;
}
if (d.vert) {
endX = startX + theBarHeight;
}
const textWidth = this.getBBox().width;
let classStr = '';
@@ -445,6 +469,10 @@ export const draw = function (text, id, version, diagObj) {
taskType += ' milestoneText';
}
if (d.vert) {
taskType += ' vertText';
}
// Check id text width > width of rectangle
if (textWidth > endX - startX) {
if (endX + textWidth + 1.5 * conf.leftPadding > w) {