The problem was that the stroke array was not reset for each iteration of the loop, so the second time around, the array was not initialized correctly and was left with a NaN value.
The problem was that the stroke array was not reset for each iteration of the loop, so the second time around, the array was not initialized correctly and was left with a NaN value.