UNPKG

1.09 kBPlain TextView Raw
1/*
2 * Copyright (c) Facebook, Inc. and its affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
5 * LICENSE file in the root directory of this source tree.
6 */
7
8#import "RCTRootShadowView.h"
9
10#import "RCTI18nUtil.h"
11#import "RCTShadowView+Layout.h"
12
13@implementation RCTRootShadowView
14
15- (instancetype)init
16{
17 if (self = [super init]) {
18 _baseDirection = [[RCTI18nUtil sharedInstance] isRTL] ? YGDirectionRTL : YGDirectionLTR;
19 _availableSize = CGSizeMake(INFINITY, INFINITY);
20 }
21
22 return self;
23}
24
25- (void)layoutWithAffectedShadowViews:(NSHashTable<RCTShadowView *> *)affectedShadowViews
26{
27 NSHashTable<NSString *> *other = [NSHashTable new];
28
29 RCTLayoutContext layoutContext = {};
30 layoutContext.absolutePosition = CGPointZero;
31 layoutContext.affectedShadowViews = affectedShadowViews;
32 layoutContext.other = other;
33
34 [self layoutWithMinimumSize:CGSizeZero
35 maximumSize:_availableSize
36 layoutDirection:RCTUIKitLayoutDirectionFromYogaLayoutDirection(_baseDirection)
37 layoutContext:layoutContext];
38}
39
40@end