BREAKING: remove css_sizeThatFits:, replace with new API.

Summary: When I try to use this in practice, I have come to realize that css_sizeThatFits will 99% return to you the constrainedSize that you pass it, thus making it useless. Instead, we replace it with a new API that will tell you the optimal size of the resolved layout. From this we can choose to use that size, or scale it down.

Reviewed By: emilsjolander

Differential Revision: D4191873

fbshipit-source-id: d36a2850448d9d82f97e5ef4c7397778c2a14094
This commit is contained in:
Dustin Shahidehpour
2016-11-17 07:29:33 -08:00
committed by Facebook Github Bot
parent 7e4bb732ff
commit 56aa279fef
3 changed files with 56 additions and 33 deletions

View File

@@ -52,8 +52,8 @@
- (void)css_applyLayout;
/**
Compute the size of a layout with a constrained size.
Returns the size of the view if no constraints were given. This could equivalent to calling [self sizeThatFits:CGSizeMake(CGFLOAT_MAX, CGFLOAT_MAX)];
*/
- (CGSize)css_sizeThatFits:(CGSize)constrainedSize;
- (CGSize)css_intrinsicSize;
@end