mirror of
https://github.com/UnickSoft/graphonline.git
synced 2025-07-01 23:36:00 +00:00
You can now change loop size
This commit is contained in:
parent
87ef9dbe43
commit
a4c99c8dc4
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user