From 7637df238d03a301d9b15e6e667c11da055fbcd5 Mon Sep 17 00:00:00 2001 From: Massimo Callegari Date: Sun, 13 Oct 2024 14:36:14 +0200 Subject: [PATCH] resources: fix script test repetition --- resources/rgbscripts/sinewave.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/resources/rgbscripts/sinewave.js b/resources/rgbscripts/sinewave.js index d9e129aa2..09043b3fa 100644 --- a/resources/rgbscripts/sinewave.js +++ b/resources/rgbscripts/sinewave.js @@ -37,8 +37,6 @@ var testAlgo; algo.frequency = 100; algo.properties.push("name:frequency|type:range|display:Frequency|values:1,400|write:setFrequency|read:getFrequency"); - algo.currentStep = 0; - algo.setOrientation = function(_orientation) { if (_orientation === "Vertical") { algo.orientation = 1; } @@ -89,7 +87,7 @@ var testAlgo; for (var cStep = 0; cStep < stepsWidth; cStep++) { - var sineStep = algo.currentStep + cStep; + var sineStep = step + cStep; if (sineStep >= stepsWidth) sineStep -= stepsWidth; var sinPos = Math.sin((sineStep * 2 * Math.PI) / stepsTotal) * ampFactor; @@ -125,7 +123,6 @@ var testAlgo; lastPos = sinPos; } - algo.currentStep++; return map; };