The problem was the stroke was created in the inverted loop before checking if the total of points is 0 and exit the loop. Also some code Cleanup.
The problem was the stroke was created in the inverted loop before checking if the total of points is 0 and exit the loop. Also some code Cleanup.