Introduced -[RCTShadowView contentFrame]

Summary:
Another trivial sugar/helper to access computed by Yoga layout metrics.
We will use it soon in the new Text render/layout engine.

Reviewed By: mmmulani

Differential Revision: D6671979

fbshipit-source-id: d36933415c2fa50bae5cc171434d8f0b281955b7
This commit is contained in:
Valentin Shergin 2018-01-16 12:39:14 -08:00 committed by Facebook Github Bot
parent 193a2bd4cd
commit 6882132421
2 changed files with 7 additions and 0 deletions

View File

@ -26,6 +26,7 @@ RCT_EXTERN CGFloat RCTCoreGraphicsFloatFromYogaFloat(float value);
@property (nonatomic, readonly) UIEdgeInsets borderAsInsets;
@property (nonatomic, readonly) UIEdgeInsets compoundInsets;
@property (nonatomic, readonly) CGSize availableSize;
@property (nonatomic, readonly) CGRect contentFrame;
#pragma mark - Measuring

View File

@ -81,6 +81,12 @@ CGFloat RCTCoreGraphicsFloatFromYogaFloat(float value)
return UIEdgeInsetsInsetRect((CGRect){CGPointZero, self.frame.size}, self.compoundInsets).size;
}
- (CGRect)contentFrame
{
CGRect bounds = (CGRect){CGPointZero, self.frame.size};
return UIEdgeInsetsInsetRect(bounds, self.compoundInsets);
}
#pragma mark - Measuring
- (CGSize)sizeThatFitsMinimumSize:(CGSize)minimumSize maximumSize:(CGSize)maximumSize