diff --git a/src/app/cartography/shared/widgets/links.widget.ts b/src/app/cartography/shared/widgets/links.widget.ts index ebe6a776..1876d4ac 100644 --- a/src/app/cartography/shared/widgets/links.widget.ts +++ b/src/app/cartography/shared/widgets/links.widget.ts @@ -90,7 +90,7 @@ export class LinksWidget implements Widget { .attr('transform', function(l) { if (l.source && l.target) { const translation = self.multiLinkCalculatorHelper.linkTranslation(l.distance, l.source, l.target); - return `translate (${translation.dx + l.source.width / 2.}, ${translation.dy + l.source.height / 2.})`; + return `translate (${translation.dx}, ${translation.dy})`; } return null; }); diff --git a/src/app/cartography/shared/widgets/nodes.widget.ts b/src/app/cartography/shared/widgets/nodes.widget.ts index 3858e13a..4bc549d1 100644 --- a/src/app/cartography/shared/widgets/nodes.widget.ts +++ b/src/app/cartography/shared/widgets/nodes.widget.ts @@ -52,8 +52,8 @@ export class NodesWidget implements Widget { selection .select('text.label') - .attr('x', (n: Node) => n.label.x) - .attr('y', (n: Node) => n.label.y) + .attr('x', (n: Node) => n.label.x - n.width / 2.) + .attr('y', (n: Node) => n.label.y - n.height / 2. + 20) // @todo: server computes y in auto way .attr('style', (n: Node) => n.label.style) .text((n: Node) => n.label.text); @@ -88,7 +88,12 @@ export class NodesWidget implements Widget { return 'data:image/svg+xml;base64,none'; }) .attr('width', (n: Node) => n.width) - .attr('height', (n: Node) => n.height); + .attr('height', (n: Node) => n.height) + .attr('x', (n: Node) => -n.width / 2.) + .attr('y', (n: Node) => -n.height / 2.); + + // .attr('width', (n: Node) => n.width) + // .attr('height', (n: Node) => n.height); // .on('mouseover', function (this, n: Node) { // select(this).attr("class", "over"); // }) diff --git a/src/app/project-map/project-map.component.ts b/src/app/project-map/project-map.component.ts index 26ab5246..01638ad6 100644 --- a/src/app/project-map/project-map.component.ts +++ b/src/app/project-map/project-map.component.ts @@ -277,7 +277,7 @@ export class ProjectMapComponent implements OnInit { const data = drawingLineTool.stop(); this.onLineCreation(data['node'], data['port'], node, port); } else { - drawingLineTool.start(node.x + node.width / 2., node.y + node.height / 2., { + drawingLineTool.start(node.x, node.y, { 'node': node, 'port': port });