@@ -30,14 +30,12 @@ Item {
32 function update() {
32 function update() {
33− var previouslyStopped = velocityAboveThreshold;
35 calc.trackedPosition = trackedValue;
33 calc.trackedPosition = trackedValue;
36 velocityAboveThreshold = Math.abs(calc.calculate()) > velocityThreshold;
34 velocityAboveThreshold = Math.abs(calc.calculate()) > velocityThreshold;
38 if (velocityAboveThreshold) { // only start timer if we're above the threshold.
36 if (velocityAboveThreshold) { // only start timer if we're above the threshold.
39 velocityTimer.start();
37 velocityTimer.start();
40− } else if (previouslyStopped) { // if we have previously been stopped, then trigger the signal
38+ } else {
41 velocityTimer.stop();
39 velocityTimer.stop();