Permalink
Browse files

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
  • Loading branch information...
shergin authored and facebook-github-bot committed Jan 16, 2018
1 parent 193a2bd commit 688213242130536c5d4db8b9aa17dc418372aadf
Showing with 7 additions and 0 deletions.
  1. +1 −0 React/Views/RCTShadowView+Layout.h
  2. +6 −0 React/Views/RCTShadowView+Layout.m
@@ -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
@@ -81,6 +81,12 @@ - (CGSize)availableSize
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

0 comments on commit 6882132

Please sign in to comment.