Fix interface labels positions

This commit is contained in:
ziajka
2018-12-13 13:04:52 +01:00
parent b733d94fbe
commit 3e9eb81dfd

View File

@ -86,13 +86,8 @@ export class InterfaceLabelWidget {
styles = this.fontFixer.fixStyles(styles); styles = this.fontFixer.fixStyles(styles);
return styles; return styles;
}) })
.attr('x', function (this: SVGTextElement, l: MapLinkNode) { .attr('x', (l: MapLinkNode) => l.label.x)
return l.label.x; .attr('y', (l: MapLinkNode) => l.label.y)
})
.attr('y', function (this: SVGTextElement, l: MapLinkNode) {
let bbox = this.getBBox();
return l.label.y + bbox.height;
})
.attr('transform', (l: MapLinkNode) => { .attr('transform', (l: MapLinkNode) => {
return `rotate(${l.label.rotation}, ${l.label.x}, ${l.label.y})`; return `rotate(${l.label.rotation}, ${l.label.x}, ${l.label.y})`;
}) })