8 Commits

Author SHA1 Message Date
Adlai Holler
9c3b688a87 Remove textStorageCreationBlock API (#2142)
* Remove textStorageCreationBlock API

* Remove layoutManagerCreationBlock also
2016-08-26 11:42:20 -07:00
Hannah Troisi
893e601e81 Convert to type-generic math (#2050)
* [Optimization] Convert to type-generic math

* add std:: prefix in obj-c++ files

* more cleanup

* revert test changes

* convert min and max back to fmin/fmax
2016-08-09 15:31:37 -07:00
Hannah Troisi
c857e809f4 Clean up header comments (for consistent Facebook licensing info) (#1741)
[Licensing] Clean up header comments (for consistent Facebook licensing info)
2016-06-11 23:31:39 -07:00
rcancro
bcb1832fcd Fixed some text shrinking issues
Previously I was multiplying the calculated height of the text by the scale factor. This fails in the case where we have a long string that doesn't fit, but it is shrunk so much that it now has more than enough room in the renderer's constrained size. In this case we fail to update the calculated size's width.

Also updated `lineCountForString` in `ASTextKitFontSizeAdjuster` to reuse a sizer layout manager and text container.
2016-03-09 15:27:33 -08:00
rcancro
3ebdf5928c Made a few changes to font scale adjustment
1) cache the scale in the font adjuster. The adjuster will be dealloc'ed when the renderer that owns it is dealloc'ed (or invalidated). Until that time we can trust the scale that the adjuster has computed.
2) When measuring line count, make sure that we are not bounding the height of the container's size. This will cause the wrong number of lines to be returned.
3) Instead of setting the ascender/descender on an ASTextNode when an attributed string is added, wait until after the renderer calculates size. This way, if there is any need to scale the font to fit we can apply that scale to the ascender/descender.
2016-03-08 12:05:26 -08:00
rcancro
00b0968bf7 Add ability to customize NSLayoutManager and NSTextStorage when created in the ASTextKitContext 2016-02-22 13:00:02 -08:00
rcancro
0e7fae1825 reverted some debug code 2016-02-16 16:16:29 -08:00
rcancro
a920e353c6 adjust font size to make text fit within constrained size
# Conflicts:
#	AsyncDisplayKit/ASTextNode.mm
2016-02-16 16:16:22 -08:00