mirror of
https://github.com/status-im/react-native.git
synced 2025-01-09 17:15:54 +00:00
d95757037a
Summary:Update to latest master version of css-layout. Update integration in RCTShadow(Root)View to match. This solves the issue with items not strechting vertically in column layouts (https://github.com/facebook/css-layout/issues/127) Reviewed By: vjeux Differential Revision: D3120699 fb-gh-sync-id: beba162e1255d3527e1160e9bd414a712cb10713 fbshipit-source-id: beba162e1255d3527e1160e9bd414a712cb10713
46 lines
1.4 KiB
Objective-C
46 lines
1.4 KiB
Objective-C
/**
|
|
* Copyright (c) 2015-present, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*/
|
|
|
|
#import "RCTRootShadowView.h"
|
|
|
|
@implementation RCTRootShadowView
|
|
|
|
- (void)applySizeConstraints
|
|
{
|
|
switch (_sizeFlexibility) {
|
|
case RCTRootViewSizeFlexibilityNone:
|
|
break;
|
|
case RCTRootViewSizeFlexibilityWidth:
|
|
self.cssNode->style.dimensions[CSS_WIDTH] = CSS_UNDEFINED;
|
|
break;
|
|
case RCTRootViewSizeFlexibilityHeight:
|
|
self.cssNode->style.dimensions[CSS_HEIGHT] = CSS_UNDEFINED;
|
|
break;
|
|
case RCTRootViewSizeFlexibilityWidthAndHeight:
|
|
self.cssNode->style.dimensions[CSS_WIDTH] = CSS_UNDEFINED;
|
|
self.cssNode->style.dimensions[CSS_HEIGHT] = CSS_UNDEFINED;
|
|
break;
|
|
}
|
|
}
|
|
|
|
- (NSSet<RCTShadowView *> *)collectViewsWithUpdatedFrames
|
|
{
|
|
[self applySizeConstraints];
|
|
|
|
[self fillCSSNode:self.cssNode];
|
|
resetNodeLayout(self.cssNode);
|
|
layoutNode(self.cssNode, CSS_UNDEFINED, CSS_UNDEFINED, CSS_DIRECTION_INHERIT);
|
|
|
|
NSMutableSet<RCTShadowView *> *viewsWithNewFrame = [NSMutableSet set];
|
|
[self applyLayoutNode:self.cssNode viewsWithNewFrame:viewsWithNewFrame absolutePosition:CGPointZero];
|
|
return viewsWithNewFrame;
|
|
}
|
|
|
|
@end
|