From 98d947ad2b252b22983ae96b4a081987f440dbdc Mon Sep 17 00:00:00 2001 From: Dongkyu Kim Date: Sun, 15 Jan 2023 16:49:36 +0900 Subject: [PATCH] Round pixel values of `intrinsicSize` with `YGRoundPixelValue` --- YogaKit/Source/YGLayout.m | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/YogaKit/Source/YGLayout.m b/YogaKit/Source/YGLayout.m index 1627a74f..1f386a66 100644 --- a/YogaKit/Source/YGLayout.m +++ b/YogaKit/Source/YGLayout.m @@ -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 {