Minimal editable text scrolling implementation#23646
Open
ickshonpe wants to merge 32 commits intobevyengine:mainfrom
Open
Minimal editable text scrolling implementation#23646ickshonpe wants to merge 32 commits intobevyengine:mainfrom
ickshonpe wants to merge 32 commits intobevyengine:mainfrom
Conversation
…r `synchronise_output_text`
…shonpe/bevy into multiple_text_inputs_example
…cepts newlines if this is true
…e/bevy into editable-text-scrolling
…nputDispatchPlugin.
Contributor
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.

Objective
Add basic support for scrolling text horizontally and vertically to EditableText.
Solution
TextScroll. Wraps a Vec2 offset that can be used to set the scroll position.scroll_editable_textsetsTextScrollto keep the cursor within view inside theEditableText's content box.allow_newlineflag onEditableText. Allows insertion of newlines with the enter key.editable_text_systempreviously ignoredTextLayout::linebreak. Now it's possible to change the line break settings.TextEditis applied.The implementation here is extremely simple but it has some flaws:
allow_newlines: falsedoesn't block pasting in a section of text with a newlineWent back and forth over whether
ScrollPositionshould be used instead of a dedicated component, I think it's probably simpler withTextScrollbut not certain. Clipping doesn't useNode's overflow API and is handled automatically during extraction, always targeting the content box.Testing