Skip to content

Commit 870bc48

Browse files
sherginfacebook-github-bot
authored andcommitted
Yoga float vs. CoreGraphics float in RCTWrapper
Summary: See RCTYogaFloatFromCoreGraphicsFloat for more details. Differential Revision: D6677092 fbshipit-source-id: ca1b2634c903277f529c57557055760a9bf48f28
1 parent c756122 commit 870bc48

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

Libraries/Wrapper/RCTWrapperShadowView.m

+7-2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
#import <React/RCTBridge.h>
66
#import <React/RCTUIManager.h>
7+
#import <React/RCTShadowView+Layout.h>
78

89
#import "RCTWrapperView.h"
910

@@ -27,7 +28,7 @@ - (instancetype)initWithBridge:(RCTBridge *)bridge
2728
static YGSize RCTWrapperShadowViewMeasure(YGNodeRef node, float width, YGMeasureMode widthMode, float height, YGMeasureMode heightMode)
2829
{
2930
CGSize minimumSize = CGSizeMake(0, 0);
30-
CGSize maximumSize = CGSizeMake(INFINITY, INFINITY);
31+
CGSize maximumSize = CGSizeMake(CGFLOAT_MAX, CGFLOAT_MAX);
3132

3233
switch (widthMode) {
3334
case YGMeasureModeUndefined:
@@ -55,7 +56,11 @@ static YGSize RCTWrapperShadowViewMeasure(YGNodeRef node, float width, YGMeasure
5556

5657
RCTWrapperShadowView *shadowView = (__bridge RCTWrapperShadowView *)YGNodeGetContext(node);
5758
CGSize size = [shadowView measureWithMinimumSize:minimumSize maximumSize:maximumSize];
58-
return (YGSize){size.width, size.height};
59+
60+
return (YGSize){
61+
RCTYogaFloatFromCoreGraphicsFloat(size.width),
62+
RCTYogaFloatFromCoreGraphicsFloat(size.height)
63+
};
5964
}
6065

6166
- (CGSize)measureWithMinimumSize:(CGSize)minimumSize maximumSize:(CGSize)maximumSize

Libraries/Wrapper/RCTWrapperView.m

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ - (void)invalidateIntrinsicContentSize
7777

7878
- (CGSize)intrinsicContentSize
7979
{
80-
return [self sizeThatFits:CGSizeMake(INFINITY, INFINITY)];
80+
return [self sizeThatFits:CGSizeMake(CGFLOAT_MAX, CGFLOAT_MAX)];
8181
}
8282

8383
- (CGSize)sizeThatFits:(CGSize)size

0 commit comments

Comments
 (0)