Jonathan Maurice
4266409934
Fix negative value rounding issue for nodes across an axis (#688)
Summary:
This fix issue https://github.com/facebook/yoga/issues/683 the rounding calculation is incorrect if a node is crossing an axis and it will shrink it's width/height on layout calculation.
The following test reproduce the issue :
```
TEST(YogaTest, node_shrink_on_axis)
{
const YGConfigRef config = YGConfigNew();
const YGNodeRef root = YGNodeNewWithConfig(config);
const YGNodeRef child = YGNodeNewWithConfig(config);
YGNodeInsertChild(root, child, 0);
YGNodeStyleSetWidth(child, 10);
YGNodeStyleSetHeight(child, 10);
YGNodeStyleSetPosition(root, YGEdgeLeft, -0.75f);
YGNodeStyleSetPosition(root, YGEdgeTop, -0.75f);
YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR);
ASSERT_FLOAT_EQ(YGNodeLayoutGetWidth(child), 10);
ASSERT_FLOAT_EQ(YGNodeLayoutGetHeight(child), 10);
YGNodeFreeRecursive(root);
YGConfigFree(config);
}
```
Pull Request resolved: https://github.com/facebook/yoga/pull/688
Reviewed By: NickGerleman
Differential Revision: D13866122
Pulled By: rozele
fbshipit-source-id: 4faf8a9efc86723c303f600d730660a2e13d8a73
2023-02-02 07:50:12 -08:00
..
2023-01-08 13:41:27 -08:00
2022-12-28 01:21:52 -08:00
2022-10-04 13:59:32 -07:00
2023-01-16 07:56:11 -08:00
2022-10-04 13:59:32 -07:00
2023-01-09 13:59:19 -08:00
2023-01-09 13:59:19 -08:00
2023-01-09 13:59:19 -08:00
2022-10-04 13:59:32 -07:00
2022-10-04 13:59:32 -07:00
2022-10-04 13:59:32 -07:00
2022-10-04 13:59:32 -07:00
2022-10-04 13:59:32 -07:00
2022-10-04 13:59:32 -07:00
2022-10-04 13:59:32 -07:00
2022-10-04 13:59:32 -07:00
2022-10-04 13:59:32 -07:00
2023-01-09 13:59:19 -08:00
2023-01-09 13:59:19 -08:00
2023-01-09 13:59:19 -08:00
2023-01-09 13:59:19 -08:00
2023-01-09 13:59:19 -08:00
2022-10-12 08:09:34 -07:00
2022-12-28 01:21:52 -08:00
2022-10-04 13:59:32 -07:00
2023-02-02 07:50:12 -08:00
2023-01-09 13:59:19 -08:00
2023-01-09 13:59:19 -08:00
2022-10-04 13:59:32 -07:00
2022-10-04 13:59:32 -07:00
2022-10-04 13:59:32 -07:00
2022-10-04 13:59:32 -07:00
2022-10-04 13:59:32 -07:00