Set property ivar for shadow view frame

Reviewed By: emilsjolander

Differential Revision: D3683649

fbshipit-source-id: d818cb0eea064baca99be2bc6edf1b61b90bb64b
This commit is contained in:
Pieter De Baets 2016-08-10 10:44:51 -07:00 committed by Facebook Github Bot 1
parent 4afaf5e538
commit 6775d1f136
2 changed files with 12 additions and 5 deletions

View File

@ -217,11 +217,15 @@ RCT_NOT_IMPLEMENTED(- (instancetype)initWithCoder:(NSCoder *)aDecoder)
_contentView = [[RCTRootContentView alloc] initWithFrame:self.bounds
bridge:bridge
reactTag:self.reactTag
sizeFlexiblity:self.sizeFlexibility];
sizeFlexiblity:_sizeFlexibility];
[self runApplication:bridge];
_contentView.backgroundColor = self.backgroundColor;
[self insertSubview:_contentView atIndex:0];
if (_sizeFlexibility == RCTRootViewSizeFlexibilityNone) {
self.intrinsicSize = self.bounds.size;
}
}
- (void)runApplication:(RCTBridge *)bridge

View File

@ -555,10 +555,13 @@ RCT_DIMENSION_PROPERTY(Left, left, PositionStart)
- (void)setFrame:(CGRect)frame
{
CSSNodeStyleSetPositionLeft(_cssNode, CGRectGetMinX(frame));
CSSNodeStyleSetPositionTop(_cssNode, CGRectGetMinY(frame));
CSSNodeStyleSetWidth(_cssNode, CGRectGetWidth(frame));
CSSNodeStyleSetHeight(_cssNode, CGRectGetHeight(frame));
if (!CGRectEqualToRect(frame, _frame)) {
_frame = frame;
CSSNodeStyleSetPositionLeft(_cssNode, CGRectGetMinX(frame));
CSSNodeStyleSetPositionTop(_cssNode, CGRectGetMinY(frame));
CSSNodeStyleSetWidth(_cssNode, CGRectGetWidth(frame));
CSSNodeStyleSetHeight(_cssNode, CGRectGetHeight(frame));
}
}
static inline void RCTAssignSuggestedDimension(CSSNodeRef cssNode, CSSDimension dimension, CGFloat amount)