-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ASTextNode2] Add improved support for all line-break modes in experimental text node. #1150
Conversation
ASTextNode2 was only setting truncationMode (lineBreakMode) on existing paragraph styles in attributedString (thus having no effect for the two non-truncating modes if there were not any existing paragraph style runs). ASTextLayout (essentially YYTextLayout) was not rendering the two non-tail truncation lineBreakModes correctly. There's not much history on github but it appears to me that it was set up correctly at one time and then some additional code was added for unclear reasons that assumed any truncation was at the end of the string. This commit corrects both issues.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pretty complicated stuff! I went line-by-line and if I squint it all makes sense. I thought our text node tests were all being run against text node 2 thanks to @wsdwsd0829 's change a while back. Can we easily cover these truncation modes?
Yes I intend/need to add snapshot tests! Thanks for squinting through it so far, let me see if I can get those pushed today.
… On Oct 17, 2018, at 8:19 AM, Adlai Holler ***@***.***> wrote:
@Adlai-Holler approved this pull request.
Pretty complicated stuff! I went line-by-line and if I squint it all makes sense. I thought our text node tests were all being run against text node 2 thanks to @wsdwsd0829 's change a while back. Can we easily cover these truncation modes?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Also my merge with master yesterday was kind of back-of-the-envelope, I mostly pushed it in case I wanted to work on it from a different machine. So I would discourage merging this until I get to audit that more carefully... which adding those tests should give me a chance to do!
… On Oct 17, 2018, at 8:34 AM, Kevin Smith ***@***.***> wrote:
Yes I intend/need to add snapshot tests! Thanks for squinting through it so far, let me see if I can get those pushed today.
> On Oct 17, 2018, at 8:19 AM, Adlai Holler ***@***.***> wrote:
>
> @Adlai-Holler approved this pull request.
>
> Pretty complicated stuff! I went line-by-line and if I squint it all makes sense. I thought our text node tests were all being run against text node 2 thanks to @wsdwsd0829 's change a while back. Can we easily cover these truncation modes?
>
> —
> You are receiving this because you authored the thread.
> Reply to this email directly, view it on GitHub, or mute the thread.
|
etc. 😄 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pretty fly
oops I might have buried the lead with all my screenshots
But umm I'm sure it's fine! I'll put the tests into another PR 😁 |
…mental text node. (TextureGroup#1150) * ASTextNode2 rendering corrections. ASTextNode2 was only setting truncationMode (lineBreakMode) on existing paragraph styles in attributedString (thus having no effect for the two non-truncating modes if there were not any existing paragraph style runs). ASTextLayout (essentially YYTextLayout) was not rendering the two non-tail truncation lineBreakModes correctly. There's not much history on github but it appears to me that it was set up correctly at one time and then some additional code was added for unclear reasons that assumed any truncation was at the end of the string. This commit corrects both issues. * Update CHANGELOG.md
ASTextNode2 was only setting truncationMode (lineBreakMode) on existing paragraph styles in attributedString (thus having no effect for the two non-truncating modes if there were not any existing paragraph style runs).
ASTextLayout (essentially YYTextLayout) was not rendering the two non-tail truncation lineBreakModes correctly. There's not much history on github but it appears to me that it was set up correctly at one time and then some additional code was added for unclear reasons that assumed any truncation was at the end of the string.
This commit corrects both issues.