diff --git a/LuaLibs/RunMachParamFromSWCalc.lua b/LuaLibs/RunMachParamFromSWCalc.lua index 60aafa6..1ac1145 100644 --- a/LuaLibs/RunMachParamFromSWCalc.lua +++ b/LuaLibs/RunMachParamFromSWCalc.lua @@ -228,12 +228,12 @@ function RunMachParamFromSWCalc.Exec() local dCoeff = EgtGetInfo( CurrWidth.IdList[nCurveIdIndex], KEY_FEED_COEFF, 'd') if dCoeff then dNewFeed = dCoeff * CurrFeed - if dNewFeed > dFLimit then - local dNewSpeed = dSpeed * dFLimit / dNewFeed - dNewSpeed = EgtClamp( dNewSpeed, dSMin, dSMax) - dNewFeed = dFLimit - EgtSetInfo( CurrWidth.IdList[nCurveIdIndex], KEY_SPEED, dNewSpeed) - end + end + if dNewFeed > dFLimit then + local dNewSpeed = dSpeed * dFLimit / dNewFeed + dNewSpeed = EgtClamp( dNewSpeed, dSMin, dSMax) + dNewFeed = dFLimit + EgtSetInfo( CurrWidth.IdList[nCurveIdIndex], KEY_SPEED, dNewSpeed) end EgtSetInfo( CurrWidth.IdList[nCurveIdIndex], KEY_FEED, dNewFeed) if dNewFeed > dFeedMax then