Skip to content
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

[ASTextNode] Unnecessary Text Layout in ASTextKitRenderer #156

Open
garrettmoon opened this issue May 1, 2017 · 1 comment
Open

[ASTextNode] Unnecessary Text Layout in ASTextKitRenderer #156

garrettmoon opened this issue May 1, 2017 · 1 comment

Comments

@garrettmoon
Copy link
Member

From @b3ll on November 13, 2016 11:9

Currently ASTextKitRenderer (ASDK 1.9.92) uses the bounds of the text container to render the required glyphs, rather than the bounds passed in through -drawInContext:bounds:.

NSRange glyphRange = [layoutManager glyphRangeForBoundingRect:CGRectMake(0,0,textContainer.size.width, textContainer.size.height) inTextContainer:textContainer];
    
[layoutManager drawBackgroundForGlyphRange:glyphRange atPoint:shadowInsetBounds.origin];
[layoutManager drawGlyphsForGlyphRange:glyphRange atPoint:shadowInsetBounds.origin];`

Is there any reason for this?

I'm currently laying out text in a UIScrollView, which can change dynamically, and I'd rather it not redraw the entire scrollview's -contentSize of glyphs, since that can be extremely expensive. For larger sets of text, it's actually impossible to draw the whole set since it ends up being so memory intensive.

Copied from original issue: facebookarchive/AsyncDisplayKit#2600

@garrettmoon
Copy link
Member Author

I don't think this is as urgent as a P1, but we should definitely prioritize for 2.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant