You can now change loop size

This commit is contained in:
Ivan 2022-07-11 20:50:38 +05:00
parent 87ef9dbe43
commit a4c99c8dc4

View File

@ -204,11 +204,26 @@ EdgeModel.prototype.SetCurveValue = function (value)
EdgeModel.prototype.GetLoopSize = function ()
{
return this.sizeOfLoop;
if (Math.abs(this.curveValue) <= 0.01)
{ // without this condition arc disappears when curveValue=0
return this.sizeOfLoop;
}
else
{ // bigger curveValue -> bigger loop size
return this.sizeOfLoop*Math.abs(this.curveValue)*(1/this.defaultCurve);
}
}
EdgeModel.prototype.GetLoopShiftAngel = function ()
{
return this.loopShiftAngel;
if (this.curveValue > 0)
{ // shift to top-left
return this.loopShiftAngel;
}
else
{ // shift to bottom-right
return this.loopShiftAngel + Math.PI;
}
}