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: Duplication offset #27

Closed
giannissc opened this issue Dec 21, 2021 · 4 comments
Closed

Bug: Duplication offset #27

giannissc opened this issue Dec 21, 2021 · 4 comments
Labels
bug Something isn't working

Comments

@giannissc
Copy link

When selecting multiple items the selection rectangles have a slight offset from the actual items. Initially when you place the items they seem fine but as soon as you reselect them they go to the positions of the selection rectangles. See video below:

selection-offset.mp4
@giannissc
Copy link
Author

I have opened another round of bug and feature requests for you.. I hope you don´t mind! 😅 It is not all bad though I have noticed significant performance gains with the last two updates as well!!

@flxzt
Copy link
Owner

flxzt commented Dec 21, 2021

Not at all :) But no promises when the issues will get fixed / improved, because developing Rnote is just a hobby for me right now. I already fixed this one upstream though!

@giannissc
Copy link
Author

giannissc commented Dec 22, 2021

No don´t worry about it, I know the drill :) I also had a look at the documentation for gtk-rs when I find some more time I will start playing around a bit with it and then I can help…but not promises here either… haha

The only things that I consider priority are the undo/redo (#23) bug and the missed strokes (#28). If you could point me to their code I could have a look an see if anything seems wrong!

I already fixed this one upstream though!

Should I close this then?

@flxzt
Copy link
Owner

flxzt commented Dec 29, 2021

Again if you need any help please ask :). And the gtk-rs book helped me a ton and the matrix chat channel for gtk-rs is also very helpful for questions with the toolkit.
How the strokes and their behaviour work is that they are split into lists of components (which are fields of the "StrokeState" struct). For example trash_comp to hold the state if the stroke currently is trashed, select_comp to hold the state of selected strokes, render_comp to hold the pixel data, etc.. StrokeState has methods, which are the systems which iterate over these lists and modify their state. (its an ECS pattern, check this video for a better explanation. The undo / redo is in "/src/strokes/trash_comp.rs", more precicely the "undo_last_stroke()" and "redo_last_stroke()" methods. They use the chrono_comp which has holds the variable t, which must be incremented wherever a stroke is inserted or modified. This is needed because the lists don't retain a chronological ordering, meaning iterating over them is more or less in arbitrary order. This way of doing it does not support undoing / redoing of something else than trashing (e.g. translating or resizing a selection), so I want to refactor it into something better anyways

@flxzt flxzt added the bug Something isn't working label Apr 13, 2023
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

2 participants