Skip to content

Commit

Permalink
almende#4305 Fix edge label going to 0,0
Browse files Browse the repository at this point in the history
- happens when
  • Loading branch information
az-galvarez committed Jun 6, 2019
1 parent cfdd863 commit ca4c4b5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/network/modules/components/Edge.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit ca4c4b5

Please sign in to comment.