From ca4c4b5908d0b22e0944e933fec350de31a90ea8 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 6 Jun 2019 19:06:09 +0800 Subject: [PATCH] #4305 Fix edge label going to 0,0 - happens when --- lib/network/modules/components/Edge.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/network/modules/components/Edge.js b/lib/network/modules/components/Edge.js index 653eb9f6f..e7d27194b 100644 --- a/lib/network/modules/components/Edge.js +++ b/lib/network/modules/components/Edge.js @@ -580,8 +580,12 @@ class Edge { ctx.save(); let rotationPoint = this._getRotation(ctx); - if (rotationPoint.angle != 0) { + if (!isNaN(rotationPoint.x) && !isNaN(rotationPoint.y)) { ctx.translate(rotationPoint.x, rotationPoint.y); + } else { + ctx.translate(node1.x, node1.y); + } + if (rotationPoint.angle != 0) { ctx.rotate(rotationPoint.angle); }