Skip to content

Commit 6c3e662

Browse files
authored
Merge pull request #225 from stleamist/patch-yogakit-round-to-pixel-values-after-subtraction
Fixes an issue where `YGApplyLayoutToViewHierarchy` assigns a value to `frame.size` that does not rounded to the pixel grid.
2 parents f748523 + c1ca3b0 commit 6c3e662

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Sources/YogaKit/YGLayout.mm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -525,8 +525,8 @@ static void YGApplyLayoutToViewHierarchy(UIView *view, BOOL preserveOrigin)
525525
.y = YGRoundPixelValue(topLeft.y + origin.y),
526526
},
527527
.size = {
528-
.width = MAX(0, YGRoundPixelValue(bottomRight.x) - YGRoundPixelValue(topLeft.x)),
529-
.height = MAX(0, YGRoundPixelValue(bottomRight.y) - YGRoundPixelValue(topLeft.y)),
528+
.width = MAX(0, YGRoundPixelValue(bottomRight.x - topLeft.x)),
529+
.height = MAX(0, YGRoundPixelValue(bottomRight.y - topLeft.y)),
530530
},
531531
};
532532

0 commit comments

Comments
 (0)