Round pixel values of intrinsicSize with YGRoundPixelValue

This commit is contained in:
Dongkyu Kim
2023-01-15 16:49:36 +09:00
parent 53a8842abb
commit 98d947ad2b

View File

@@ -320,11 +320,15 @@ YG_EDGE_PROPERTY(gap, Gap, Gap, YGGutterAll)
}
- (CGSize)intrinsicSize {
const CGSize constrainedSize = {
CGSize constrainedSize = {
.width = YGUndefined,
.height = YGUndefined,
};
return [self calculateLayoutWithSize:constrainedSize];
constrainedSize = [self calculateLayoutWithSize:constrainedSize];
return (CGSize){
.width = YGRoundPixelValue(constrainedSize.width),
.height = YGRoundPixelValue(constrainedSize.height),
};
}
- (CGSize)calculateLayoutWithSize:(CGSize)size {