From a4c99c8dc4a9c5b9bb683cfecc2b597819167559 Mon Sep 17 00:00:00 2001 From: Ivan Date: Mon, 11 Jul 2022 20:50:38 +0500 Subject: [PATCH] You can now change loop size --- script/EdgeModel.js | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/script/EdgeModel.js b/script/EdgeModel.js index f9bf3aa..7ff32fa 100755 --- a/script/EdgeModel.js +++ b/script/EdgeModel.js @@ -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; + } }