Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Erasing faster skips some strokes #1247

Open
mahdihasan2006 opened this issue Oct 4, 2024 · 3 comments
Open

Erasing faster skips some strokes #1247

mahdihasan2006 opened this issue Oct 4, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@mahdihasan2006
Copy link

Description
Erasing faster skips some strokes.

To Reproduce
Steps to reproduce the behavior:

  1. Open Rnote
  2. Draw some lines or anything
  3. Run the eraser over the lines slowly and then quickly
  4. You will see different results

Expected behavior
Eraser should erase all the lines it crosses.

Console Output

2024-10-04T08:29:30.801574Z DEBUG rnote: .. tracing subscriber initialized.

(rnote:2): Gtk-CRITICAL **: 14:29:43.443: The layout manager of type GtkBoxLayout 0x558474123790 does not create GtkLayoutChild instances

Video

Screencast.from.2024-10-04.14-14-01.mp4

Desktop (please complete the following information):

  • OS: Fedora 40
  • App Version: Rnote v0.11.0
  • Installation Source: Flatpak
  • Desktop Environment: Gnome 46.5
  • Display Server: Wayland
  • Input Source: External Graphics Tablet
@Doublonmousse
Copy link
Collaborator

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)

@Doublonmousse Doublonmousse added bug Something isn't working enhancement New feature or request labels Oct 12, 2024
@mahdihasan2006
Copy link
Author

mahdihasan2006 commented Oct 13, 2024

Whatever it is. It's annoying when I try to do things quickly.

Repository owner deleted a comment Oct 24, 2024
@flxzt flxzt removed the enhancement New feature or request label Oct 26, 2024
@Doublonmousse
Copy link
Collaborator

Doublonmousse commented Nov 9, 2024

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

PenStyle::Eraser => BacklogPolicy::Limit(Duration::from_millis(33)),

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants
@flxzt @Doublonmousse @mahdihasan2006 and others