This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Add Paragraph#getPositionForOffset#2327
Merged
abarth merged 1 commit intoflutter:masterfrom Jan 30, 2016
Merged
Conversation
Contributor
Author
We'll use this function to position the caret when the user taps a text input control. Very little of the code in this patch is actually new. Most of it is restoring code that we previously removed from the engine. I've made some small changes to the restored code to handle the lack of a DOM. The only major change is to RenderObject::createPositionWithAffinity, which now just returns the values it captures instead of trying to compute a DOM position. TextAffinity and TextPosition are lifted from package:flutter. Once this patch rolls into package:flutter, I'll remove the declarations there.
812b7d5 to
21d7575
Compare
Contributor
Author
There was a problem hiding this comment.
We still have RenderReplaced, but there's no way to create one currently. We do want to let people have replaced objects in their text flows (e.g., material chips), but we haven't sorted out how we're going to do that yet.
Contributor
|
Too much C++ code for me to really digest in one go. But I trust you that you're restoring. rslgtm. |
abarth
added a commit
that referenced
this pull request
Jan 30, 2016
Add Paragraph#getPositionForOffset
Contributor
Author
|
It's like restoring antique furniture. :) |
Contributor
There was a problem hiding this comment.
writing-mode is about vertical text, right? I think this comment is moot.
Contributor
|
At some point I really should try to learn all this code, but for now, what Eric said. |
rhencke
pushed a commit
to rhencke/engine
that referenced
this pull request
Dec 20, 2020
* npe fixes * fmt * sort * review follow-up * cleanup
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
We'll use this function to position the caret when the user taps a text
input control.
Very little of the code in this patch is actually new. Most of it is
restoring code that we previously removed from the engine. I've made
some small changes to the restored code to handle the lack of a DOM. The
only major change is to RenderObject::createPositionWithAffinity, which
now just returns the values it captures instead of trying to compute a
DOM position.
TextAffinity and TextPosition are lifted from package:flutter. Once this
patch rolls into package:flutter, I'll remove the declarations there.