Round pixel values of intrinsicSize with YGRoundPixelValue #1213

Closed
stleamist wants to merge 1 commits from patch-yogakit-intrinsicsize-with-ygroundpixelvalue into main
Showing only changes of commit 98d947ad2b - Show all commits

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 {