Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Conversation

@abarth
Copy link
Contributor

@abarth abarth commented Jan 30, 2016

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.

@abarth
Copy link
Contributor Author

abarth commented Jan 30, 2016

@Hixie

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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is dead, no?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@eseidelGoogle
Copy link
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
@abarth abarth merged commit 07ec7da into flutter:master Jan 30, 2016
@abarth abarth deleted the position_for_point branch January 30, 2016 17:27
@abarth
Copy link
Contributor Author

abarth commented Jan 30, 2016

It's like restoring antique furniture. :)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

writing-mode is about vertical text, right? I think this comment is moot.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes.

@Hixie
Copy link
Contributor

Hixie commented Jan 30, 2016

At some point I really should try to learn all this code, but for now, what Eric said.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: "with between"

rhencke pushed a commit to rhencke/engine that referenced this pull request Dec 20, 2020
* npe fixes

* fmt

* sort

* review follow-up

* cleanup
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants