Update node.ts

This commit is contained in:
piotrpekala7 2021-01-08 11:58:57 +01:00
parent f508242858
commit 85ab218bc2

View File

@ -103,8 +103,12 @@ export class NodeWidget implements Widget {
if (n.height > 64) return 64; if (n.height > 64) return 64;
return n.height; return n.height;
}) })
.attr('x', (n: MapNode) => 0) .attr('x', (n: MapNode) => {
.attr('y', (n: MapNode) => 0) return 0
})
.attr('y', (n: MapNode) => {
return 0
})
.on('mouseover', function(this, n: MapNode) { .on('mouseover', function(this, n: MapNode) {
select(this).attr('class', 'over'); select(this).attr('class', 'over');
}) })
@ -113,6 +117,7 @@ export class NodeWidget implements Widget {
}); });
node_body_merge.attr('transform', (n: MapNode) => { node_body_merge.attr('transform', (n: MapNode) => {
if (!n.width) return `translate(${n.x - 30},${n.y - 30})`
return `translate(${n.x},${n.y})`; return `translate(${n.x},${n.y})`;
}); });