[Add a brief description of what the code in the selection does]
[Add instructions on how to use the code in the selection]
[Add a list of inputs that the code in the selection requires]
[Add a list of outputs that the code in the selection produces]
[Add a code example that demonstrates how to use the code in the selection]
The algorithm having to go through too many points.
We have to keep it one path so that the eraser works properly.
Having a placeholder array that stores 2-300 values in it. ->
when value exeedes that number, add it to the path and then clear it ->
start adding new values and smoothing them again.
tempLine = sharedValue = [];
reRenderCurrentLine = {
if(tempLine.value.length > 200)
{
pathstring.value =+ templine.value;
setAllPathsState(pathString.value);
templine.value = [];
}
}
So currentStrokeLine + tempLineString when being displayed
them if length exeeds 200, pathstring gets added to templine and templine is cleared.
Instead of pathString being totally recalculated every update, it is calculated in chunks which are saved.