mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-10-09 17:19:45 +02:00
Removed previous x movement for vert and moved text down (not exactly at bottom yet)
This commit is contained in:
@@ -284,14 +284,14 @@ export const draw = function (text, id, version, diagObj) {
|
|||||||
0.5 * theBarHeight
|
0.5 * theBarHeight
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (d.vert) {
|
// if (d.vert) {
|
||||||
return (
|
// return (
|
||||||
timeScale(d.startTime) +
|
// timeScale(d.startTime) +
|
||||||
theSidePad +
|
// theSidePad +
|
||||||
0.5 * (timeScale(d.endTime) - timeScale(d.startTime)) -
|
// 0.5 * (timeScale(d.endTime) - timeScale(d.startTime)) -
|
||||||
0.5 * theBarHeight
|
// 0.5 * theBarHeight
|
||||||
);
|
// );
|
||||||
}
|
// }
|
||||||
return timeScale(d.startTime) + theSidePad;
|
return timeScale(d.startTime) + theSidePad;
|
||||||
})
|
})
|
||||||
.attr('y', function (d, i) {
|
.attr('y', function (d, i) {
|
||||||
@@ -405,12 +405,6 @@ export const draw = function (text, id, version, diagObj) {
|
|||||||
endX = startX + theBarHeight;
|
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;
|
const textWidth = this.getBBox().width;
|
||||||
|
|
||||||
// Check id text width > width of rectangle
|
// Check id text width > width of rectangle
|
||||||
@@ -427,6 +421,9 @@ export const draw = function (text, id, version, diagObj) {
|
|||||||
.attr('y', function (d, i) {
|
.attr('y', function (d, i) {
|
||||||
// Ignore the incoming i value and use our order instead
|
// Ignore the incoming i value and use our order instead
|
||||||
i = d.order;
|
i = d.order;
|
||||||
|
if (d.vert) {
|
||||||
|
return conf.barHeight * 8 + (conf.fontSize / 2 - 2) + theTopPad;
|
||||||
|
}
|
||||||
return i * theGap + conf.barHeight / 2 + (conf.fontSize / 2 - 2) + theTopPad;
|
return i * theGap + conf.barHeight / 2 + (conf.fontSize / 2 - 2) + theTopPad;
|
||||||
})
|
})
|
||||||
.attr('text-height', theBarHeight)
|
.attr('text-height', theBarHeight)
|
||||||
|
Reference in New Issue
Block a user