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

Conversation

samhsiung
Copy link
Contributor

This fixes #930 and fixes ASTextNodeTest size recalculation tests when there is a non-zero NSParagraphyStyle lineSpacing.

I could only get the updated ASTextNodeTest tests to pass when I increased the height of the rect returned by usedRectForTextContainer by exactly linespacing in ASTextKitRenderer's _calculateSize method. I suspect the calculation doesn't take the linespacing of the last line into account.

I couldn't find any issues within ASDK code so I suspected it is a bug with TextKit or NSLayoutManager but if anyone could find the root cause in ASDK that is obviously a better fix.

@bsmith11
Copy link

Could this have anything to do with #940?

@samhsiung
Copy link
Contributor Author

Thanks @bsmith11 that's interesting. Possibly related if linespacing calculation in NSLayoutManager is broken in general, however I wasn't using NSUnderlineStyleAttributeName in my project or in the ASTextNodeTest

@bsmith11
Copy link

I'll test it out on UITextView

Copy link
Contributor

Choose a reason for hiding this comment

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

What if the paragraph style changes at some point through the text? Just not supported?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point and you caught my laziness :) modified it to only take the paragraph style of the last visible glyph and it still fixed it.

@samhsiung
Copy link
Contributor Author

closing and reopening to trigger travis build

@samhsiung samhsiung closed this Dec 15, 2015
@samhsiung samhsiung reopened this Dec 15, 2015
@samhsiung
Copy link
Contributor Author

After setting up test code to verify if TextKit is bugged, I think the issue might be in the truncation logic.

@samhsiung samhsiung closed this Dec 15, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

(ASDK 1.9.3) ASTextNode truncates on first line instead of second line for single words that are long enough

4 participants