Skip to content

Commit

Permalink
Merge pull request #2 from az-galvarez/cut-galvarez-4305
Browse files Browse the repository at this point in the history
Fix edge label going to 0,0
  • Loading branch information
az-galvarez authored Jun 6, 2019
2 parents cfdd863 + ff058bf commit b12bc0b
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 b12bc0b

Please sign in to comment.