Correct positioning for class title

This commit is contained in:
Ashish Jain
2020-07-22 21:25:01 +02:00
parent c9d4cac3ff
commit 71af9741cc
3 changed files with 22 additions and 1 deletions

View File

@@ -625,9 +625,14 @@ const class_box = (parent, node) => {
verticalPos = interfaceBBox.height + rowPadding;
}
// Positin the class title label
let diffX = (maxWidth - classTitleBBox.width) / 2;
select(classTitleLabel).attr(
'transform',
'translate( ' + -maxWidth + node.padding / 2 + ', ' + ((-1 * maxHeight) / 2 + verticalPos) + ')'
'translate( ' +
((-1 * maxWidth) / 2 + diffX) +
', ' +
((-1 * maxHeight) / 2 + verticalPos) +
')'
);
verticalPos += classTitleBBox.height + rowPadding;