|
|
@ -40,9 +40,9 @@ class BezierEdgeStatic extends BezierEdgeBase { |
|
|
|
let dx = Math.abs(this.from.x - this.to.x); |
|
|
|
let dy = Math.abs(this.from.y - this.to.y); |
|
|
|
if (type === 'discrete' || type === 'diagonalCross') { |
|
|
|
if (Math.abs(this.from.x - this.to.x) < Math.abs(this.from.y - this.to.y)) { |
|
|
|
if (this.from.y > this.to.y) { |
|
|
|
if (this.from.x < this.to.x) { |
|
|
|
if (Math.abs(this.from.x - this.to.x) <= Math.abs(this.from.y - this.to.y)) { |
|
|
|
if (this.from.y >= this.to.y) { |
|
|
|
if (this.from.x <= this.to.x) { |
|
|
|
xVia = this.from.x + factor * dy; |
|
|
|
yVia = this.from.y - factor * dy; |
|
|
|
} |
|
|
@ -52,7 +52,7 @@ class BezierEdgeStatic extends BezierEdgeBase { |
|
|
|
} |
|
|
|
} |
|
|
|
else if (this.from.y < this.to.y) { |
|
|
|
if (this.from.x < this.to.x) { |
|
|
|
if (this.from.x <= this.to.x) { |
|
|
|
xVia = this.from.x + factor * dy; |
|
|
|
yVia = this.from.y + factor * dy; |
|
|
|
} |
|
|
@ -66,8 +66,8 @@ class BezierEdgeStatic extends BezierEdgeBase { |
|
|
|
} |
|
|
|
} |
|
|
|
else if (Math.abs(this.from.x - this.to.x) > Math.abs(this.from.y - this.to.y)) { |
|
|
|
if (this.from.y > this.to.y) { |
|
|
|
if (this.from.x < this.to.x) { |
|
|
|
if (this.from.y >= this.to.y) { |
|
|
|
if (this.from.x <= this.to.x) { |
|
|
|
xVia = this.from.x + factor * dx; |
|
|
|
yVia = this.from.y - factor * dx; |
|
|
|
} |
|
|
@ -77,7 +77,7 @@ class BezierEdgeStatic extends BezierEdgeBase { |
|
|
|
} |
|
|
|
} |
|
|
|
else if (this.from.y < this.to.y) { |
|
|
|
if (this.from.x < this.to.x) { |
|
|
|
if (this.from.x <= this.to.x) { |
|
|
|
xVia = this.from.x + factor * dx; |
|
|
|
yVia = this.from.y + factor * dx; |
|
|
|
} |
|
|
@ -92,7 +92,7 @@ class BezierEdgeStatic extends BezierEdgeBase { |
|
|
|
} |
|
|
|
} |
|
|
|
else if (type === "straightCross") { |
|
|
|
if (Math.abs(this.from.x - this.to.x) < Math.abs(this.from.y - this.to.y)) { // up - down
|
|
|
|
if (Math.abs(this.from.x - this.to.x) <= Math.abs(this.from.y - this.to.y)) { // up - down
|
|
|
|
xVia = this.from.x; |
|
|
|
if (this.from.y < this.to.y) { |
|
|
|
yVia = this.to.y - (1 - factor) * dy; |
|
|
@ -154,9 +154,9 @@ class BezierEdgeStatic extends BezierEdgeBase { |
|
|
|
yVia = this.from.y + (factor * 0.5 + 0.5) * radius * Math.cos(myAngle); |
|
|
|
} |
|
|
|
else { // continuous
|
|
|
|
if (Math.abs(this.from.x - this.to.x) < Math.abs(this.from.y - this.to.y)) { |
|
|
|
if (this.from.y > this.to.y) { |
|
|
|
if (this.from.x < this.to.x) { |
|
|
|
if (Math.abs(this.from.x - this.to.x) <= Math.abs(this.from.y - this.to.y)) { |
|
|
|
if (this.from.y >= this.to.y) { |
|
|
|
if (this.from.x <= this.to.x) { |
|
|
|
xVia = this.from.x + factor * dy; |
|
|
|
yVia = this.from.y - factor * dy; |
|
|
|
xVia = this.to.x < xVia ? this.to.x : xVia; |
|
|
@ -168,7 +168,7 @@ class BezierEdgeStatic extends BezierEdgeBase { |
|
|
|
} |
|
|
|
} |
|
|
|
else if (this.from.y < this.to.y) { |
|
|
|
if (this.from.x < this.to.x) { |
|
|
|
if (this.from.x <= this.to.x) { |
|
|
|
xVia = this.from.x + factor * dy; |
|
|
|
yVia = this.from.y + factor * dy; |
|
|
|
xVia = this.to.x < xVia ? this.to.x : xVia; |
|
|
@ -181,8 +181,8 @@ class BezierEdgeStatic extends BezierEdgeBase { |
|
|
|
} |
|
|
|
} |
|
|
|
else if (Math.abs(this.from.x - this.to.x) > Math.abs(this.from.y - this.to.y)) { |
|
|
|
if (this.from.y > this.to.y) { |
|
|
|
if (this.from.x < this.to.x) { |
|
|
|
if (this.from.y >= this.to.y) { |
|
|
|
if (this.from.x <= this.to.x) { |
|
|
|
xVia = this.from.x + factor * dx; |
|
|
|
yVia = this.from.y - factor * dx; |
|
|
|
yVia = this.to.y > yVia ? this.to.y : yVia; |
|
|
@ -194,7 +194,7 @@ class BezierEdgeStatic extends BezierEdgeBase { |
|
|
|
} |
|
|
|
} |
|
|
|
else if (this.from.y < this.to.y) { |
|
|
|
if (this.from.x < this.to.x) { |
|
|
|
if (this.from.x <= this.to.x) { |
|
|
|
xVia = this.from.x + factor * dx; |
|
|
|
yVia = this.from.y + factor * dx; |
|
|
|
yVia = this.to.y < yVia ? this.to.y : yVia; |
|
|
|