#2072 Handle width of clusters with wide titles

This commit is contained in:
Knut Sveidqvist
2021-05-15 18:52:06 +02:00
parent f7944e83eb
commit 0a4f16737a
4 changed files with 47 additions and 38 deletions

View File

@@ -935,15 +935,17 @@ export const positionNode = node => {
const el = nodeElems[node.id];
log.trace(
'Transforming node',
node.diff,
node,
'translate(' + (node.x - node.width / 2 - 5) + ', ' + (node.y - node.height / 2 - 5) + ')'
'translate(' + (node.x - node.width / 2 - 5) + ', ' + node.width / 2 + ')'
);
const padding = 8;
const diff = node.diff || 0;
if (node.clusterNode) {
el.attr(
'transform',
'translate(' +
(node.x - node.width / 2 - padding) +
(node.x + diff - node.width / 2) +
', ' +
(node.y - node.height / 2 - padding) +
')'
@@ -951,4 +953,5 @@ export const positionNode = node => {
} else {
el.attr('transform', 'translate(' + node.x + ', ' + node.y + ')');
}
return diff;
};