Repository navigation
Drawing ink no longer jumps the view back to the caret (#859) - #892
Merged
Merged
Conversation
Member
|
Thanks for the contribution, @marcoarnulfo! This is now merged into main. If you haven't already, please come join us on Discord: https://discord.gg/artcraft |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #859.
Every command that isn't
view.*,document.*orformat.state*setsscroll_to_caretinafter_command, and that included thedraw.*commands the canvas runs when you lift the pen (draw.stroke), erase (draw.erase) or use the lasso (draw.lasso,draw.lassoMove). On the next frame the canvas scrolled back to the caret, which is usually still on page 1, so every stroke drawn further down the document threw the view away. Drawing never moves the caret (the draw commands only shift its offset when they insert or delete the ink's anchor character), soafter_commandnow leavesdraw.*out as well.Validation:
drawing_ink_keeps_the_view_where_it_isincrates/ui-egui/src/lib.rs: runsdraw.stroke,draw.lasso,draw.lassoMoveanddraw.erase(each asserted to succeed) and checks none of them asks to scroll to the caret, then checks thattext.insertstill does. On main it fails with "draw.stroke scrolled to the caret".cargo test -p wordcraft-ui-eguipasses, and clippy and fmt are clean (macOS, Apple silicon).Other commands that act on objects (
arrange.*,shape.*,picture.*) take the same path; I left them alone since I haven't checked they never move the caret.