mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-08-26 11:46:42 +02:00
Adjusted label calculation for x and y values
This commit is contained in:
@@ -406,6 +406,9 @@ 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;
|
||||||
|
|
||||||
@@ -423,9 +426,7 @@ 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
|
||||||
if (d.vert) {
|
if (d.vert) {
|
||||||
return (
|
return conf.gridLineStartPadding + taskArray.length * (conf.barHeight + conf.barGap) + 50;
|
||||||
conf.barHeight * numOccurrences.at(0).at(1) * 1.3 + (conf.fontSize / 2 - 2) + theTopPad
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
i = d.order;
|
i = d.order;
|
||||||
return i * theGap + conf.barHeight / 2 + (conf.fontSize / 2 - 2) + theTopPad;
|
return i * theGap + conf.barHeight / 2 + (conf.fontSize / 2 - 2) + theTopPad;
|
||||||
|
Reference in New Issue
Block a user