diff --git a/lib/network/modules/components/edges/util/edge-base.ts b/lib/network/modules/components/edges/util/edge-base.ts index f5b7afbddc..b474e069d7 100644 --- a/lib/network/modules/components/edges/util/edge-base.ts +++ b/lib/network/modules/components/edges/util/edge-base.ts @@ -534,9 +534,9 @@ export abstract class EdgeBase implements EdgeType { if (!this.options.selfReference.renderBehindTheNode) { //render only parts which are not overlaping with parent node //need to find x,y of from point and x,y to point - //calculating radiangs - const low = this.options.selfReference.angle - 2 * Math.PI; - const high = this.options.selfReference.angle; + //calculating radians + const low = this.options.selfReference.angle; + const high = this.options.selfReference.angle + Math.PI; const pointTFrom = this._findBorderPositionCircle(this.from, ctx, { x, y, @@ -774,8 +774,8 @@ export abstract class EdgeBase implements EdgeType { const [x, y, radius] = this._getCircleData(ctx); if (position === "from") { - const low = this.options.selfReference.angle - 2 * Math.PI; - const high = this.options.selfReference.angle; + const low = this.options.selfReference.angle; + const high = this.options.selfReference.angle + Math.PI; const pointT = this._findBorderPositionCircle(this.from, ctx, { x, @@ -787,8 +787,8 @@ export abstract class EdgeBase implements EdgeType { angle = pointT.t * -2 * Math.PI + 1.5 * Math.PI + 0.1 * Math.PI; arrowPoint = pointT; } else if (position === "to") { - const low = this.options.selfReference.angle - 2 * Math.PI; - const high = this.options.selfReference.angle; + const low = this.options.selfReference.angle; + const high = this.options.selfReference.angle + Math.PI; const pointT = this._findBorderPositionCircle(this.from, ctx, { x, diff --git a/test/edges/cubic-bezier-edge.test.ts b/test/edges/cubic-bezier-edge.test.ts index b77fd565f4..5c6686feb8 100644 --- a/test/edges/cubic-bezier-edge.test.ts +++ b/test/edges/cubic-bezier-edge.test.ts @@ -567,16 +567,16 @@ describe('CubicBezierEdge', function(): void { }, position: 'from', expected: { - angle: 1.9037437282114893, + angle: -16.968019374652727, core: { - x: 396.26792442306333, - y: -871.0373387250717, + x: 395.6684709042148, + y: -870.9478000797577, }, length: 31.5, point: { - t: 0.4970097752749478, - x: 387.0022943938739, - y: -844.2442313994518, + t: 3.5005441579550327, + x: 387.0000759840845, + y: -843.9555524981157, }, type: 'arrow', }, @@ -616,16 +616,16 @@ describe('CubicBezierEdge', function(): void { }, position: 'to', expected: { - angle: 13.863514558139903, + angle: -11.292410721980435, core: { - x: 404.23324559789233, - y: -874.6679591046823, + x: 403.521164116054, + y: -874.757852447893, }, length: 36, point: { - t: -2.006446870554419, - x: 412.9893362093595, - y: -843.4735545230305, + t: 1.997242985827105, + x: 412.9980495257085, + y: -843.7748144604348, }, type: 'circle', },