Open mahdihasan2006 opened 1 month ago
If I'm not mistaken, the eraser works per event. Hence if you move fast, you may not have a (x,y) coordinate close to every line.
The fix would be to store the previous coordinate (x_0,y_0) and when a new event (x,y) happens, erase the polygon corresponding to the space that the eraser got through between the two events (Minkowski sum between the line between the two events and the eraser square)
Whatever it is. It's annoying when I try to do things quickly.
I've started to look at where/how I want to do this. Ideally, I'd want #1235 to land first though before starting this part.
It must be one of the most widespread bug for this kind of application (present in xournalpp, lorien, saber, journal ..)
It's made worse by this line https://github.com/flxzt/rnote/blob/7f3ff8aafcaf3137bec9993329667e5e9fbf4c4e/crates/rnote-engine/src/pens/penholder.rs#L497 That limits the event rate of the eraser to the display refresh rate (so if you have 3 events over a frame, only the last one is sent)
Description
Erasing faster skips some strokes.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Eraser should erase all the lines it crosses.
Console Output
Video
https://github.com/user-attachments/assets/eb5a6e77-ac56-4254-80be-0fc0c1d5d07a
Desktop (please complete the following information):