[Bug] Backtracking creates dots on end of lines
sandorex opened this issue · comments
As i mentioned in excalidraw/excalidraw#4802 (comment)
Moving cursor in opposite direction while drawing makes these weird dots, much more common on wacom tablet for some reason
Potentially related to this part? https://github.com/steveruizok/perfect-freehand/blob/main/packages/perfect-freehand/src/getStrokeOutlinePoints.ts#L210-L239
Answer: I don't think so! I disabled that section of code and it's still reproducible. FUTURE EDIT: It was actually this.
I'll look elsewhere!
What's happening?
Answer: After a stroke does a sharp corner, it keeps doing sharp corners every point. This is because it now looks for sharp corners based on the next point AND the previous point. It can end up detecting a sharp corner twice, and then keeps on flip-flopping. Maybe we could keep some state to make sure it doesn't do the same sharp corner twice...
I'm gonna clean up the code and do a pull request I think.
Awesome work!
Nice work, ill close this now