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

[Bug]: eraser erases nearby untouched strokes #528

Closed
1 task done
oorganic opened this issue Nov 22, 2023 · 5 comments · Fixed by #630
Closed
1 task done

[Bug]: eraser erases nearby untouched strokes #528

oorganic opened this issue Nov 22, 2023 · 5 comments · Fixed by #630
Assignees
Labels
bug Something isn't working confirmed good first issue Good for newcomers help wanted Extra attention is needed
Milestone

Comments

@oorganic
Copy link

What happened?

lineageos galaxy s5e tablet using a capacitative stylus, no similar issues on other apps afaik. afaik nothing else was touching the nearby strokes on the left erased, palm wasn't on the screen

signal-2023-11-22-17-21-46-611_L5sJTtKo.mp4

Version

2.0.0.beta-15

Platform

Android

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@oorganic oorganic added the bug Something isn't working label Nov 22, 2023
@CodeDoctorDE
Copy link
Member

I will look at this.
On my code side i will only catch pointer events and use this position to remove something.

@CodeDoctorDE CodeDoctorDE added help wanted Extra attention is needed confirmed labels Nov 25, 2023
@CodeDoctorDE
Copy link
Member

I think I know what the problem is.
The thing is: ElementsRemoved takes a list of indexes.
An example. We have given a list ["a", "b", "c", "d"].
All events are processed in a different scheduler than the ui.
If we delete "b" and after a short time "c", we got ElementsRemoved([1]) and ElementsRemoved([2]).

Then the event handler comes in. The first handler changed the list to ["a", "c", "d"].
Now we have a problem: The next handler changes the list to ["a", "c"].

To fix this, we need to change the behavior from an index based system to an id/key based system.
My suggestion would be to add an id property to every renderer with a random value.
If we want to delete an element, we search for this renderer and use the key in the ElementsRemoved parameters.
Maybe we should look for a method to look for already existing keys when generating the id.

@CodeDoctorDE CodeDoctorDE added the good first issue Good for newcomers label Feb 1, 2024
@CodeDoctorDE CodeDoctorDE modified the milestones: 2.1, 2.0 Feb 2, 2024
@CodeDoctorDE CodeDoctorDE reopened this Feb 5, 2024
@CodeDoctorDE CodeDoctorDE modified the milestones: 2.0, 2.1 Feb 5, 2024
@CodeDoctorDE
Copy link
Member

CodeDoctorDE commented Feb 5, 2024

It should be fixed for now in 2.0.3-rc.0, I will try to add an id system in 2.1 to make it more stable

@CodeDoctorDE
Copy link
Member

Can you try out https://butterfly-git-feature-element-id-linwood.vercel.app/ if this solves this issue and if this doesn't break anything (elements creation, changing, arranging)?

@CodeDoctorDE
Copy link
Member

Fixed in 2.1.0-beta.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working confirmed good first issue Good for newcomers help wanted Extra attention is needed
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants