EditableText change detection using parley::Generation#23785
Open
ickshonpe wants to merge 31 commits intobevyengine:mainfrom
Open
EditableText change detection using parley::Generation#23785ickshonpe wants to merge 31 commits intobevyengine:mainfrom
EditableText change detection using parley::Generation#23785ickshonpe wants to merge 31 commits intobevyengine:mainfrom
Conversation
…lear method otherwise the `TextLayoutInfo` is not updated again because the dirty flags get reset.
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
Improved change detection for
EditableText.Solution
text_editedfield fromEditableTextthat was used for manual change detection.PlainEditor'sGenerationto track changes.EditableTextGeneration. Newtypesparley::Generation. Stores the generation from the lastTextLayoutInfoupdate.EditableText::editor's andEditableTextGeneration's generation values aren't equal, reupdateTextLayoutInfo.TextLayout::justify.editable_text_systeminto two systemsupdate_editable_text_stylesandupdate_editable_text_layout. The text input's style values need to be updated before layout, so the measure func returns the correct size for the text layout.EditableTexttestbed_uiscene.multiline_text_inputthat allow you to set the height of the multiline input and its fontsize.Testing
The cursor appears to be missing for the numeric inputs in the example but it isn't. The cursor gets clipped because it's at the end of the right aligned input value text. If you press left it comes into view. Cursor and scrolling behaviour needs some adjustments but that's out of the scope of this PR.