diff --git a/csharp/tests/Facebook.Yoga/YGAbsolutePositionTest.cs b/csharp/tests/Facebook.Yoga/YGAbsolutePositionTest.cs index 65806462..49f6605e 100644 --- a/csharp/tests/Facebook.Yoga/YGAbsolutePositionTest.cs +++ b/csharp/tests/Facebook.Yoga/YGAbsolutePositionTest.cs @@ -21,15 +21,15 @@ namespace Facebook.Yoga public void Test_absolute_layout_width_height_start_top() { YogaNode root = new YogaNode(); - root.Width = 100.Px(); - root.Height = 100.Px(); + root.Width = 100; + root.Height = 100; YogaNode root_child0 = new YogaNode(); root_child0.PositionType = YogaPositionType.Absolute; - root_child0.SetPosition(YogaEdge.Start, 10.Px()); - root_child0.SetPosition(YogaEdge.Top, 10.Px()); - root_child0.Width = 10.Px(); - root_child0.Height = 10.Px(); + root_child0.SetPosition(YogaEdge.Start, 10); + root_child0.SetPosition(YogaEdge.Top, 10); + root_child0.Width = 10; + root_child0.Height = 10; root.Insert(0, root_child0); root.StyleDirection = YogaDirection.LTR; root.CalculateLayout(); @@ -62,15 +62,15 @@ namespace Facebook.Yoga public void Test_absolute_layout_width_height_end_bottom() { YogaNode root = new YogaNode(); - root.Width = 100.Px(); - root.Height = 100.Px(); + root.Width = 100; + root.Height = 100; YogaNode root_child0 = new YogaNode(); root_child0.PositionType = YogaPositionType.Absolute; - root_child0.SetPosition(YogaEdge.End, 10.Px()); - root_child0.SetPosition(YogaEdge.Bottom, 10.Px()); - root_child0.Width = 10.Px(); - root_child0.Height = 10.Px(); + root_child0.SetPosition(YogaEdge.End, 10); + root_child0.SetPosition(YogaEdge.Bottom, 10); + root_child0.Width = 10; + root_child0.Height = 10; root.Insert(0, root_child0); root.StyleDirection = YogaDirection.LTR; root.CalculateLayout(); @@ -103,15 +103,15 @@ namespace Facebook.Yoga public void Test_absolute_layout_start_top_end_bottom() { YogaNode root = new YogaNode(); - root.Width = 100.Px(); - root.Height = 100.Px(); + root.Width = 100; + root.Height = 100; YogaNode root_child0 = new YogaNode(); root_child0.PositionType = YogaPositionType.Absolute; - root_child0.SetPosition(YogaEdge.Start, 10.Px()); - root_child0.SetPosition(YogaEdge.Top, 10.Px()); - root_child0.SetPosition(YogaEdge.End, 10.Px()); - root_child0.SetPosition(YogaEdge.Bottom, 10.Px()); + root_child0.SetPosition(YogaEdge.Start, 10); + root_child0.SetPosition(YogaEdge.Top, 10); + root_child0.SetPosition(YogaEdge.End, 10); + root_child0.SetPosition(YogaEdge.Bottom, 10); root.Insert(0, root_child0); root.StyleDirection = YogaDirection.LTR; root.CalculateLayout(); @@ -144,17 +144,17 @@ namespace Facebook.Yoga public void Test_absolute_layout_width_height_start_top_end_bottom() { YogaNode root = new YogaNode(); - root.Width = 100.Px(); - root.Height = 100.Px(); + root.Width = 100; + root.Height = 100; YogaNode root_child0 = new YogaNode(); root_child0.PositionType = YogaPositionType.Absolute; - root_child0.SetPosition(YogaEdge.Start, 10.Px()); - root_child0.SetPosition(YogaEdge.Top, 10.Px()); - root_child0.SetPosition(YogaEdge.End, 10.Px()); - root_child0.SetPosition(YogaEdge.Bottom, 10.Px()); - root_child0.Width = 10.Px(); - root_child0.Height = 10.Px(); + root_child0.SetPosition(YogaEdge.Start, 10); + root_child0.SetPosition(YogaEdge.Top, 10); + root_child0.SetPosition(YogaEdge.End, 10); + root_child0.SetPosition(YogaEdge.Bottom, 10); + root_child0.Width = 10; + root_child0.Height = 10; root.Insert(0, root_child0); root.StyleDirection = YogaDirection.LTR; root.CalculateLayout(); @@ -189,18 +189,18 @@ namespace Facebook.Yoga YogaNode root = new YogaNode(); root.FlexDirection = YogaFlexDirection.Row; root.Overflow = YogaOverflow.Hidden; - root.Width = 50.Px(); - root.Height = 50.Px(); + root.Width = 50; + root.Height = 50; YogaNode root_child0 = new YogaNode(); root_child0.PositionType = YogaPositionType.Absolute; - root_child0.SetPosition(YogaEdge.Start, 0.Px()); - root_child0.SetPosition(YogaEdge.Top, 0.Px()); + root_child0.SetPosition(YogaEdge.Start, 0); + root_child0.SetPosition(YogaEdge.Top, 0); root.Insert(0, root_child0); YogaNode root_child0_child0 = new YogaNode(); - root_child0_child0.Width = 100.Px(); - root_child0_child0.Height = 100.Px(); + root_child0_child0.Width = 100; + root_child0_child0.Height = 100; root_child0.Insert(0, root_child0_child0); root.StyleDirection = YogaDirection.LTR; root.CalculateLayout(); @@ -243,35 +243,35 @@ namespace Facebook.Yoga public void Test_absolute_layout_within_border() { YogaNode root = new YogaNode(); - root.SetMargin(YogaEdge.Left, 10.Px()); - root.SetMargin(YogaEdge.Top, 10.Px()); - root.SetMargin(YogaEdge.Right, 10.Px()); - root.SetMargin(YogaEdge.Bottom, 10.Px()); - root.SetPadding(YogaEdge.Left, 10.Px()); - root.SetPadding(YogaEdge.Top, 10.Px()); - root.SetPadding(YogaEdge.Right, 10.Px()); - root.SetPadding(YogaEdge.Bottom, 10.Px()); + root.SetMargin(YogaEdge.Left, 10); + root.SetMargin(YogaEdge.Top, 10); + root.SetMargin(YogaEdge.Right, 10); + root.SetMargin(YogaEdge.Bottom, 10); + root.SetPadding(YogaEdge.Left, 10); + root.SetPadding(YogaEdge.Top, 10); + root.SetPadding(YogaEdge.Right, 10); + root.SetPadding(YogaEdge.Bottom, 10); root.SetBorder(YogaEdge.Left, 10); root.SetBorder(YogaEdge.Top, 10); root.SetBorder(YogaEdge.Right, 10); root.SetBorder(YogaEdge.Bottom, 10); - root.Width = 100.Px(); - root.Height = 100.Px(); + root.Width = 100; + root.Height = 100; YogaNode root_child0 = new YogaNode(); root_child0.PositionType = YogaPositionType.Absolute; - root_child0.SetPosition(YogaEdge.Left, 0.Px()); - root_child0.SetPosition(YogaEdge.Top, 0.Px()); - root_child0.Width = 50.Px(); - root_child0.Height = 50.Px(); + root_child0.SetPosition(YogaEdge.Left, 0); + root_child0.SetPosition(YogaEdge.Top, 0); + root_child0.Width = 50; + root_child0.Height = 50; root.Insert(0, root_child0); YogaNode root_child1 = new YogaNode(); root_child1.PositionType = YogaPositionType.Absolute; - root_child1.SetPosition(YogaEdge.Right, 0.Px()); - root_child1.SetPosition(YogaEdge.Bottom, 0.Px()); - root_child1.Width = 50.Px(); - root_child1.Height = 50.Px(); + root_child1.SetPosition(YogaEdge.Right, 0); + root_child1.SetPosition(YogaEdge.Bottom, 0); + root_child1.Width = 50; + root_child1.Height = 50; root.Insert(1, root_child1); root.StyleDirection = YogaDirection.LTR; root.CalculateLayout(); diff --git a/csharp/tests/Facebook.Yoga/YGAlignContentTest.cs b/csharp/tests/Facebook.Yoga/YGAlignContentTest.cs index 42f0a6ac..288e30f8 100644 --- a/csharp/tests/Facebook.Yoga/YGAlignContentTest.cs +++ b/csharp/tests/Facebook.Yoga/YGAlignContentTest.cs @@ -22,32 +22,32 @@ namespace Facebook.Yoga { YogaNode root = new YogaNode(); root.Wrap = YogaWrap.Wrap; - root.Width = 100.Px(); - root.Height = 100.Px(); + root.Width = 100; + root.Height = 100; YogaNode root_child0 = new YogaNode(); - root_child0.Width = 50.Px(); - root_child0.Height = 10.Px(); + root_child0.Width = 50; + root_child0.Height = 10; root.Insert(0, root_child0); YogaNode root_child1 = new YogaNode(); - root_child1.Width = 50.Px(); - root_child1.Height = 10.Px(); + root_child1.Width = 50; + root_child1.Height = 10; root.Insert(1, root_child1); YogaNode root_child2 = new YogaNode(); - root_child2.Width = 50.Px(); - root_child2.Height = 10.Px(); + root_child2.Width = 50; + root_child2.Height = 10; root.Insert(2, root_child2); YogaNode root_child3 = new YogaNode(); - root_child3.Width = 50.Px(); - root_child3.Height = 10.Px(); + root_child3.Width = 50; + root_child3.Height = 10; root.Insert(3, root_child3); YogaNode root_child4 = new YogaNode(); - root_child4.Width = 50.Px(); - root_child4.Height = 10.Px(); + root_child4.Width = 50; + root_child4.Height = 10; root.Insert(4, root_child4); root.StyleDirection = YogaDirection.LTR; root.CalculateLayout(); @@ -122,32 +122,32 @@ namespace Facebook.Yoga YogaNode root = new YogaNode(); root.AlignContent = YogaAlign.FlexEnd; root.Wrap = YogaWrap.Wrap; - root.Width = 100.Px(); - root.Height = 100.Px(); + root.Width = 100; + root.Height = 100; YogaNode root_child0 = new YogaNode(); - root_child0.Width = 50.Px(); - root_child0.Height = 10.Px(); + root_child0.Width = 50; + root_child0.Height = 10; root.Insert(0, root_child0); YogaNode root_child1 = new YogaNode(); - root_child1.Width = 50.Px(); - root_child1.Height = 10.Px(); + root_child1.Width = 50; + root_child1.Height = 10; root.Insert(1, root_child1); YogaNode root_child2 = new YogaNode(); - root_child2.Width = 50.Px(); - root_child2.Height = 10.Px(); + root_child2.Width = 50; + root_child2.Height = 10; root.Insert(2, root_child2); YogaNode root_child3 = new YogaNode(); - root_child3.Width = 50.Px(); - root_child3.Height = 10.Px(); + root_child3.Width = 50; + root_child3.Height = 10; root.Insert(3, root_child3); YogaNode root_child4 = new YogaNode(); - root_child4.Width = 50.Px(); - root_child4.Height = 10.Px(); + root_child4.Width = 50; + root_child4.Height = 10; root.Insert(4, root_child4); root.StyleDirection = YogaDirection.LTR; root.CalculateLayout(); @@ -222,32 +222,32 @@ namespace Facebook.Yoga YogaNode root = new YogaNode(); root.AlignContent = YogaAlign.Center; root.Wrap = YogaWrap.Wrap; - root.Width = 100.Px(); - root.Height = 100.Px(); + root.Width = 100; + root.Height = 100; YogaNode root_child0 = new YogaNode(); - root_child0.Width = 50.Px(); - root_child0.Height = 10.Px(); + root_child0.Width = 50; + root_child0.Height = 10; root.Insert(0, root_child0); YogaNode root_child1 = new YogaNode(); - root_child1.Width = 50.Px(); - root_child1.Height = 10.Px(); + root_child1.Width = 50; + root_child1.Height = 10; root.Insert(1, root_child1); YogaNode root_child2 = new YogaNode(); - root_child2.Width = 50.Px(); - root_child2.Height = 10.Px(); + root_child2.Width = 50; + root_child2.Height = 10; root.Insert(2, root_child2); YogaNode root_child3 = new YogaNode(); - root_child3.Width = 50.Px(); - root_child3.Height = 10.Px(); + root_child3.Width = 50; + root_child3.Height = 10; root.Insert(3, root_child3); YogaNode root_child4 = new YogaNode(); - root_child4.Width = 50.Px(); - root_child4.Height = 10.Px(); + root_child4.Width = 50; + root_child4.Height = 10; root.Insert(4, root_child4); root.StyleDirection = YogaDirection.LTR; root.CalculateLayout(); @@ -322,27 +322,27 @@ namespace Facebook.Yoga YogaNode root = new YogaNode(); root.AlignContent = YogaAlign.Stretch; root.Wrap = YogaWrap.Wrap; - root.Width = 100.Px(); - root.Height = 100.Px(); + root.Width = 100; + root.Height = 100; YogaNode root_child0 = new YogaNode(); - root_child0.Width = 50.Px(); + root_child0.Width = 50; root.Insert(0, root_child0); YogaNode root_child1 = new YogaNode(); - root_child1.Width = 50.Px(); + root_child1.Width = 50; root.Insert(1, root_child1); YogaNode root_child2 = new YogaNode(); - root_child2.Width = 50.Px(); + root_child2.Width = 50; root.Insert(2, root_child2); YogaNode root_child3 = new YogaNode(); - root_child3.Width = 50.Px(); + root_child3.Width = 50; root.Insert(3, root_child3); YogaNode root_child4 = new YogaNode(); - root_child4.Width = 50.Px(); + root_child4.Width = 50; root.Insert(4, root_child4); root.StyleDirection = YogaDirection.LTR; root.CalculateLayout(); diff --git a/csharp/tests/Facebook.Yoga/YGAlignItemsTest.cs b/csharp/tests/Facebook.Yoga/YGAlignItemsTest.cs index daac3786..bcafe460 100644 --- a/csharp/tests/Facebook.Yoga/YGAlignItemsTest.cs +++ b/csharp/tests/Facebook.Yoga/YGAlignItemsTest.cs @@ -21,11 +21,11 @@ namespace Facebook.Yoga public void Test_align_items_stretch() { YogaNode root = new YogaNode(); - root.Width = 100.Px(); - root.Height = 100.Px(); + root.Width = 100; + root.Height = 100; YogaNode root_child0 = new YogaNode(); - root_child0.Height = 10.Px(); + root_child0.Height = 10; root.Insert(0, root_child0); root.StyleDirection = YogaDirection.LTR; root.CalculateLayout(); @@ -59,12 +59,12 @@ namespace Facebook.Yoga { YogaNode root = new YogaNode(); root.AlignItems = YogaAlign.Center; - root.Width = 100.Px(); - root.Height = 100.Px(); + root.Width = 100; + root.Height = 100; YogaNode root_child0 = new YogaNode(); - root_child0.Width = 10.Px(); - root_child0.Height = 10.Px(); + root_child0.Width = 10; + root_child0.Height = 10; root.Insert(0, root_child0); root.StyleDirection = YogaDirection.LTR; root.CalculateLayout(); @@ -98,12 +98,12 @@ namespace Facebook.Yoga { YogaNode root = new YogaNode(); root.AlignItems = YogaAlign.FlexStart; - root.Width = 100.Px(); - root.Height = 100.Px(); + root.Width = 100; + root.Height = 100; YogaNode root_child0 = new YogaNode(); - root_child0.Width = 10.Px(); - root_child0.Height = 10.Px(); + root_child0.Width = 10; + root_child0.Height = 10; root.Insert(0, root_child0); root.StyleDirection = YogaDirection.LTR; root.CalculateLayout(); @@ -137,12 +137,12 @@ namespace Facebook.Yoga { YogaNode root = new YogaNode(); root.AlignItems = YogaAlign.FlexEnd; - root.Width = 100.Px(); - root.Height = 100.Px(); + root.Width = 100; + root.Height = 100; YogaNode root_child0 = new YogaNode(); - root_child0.Width = 10.Px(); - root_child0.Height = 10.Px(); + root_child0.Width = 10; + root_child0.Height = 10; root.Insert(0, root_child0); root.StyleDirection = YogaDirection.LTR; root.CalculateLayout(); diff --git a/csharp/tests/Facebook.Yoga/YGAlignSelfTest.cs b/csharp/tests/Facebook.Yoga/YGAlignSelfTest.cs index acf64a83..b4ca0e13 100644 --- a/csharp/tests/Facebook.Yoga/YGAlignSelfTest.cs +++ b/csharp/tests/Facebook.Yoga/YGAlignSelfTest.cs @@ -21,13 +21,13 @@ namespace Facebook.Yoga public void Test_align_self_center() { YogaNode root = new YogaNode(); - root.Width = 100.Px(); - root.Height = 100.Px(); + root.Width = 100; + root.Height = 100; YogaNode root_child0 = new YogaNode(); root_child0.AlignSelf = YogaAlign.Center; - root_child0.Width = 10.Px(); - root_child0.Height = 10.Px(); + root_child0.Width = 10; + root_child0.Height = 10; root.Insert(0, root_child0); root.StyleDirection = YogaDirection.LTR; root.CalculateLayout(); @@ -60,13 +60,13 @@ namespace Facebook.Yoga public void Test_align_self_flex_end() { YogaNode root = new YogaNode(); - root.Width = 100.Px(); - root.Height = 100.Px(); + root.Width = 100; + root.Height = 100; YogaNode root_child0 = new YogaNode(); root_child0.AlignSelf = YogaAlign.FlexEnd; - root_child0.Width = 10.Px(); - root_child0.Height = 10.Px(); + root_child0.Width = 10; + root_child0.Height = 10; root.Insert(0, root_child0); root.StyleDirection = YogaDirection.LTR; root.CalculateLayout(); @@ -99,13 +99,13 @@ namespace Facebook.Yoga public void Test_align_self_flex_start() { YogaNode root = new YogaNode(); - root.Width = 100.Px(); - root.Height = 100.Px(); + root.Width = 100; + root.Height = 100; YogaNode root_child0 = new YogaNode(); root_child0.AlignSelf = YogaAlign.FlexStart; - root_child0.Width = 10.Px(); - root_child0.Height = 10.Px(); + root_child0.Width = 10; + root_child0.Height = 10; root.Insert(0, root_child0); root.StyleDirection = YogaDirection.LTR; root.CalculateLayout(); @@ -139,13 +139,13 @@ namespace Facebook.Yoga { YogaNode root = new YogaNode(); root.AlignItems = YogaAlign.FlexStart; - root.Width = 100.Px(); - root.Height = 100.Px(); + root.Width = 100; + root.Height = 100; YogaNode root_child0 = new YogaNode(); root_child0.AlignSelf = YogaAlign.FlexEnd; - root_child0.Width = 10.Px(); - root_child0.Height = 10.Px(); + root_child0.Width = 10; + root_child0.Height = 10; root.Insert(0, root_child0); root.StyleDirection = YogaDirection.LTR; root.CalculateLayout(); diff --git a/csharp/tests/Facebook.Yoga/YGBorderTest.cs b/csharp/tests/Facebook.Yoga/YGBorderTest.cs index 324411ae..86029fca 100644 --- a/csharp/tests/Facebook.Yoga/YGBorderTest.cs +++ b/csharp/tests/Facebook.Yoga/YGBorderTest.cs @@ -52,8 +52,8 @@ namespace Facebook.Yoga root.SetBorder(YogaEdge.Bottom, 10); YogaNode root_child0 = new YogaNode(); - root_child0.Width = 10.Px(); - root_child0.Height = 10.Px(); + root_child0.Width = 10; + root_child0.Height = 10; root.Insert(0, root_child0); root.StyleDirection = YogaDirection.LTR; root.CalculateLayout(); @@ -90,12 +90,12 @@ namespace Facebook.Yoga root.SetBorder(YogaEdge.Top, 10); root.SetBorder(YogaEdge.Right, 10); root.SetBorder(YogaEdge.Bottom, 10); - root.Width = 100.Px(); - root.Height = 100.Px(); + root.Width = 100; + root.Height = 100; YogaNode root_child0 = new YogaNode(); root_child0.FlexGrow = 1; - root_child0.Width = 10.Px(); + root_child0.Width = 10; root.Insert(0, root_child0); root.StyleDirection = YogaDirection.LTR; root.CalculateLayout(); @@ -132,11 +132,11 @@ namespace Facebook.Yoga root.SetBorder(YogaEdge.Top, 10); root.SetBorder(YogaEdge.Right, 10); root.SetBorder(YogaEdge.Bottom, 10); - root.Width = 100.Px(); - root.Height = 100.Px(); + root.Width = 100; + root.Height = 100; YogaNode root_child0 = new YogaNode(); - root_child0.Height = 10.Px(); + root_child0.Height = 10; root.Insert(0, root_child0); root.StyleDirection = YogaDirection.LTR; root.CalculateLayout(); @@ -174,12 +174,12 @@ namespace Facebook.Yoga root.SetBorder(YogaEdge.Start, 10); root.SetBorder(YogaEdge.End, 20); root.SetBorder(YogaEdge.Bottom, 20); - root.Width = 100.Px(); - root.Height = 100.Px(); + root.Width = 100; + root.Height = 100; YogaNode root_child0 = new YogaNode(); - root_child0.Width = 10.Px(); - root_child0.Height = 10.Px(); + root_child0.Width = 10; + root_child0.Height = 10; root.Insert(0, root_child0); root.StyleDirection = YogaDirection.LTR; root.CalculateLayout(); diff --git a/csharp/tests/Facebook.Yoga/YGFlexDirectionTest.cs b/csharp/tests/Facebook.Yoga/YGFlexDirectionTest.cs index dfbd5c23..8063b48a 100644 --- a/csharp/tests/Facebook.Yoga/YGFlexDirectionTest.cs +++ b/csharp/tests/Facebook.Yoga/YGFlexDirectionTest.cs @@ -21,18 +21,18 @@ namespace Facebook.Yoga public void Test_flex_direction_column_no_height() { YogaNode root = new YogaNode(); - root.Width = 100.Px(); + root.Width = 100; YogaNode root_child0 = new YogaNode(); - root_child0.Height = 10.Px(); + root_child0.Height = 10; root.Insert(0, root_child0); YogaNode root_child1 = new YogaNode(); - root_child1.Height = 10.Px(); + root_child1.Height = 10; root.Insert(1, root_child1); YogaNode root_child2 = new YogaNode(); - root_child2.Height = 10.Px(); + root_child2.Height = 10; root.Insert(2, root_child2); root.StyleDirection = YogaDirection.LTR; root.CalculateLayout(); @@ -86,18 +86,18 @@ namespace Facebook.Yoga { YogaNode root = new YogaNode(); root.FlexDirection = YogaFlexDirection.Row; - root.Height = 100.Px(); + root.Height = 100; YogaNode root_child0 = new YogaNode(); - root_child0.Width = 10.Px(); + root_child0.Width = 10; root.Insert(0, root_child0); YogaNode root_child1 = new YogaNode(); - root_child1.Width = 10.Px(); + root_child1.Width = 10; root.Insert(1, root_child1); YogaNode root_child2 = new YogaNode(); - root_child2.Width = 10.Px(); + root_child2.Width = 10; root.Insert(2, root_child2); root.StyleDirection = YogaDirection.LTR; root.CalculateLayout(); @@ -150,19 +150,19 @@ namespace Facebook.Yoga public void Test_flex_direction_column() { YogaNode root = new YogaNode(); - root.Width = 100.Px(); - root.Height = 100.Px(); + root.Width = 100; + root.Height = 100; YogaNode root_child0 = new YogaNode(); - root_child0.Height = 10.Px(); + root_child0.Height = 10; root.Insert(0, root_child0); YogaNode root_child1 = new YogaNode(); - root_child1.Height = 10.Px(); + root_child1.Height = 10; root.Insert(1, root_child1); YogaNode root_child2 = new YogaNode(); - root_child2.Height = 10.Px(); + root_child2.Height = 10; root.Insert(2, root_child2); root.StyleDirection = YogaDirection.LTR; root.CalculateLayout(); @@ -216,19 +216,19 @@ namespace Facebook.Yoga { YogaNode root = new YogaNode(); root.FlexDirection = YogaFlexDirection.Row; - root.Width = 100.Px(); - root.Height = 100.Px(); + root.Width = 100; + root.Height = 100; YogaNode root_child0 = new YogaNode(); - root_child0.Width = 10.Px(); + root_child0.Width = 10; root.Insert(0, root_child0); YogaNode root_child1 = new YogaNode(); - root_child1.Width = 10.Px(); + root_child1.Width = 10; root.Insert(1, root_child1); YogaNode root_child2 = new YogaNode(); - root_child2.Width = 10.Px(); + root_child2.Width = 10; root.Insert(2, root_child2); root.StyleDirection = YogaDirection.LTR; root.CalculateLayout(); @@ -282,19 +282,19 @@ namespace Facebook.Yoga { YogaNode root = new YogaNode(); root.FlexDirection = YogaFlexDirection.ColumnReverse; - root.Width = 100.Px(); - root.Height = 100.Px(); + root.Width = 100; + root.Height = 100; YogaNode root_child0 = new YogaNode(); - root_child0.Height = 10.Px(); + root_child0.Height = 10; root.Insert(0, root_child0); YogaNode root_child1 = new YogaNode(); - root_child1.Height = 10.Px(); + root_child1.Height = 10; root.Insert(1, root_child1); YogaNode root_child2 = new YogaNode(); - root_child2.Height = 10.Px(); + root_child2.Height = 10; root.Insert(2, root_child2); root.StyleDirection = YogaDirection.LTR; root.CalculateLayout(); @@ -348,19 +348,19 @@ namespace Facebook.Yoga { YogaNode root = new YogaNode(); root.FlexDirection = YogaFlexDirection.RowReverse; - root.Width = 100.Px(); - root.Height = 100.Px(); + root.Width = 100; + root.Height = 100; YogaNode root_child0 = new YogaNode(); - root_child0.Width = 10.Px(); + root_child0.Width = 10; root.Insert(0, root_child0); YogaNode root_child1 = new YogaNode(); - root_child1.Width = 10.Px(); + root_child1.Width = 10; root.Insert(1, root_child1); YogaNode root_child2 = new YogaNode(); - root_child2.Width = 10.Px(); + root_child2.Width = 10; root.Insert(2, root_child2); root.StyleDirection = YogaDirection.LTR; root.CalculateLayout(); diff --git a/csharp/tests/Facebook.Yoga/YGFlexTest.cs b/csharp/tests/Facebook.Yoga/YGFlexTest.cs index 850e0969..3826fa9a 100644 --- a/csharp/tests/Facebook.Yoga/YGFlexTest.cs +++ b/csharp/tests/Facebook.Yoga/YGFlexTest.cs @@ -21,12 +21,12 @@ namespace Facebook.Yoga public void Test_flex_basis_flex_grow_column() { YogaNode root = new YogaNode(); - root.Width = 100.Px(); - root.Height = 100.Px(); + root.Width = 100; + root.Height = 100; YogaNode root_child0 = new YogaNode(); root_child0.FlexGrow = 1; - root_child0.FlexBasis = 50.Px(); + root_child0.FlexBasis = 50; root.Insert(0, root_child0); YogaNode root_child1 = new YogaNode(); @@ -74,12 +74,12 @@ namespace Facebook.Yoga { YogaNode root = new YogaNode(); root.FlexDirection = YogaFlexDirection.Row; - root.Width = 100.Px(); - root.Height = 100.Px(); + root.Width = 100; + root.Height = 100; YogaNode root_child0 = new YogaNode(); root_child0.FlexGrow = 1; - root_child0.FlexBasis = 50.Px(); + root_child0.FlexBasis = 50; root.Insert(0, root_child0); YogaNode root_child1 = new YogaNode(); @@ -126,16 +126,16 @@ namespace Facebook.Yoga public void Test_flex_basis_flex_shrink_column() { YogaNode root = new YogaNode(); - root.Width = 100.Px(); - root.Height = 100.Px(); + root.Width = 100; + root.Height = 100; YogaNode root_child0 = new YogaNode(); root_child0.FlexShrink = 1; - root_child0.FlexBasis = 100.Px(); + root_child0.FlexBasis = 100; root.Insert(0, root_child0); YogaNode root_child1 = new YogaNode(); - root_child1.FlexBasis = 50.Px(); + root_child1.FlexBasis = 50; root.Insert(1, root_child1); root.StyleDirection = YogaDirection.LTR; root.CalculateLayout(); @@ -179,16 +179,16 @@ namespace Facebook.Yoga { YogaNode root = new YogaNode(); root.FlexDirection = YogaFlexDirection.Row; - root.Width = 100.Px(); - root.Height = 100.Px(); + root.Width = 100; + root.Height = 100; YogaNode root_child0 = new YogaNode(); root_child0.FlexShrink = 1; - root_child0.FlexBasis = 100.Px(); + root_child0.FlexBasis = 100; root.Insert(0, root_child0); YogaNode root_child1 = new YogaNode(); - root_child1.FlexBasis = 50.Px(); + root_child1.FlexBasis = 50; root.Insert(1, root_child1); root.StyleDirection = YogaDirection.LTR; root.CalculateLayout(); @@ -231,22 +231,22 @@ namespace Facebook.Yoga public void Test_flex_shrink_to_zero() { YogaNode root = new YogaNode(); - root.Height = 75.Px(); + root.Height = 75; YogaNode root_child0 = new YogaNode(); - root_child0.Width = 50.Px(); - root_child0.Height = 50.Px(); + root_child0.Width = 50; + root_child0.Height = 50; root.Insert(0, root_child0); YogaNode root_child1 = new YogaNode(); root_child1.FlexShrink = 1; - root_child1.Width = 50.Px(); - root_child1.Height = 50.Px(); + root_child1.Width = 50; + root_child1.Height = 50; root.Insert(1, root_child1); YogaNode root_child2 = new YogaNode(); - root_child2.Width = 50.Px(); - root_child2.Height = 50.Px(); + root_child2.Width = 50; + root_child2.Height = 50; root.Insert(2, root_child2); root.StyleDirection = YogaDirection.LTR; root.CalculateLayout(); @@ -299,23 +299,23 @@ namespace Facebook.Yoga public void Test_flex_basis_overrides_main_size() { YogaNode root = new YogaNode(); - root.Width = 100.Px(); - root.Height = 100.Px(); + root.Width = 100; + root.Height = 100; YogaNode root_child0 = new YogaNode(); root_child0.FlexGrow = 1; - root_child0.FlexBasis = 50.Px(); - root_child0.Height = 20.Px(); + root_child0.FlexBasis = 50; + root_child0.Height = 20; root.Insert(0, root_child0); YogaNode root_child1 = new YogaNode(); root_child1.FlexGrow = 1; - root_child1.Height = 10.Px(); + root_child1.Height = 10; root.Insert(1, root_child1); YogaNode root_child2 = new YogaNode(); root_child2.FlexGrow = 1; - root_child2.Height = 10.Px(); + root_child2.Height = 10; root.Insert(2, root_child2); root.StyleDirection = YogaDirection.LTR; root.CalculateLayout(); @@ -368,8 +368,8 @@ namespace Facebook.Yoga public void Test_flex_grow_shrink_at_most() { YogaNode root = new YogaNode(); - root.Width = 100.Px(); - root.Height = 100.Px(); + root.Width = 100; + root.Height = 100; YogaNode root_child0 = new YogaNode(); root.Insert(0, root_child0); diff --git a/csharp/tests/Facebook.Yoga/YGFlexWrapTest.cs b/csharp/tests/Facebook.Yoga/YGFlexWrapTest.cs index aae223ab..c4a0c352 100644 --- a/csharp/tests/Facebook.Yoga/YGFlexWrapTest.cs +++ b/csharp/tests/Facebook.Yoga/YGFlexWrapTest.cs @@ -22,26 +22,26 @@ namespace Facebook.Yoga { YogaNode root = new YogaNode(); root.Wrap = YogaWrap.Wrap; - root.Height = 100.Px(); + root.Height = 100; YogaNode root_child0 = new YogaNode(); - root_child0.Width = 30.Px(); - root_child0.Height = 30.Px(); + root_child0.Width = 30; + root_child0.Height = 30; root.Insert(0, root_child0); YogaNode root_child1 = new YogaNode(); - root_child1.Width = 30.Px(); - root_child1.Height = 30.Px(); + root_child1.Width = 30; + root_child1.Height = 30; root.Insert(1, root_child1); YogaNode root_child2 = new YogaNode(); - root_child2.Width = 30.Px(); - root_child2.Height = 30.Px(); + root_child2.Width = 30; + root_child2.Height = 30; root.Insert(2, root_child2); YogaNode root_child3 = new YogaNode(); - root_child3.Width = 30.Px(); - root_child3.Height = 30.Px(); + root_child3.Width = 30; + root_child3.Height = 30; root.Insert(3, root_child3); root.StyleDirection = YogaDirection.LTR; root.CalculateLayout(); @@ -106,26 +106,26 @@ namespace Facebook.Yoga YogaNode root = new YogaNode(); root.FlexDirection = YogaFlexDirection.Row; root.Wrap = YogaWrap.Wrap; - root.Width = 100.Px(); + root.Width = 100; YogaNode root_child0 = new YogaNode(); - root_child0.Width = 30.Px(); - root_child0.Height = 30.Px(); + root_child0.Width = 30; + root_child0.Height = 30; root.Insert(0, root_child0); YogaNode root_child1 = new YogaNode(); - root_child1.Width = 30.Px(); - root_child1.Height = 30.Px(); + root_child1.Width = 30; + root_child1.Height = 30; root.Insert(1, root_child1); YogaNode root_child2 = new YogaNode(); - root_child2.Width = 30.Px(); - root_child2.Height = 30.Px(); + root_child2.Width = 30; + root_child2.Height = 30; root.Insert(2, root_child2); YogaNode root_child3 = new YogaNode(); - root_child3.Width = 30.Px(); - root_child3.Height = 30.Px(); + root_child3.Width = 30; + root_child3.Height = 30; root.Insert(3, root_child3); root.StyleDirection = YogaDirection.LTR; root.CalculateLayout(); @@ -191,26 +191,26 @@ namespace Facebook.Yoga root.FlexDirection = YogaFlexDirection.Row; root.AlignItems = YogaAlign.FlexEnd; root.Wrap = YogaWrap.Wrap; - root.Width = 100.Px(); + root.Width = 100; YogaNode root_child0 = new YogaNode(); - root_child0.Width = 30.Px(); - root_child0.Height = 10.Px(); + root_child0.Width = 30; + root_child0.Height = 10; root.Insert(0, root_child0); YogaNode root_child1 = new YogaNode(); - root_child1.Width = 30.Px(); - root_child1.Height = 20.Px(); + root_child1.Width = 30; + root_child1.Height = 20; root.Insert(1, root_child1); YogaNode root_child2 = new YogaNode(); - root_child2.Width = 30.Px(); - root_child2.Height = 30.Px(); + root_child2.Width = 30; + root_child2.Height = 30; root.Insert(2, root_child2); YogaNode root_child3 = new YogaNode(); - root_child3.Width = 30.Px(); - root_child3.Height = 30.Px(); + root_child3.Width = 30; + root_child3.Height = 30; root.Insert(3, root_child3); root.StyleDirection = YogaDirection.LTR; root.CalculateLayout(); @@ -276,26 +276,26 @@ namespace Facebook.Yoga root.FlexDirection = YogaFlexDirection.Row; root.AlignItems = YogaAlign.Center; root.Wrap = YogaWrap.Wrap; - root.Width = 100.Px(); + root.Width = 100; YogaNode root_child0 = new YogaNode(); - root_child0.Width = 30.Px(); - root_child0.Height = 10.Px(); + root_child0.Width = 30; + root_child0.Height = 10; root.Insert(0, root_child0); YogaNode root_child1 = new YogaNode(); - root_child1.Width = 30.Px(); - root_child1.Height = 20.Px(); + root_child1.Width = 30; + root_child1.Height = 20; root.Insert(1, root_child1); YogaNode root_child2 = new YogaNode(); - root_child2.Width = 30.Px(); - root_child2.Height = 30.Px(); + root_child2.Width = 30; + root_child2.Height = 30; root.Insert(2, root_child2); YogaNode root_child3 = new YogaNode(); - root_child3.Width = 30.Px(); - root_child3.Height = 30.Px(); + root_child3.Width = 30; + root_child3.Height = 30; root.Insert(3, root_child3); root.StyleDirection = YogaDirection.LTR; root.CalculateLayout(); diff --git a/csharp/tests/Facebook.Yoga/YGJustifyContentTest.cs b/csharp/tests/Facebook.Yoga/YGJustifyContentTest.cs index 060a2899..b36f9551 100644 --- a/csharp/tests/Facebook.Yoga/YGJustifyContentTest.cs +++ b/csharp/tests/Facebook.Yoga/YGJustifyContentTest.cs @@ -22,19 +22,19 @@ namespace Facebook.Yoga { YogaNode root = new YogaNode(); root.FlexDirection = YogaFlexDirection.Row; - root.Width = 102.Px(); - root.Height = 102.Px(); + root.Width = 102; + root.Height = 102; YogaNode root_child0 = new YogaNode(); - root_child0.Width = 10.Px(); + root_child0.Width = 10; root.Insert(0, root_child0); YogaNode root_child1 = new YogaNode(); - root_child1.Width = 10.Px(); + root_child1.Width = 10; root.Insert(1, root_child1); YogaNode root_child2 = new YogaNode(); - root_child2.Width = 10.Px(); + root_child2.Width = 10; root.Insert(2, root_child2); root.StyleDirection = YogaDirection.LTR; root.CalculateLayout(); @@ -89,19 +89,19 @@ namespace Facebook.Yoga YogaNode root = new YogaNode(); root.FlexDirection = YogaFlexDirection.Row; root.JustifyContent = YogaJustify.FlexEnd; - root.Width = 102.Px(); - root.Height = 102.Px(); + root.Width = 102; + root.Height = 102; YogaNode root_child0 = new YogaNode(); - root_child0.Width = 10.Px(); + root_child0.Width = 10; root.Insert(0, root_child0); YogaNode root_child1 = new YogaNode(); - root_child1.Width = 10.Px(); + root_child1.Width = 10; root.Insert(1, root_child1); YogaNode root_child2 = new YogaNode(); - root_child2.Width = 10.Px(); + root_child2.Width = 10; root.Insert(2, root_child2); root.StyleDirection = YogaDirection.LTR; root.CalculateLayout(); @@ -156,19 +156,19 @@ namespace Facebook.Yoga YogaNode root = new YogaNode(); root.FlexDirection = YogaFlexDirection.Row; root.JustifyContent = YogaJustify.Center; - root.Width = 102.Px(); - root.Height = 102.Px(); + root.Width = 102; + root.Height = 102; YogaNode root_child0 = new YogaNode(); - root_child0.Width = 10.Px(); + root_child0.Width = 10; root.Insert(0, root_child0); YogaNode root_child1 = new YogaNode(); - root_child1.Width = 10.Px(); + root_child1.Width = 10; root.Insert(1, root_child1); YogaNode root_child2 = new YogaNode(); - root_child2.Width = 10.Px(); + root_child2.Width = 10; root.Insert(2, root_child2); root.StyleDirection = YogaDirection.LTR; root.CalculateLayout(); @@ -223,19 +223,19 @@ namespace Facebook.Yoga YogaNode root = new YogaNode(); root.FlexDirection = YogaFlexDirection.Row; root.JustifyContent = YogaJustify.SpaceBetween; - root.Width = 102.Px(); - root.Height = 102.Px(); + root.Width = 102; + root.Height = 102; YogaNode root_child0 = new YogaNode(); - root_child0.Width = 10.Px(); + root_child0.Width = 10; root.Insert(0, root_child0); YogaNode root_child1 = new YogaNode(); - root_child1.Width = 10.Px(); + root_child1.Width = 10; root.Insert(1, root_child1); YogaNode root_child2 = new YogaNode(); - root_child2.Width = 10.Px(); + root_child2.Width = 10; root.Insert(2, root_child2); root.StyleDirection = YogaDirection.LTR; root.CalculateLayout(); @@ -290,19 +290,19 @@ namespace Facebook.Yoga YogaNode root = new YogaNode(); root.FlexDirection = YogaFlexDirection.Row; root.JustifyContent = YogaJustify.SpaceAround; - root.Width = 102.Px(); - root.Height = 102.Px(); + root.Width = 102; + root.Height = 102; YogaNode root_child0 = new YogaNode(); - root_child0.Width = 10.Px(); + root_child0.Width = 10; root.Insert(0, root_child0); YogaNode root_child1 = new YogaNode(); - root_child1.Width = 10.Px(); + root_child1.Width = 10; root.Insert(1, root_child1); YogaNode root_child2 = new YogaNode(); - root_child2.Width = 10.Px(); + root_child2.Width = 10; root.Insert(2, root_child2); root.StyleDirection = YogaDirection.LTR; root.CalculateLayout(); @@ -355,18 +355,18 @@ namespace Facebook.Yoga public void Test_justify_content_column_flex_start() { YogaNode root = new YogaNode(); - root.Width = 102.Px(); - root.Height = 102.Px(); + root.Width = 102; + root.Height = 102; YogaNode root_child0 = new YogaNode(); - root_child0.Height = 10.Px(); + root_child0.Height = 10; root.Insert(0, root_child0); YogaNode root_child1 = new YogaNode(); root.Insert(1, root_child1); YogaNode root_child2 = new YogaNode(); - root_child2.Height = 10.Px(); + root_child2.Height = 10; root.Insert(2, root_child2); root.StyleDirection = YogaDirection.LTR; root.CalculateLayout(); @@ -420,19 +420,19 @@ namespace Facebook.Yoga { YogaNode root = new YogaNode(); root.JustifyContent = YogaJustify.FlexEnd; - root.Width = 102.Px(); - root.Height = 102.Px(); + root.Width = 102; + root.Height = 102; YogaNode root_child0 = new YogaNode(); - root_child0.Height = 10.Px(); + root_child0.Height = 10; root.Insert(0, root_child0); YogaNode root_child1 = new YogaNode(); - root_child1.Height = 10.Px(); + root_child1.Height = 10; root.Insert(1, root_child1); YogaNode root_child2 = new YogaNode(); - root_child2.Height = 10.Px(); + root_child2.Height = 10; root.Insert(2, root_child2); root.StyleDirection = YogaDirection.LTR; root.CalculateLayout(); @@ -486,19 +486,19 @@ namespace Facebook.Yoga { YogaNode root = new YogaNode(); root.JustifyContent = YogaJustify.Center; - root.Width = 102.Px(); - root.Height = 102.Px(); + root.Width = 102; + root.Height = 102; YogaNode root_child0 = new YogaNode(); - root_child0.Height = 10.Px(); + root_child0.Height = 10; root.Insert(0, root_child0); YogaNode root_child1 = new YogaNode(); - root_child1.Height = 10.Px(); + root_child1.Height = 10; root.Insert(1, root_child1); YogaNode root_child2 = new YogaNode(); - root_child2.Height = 10.Px(); + root_child2.Height = 10; root.Insert(2, root_child2); root.StyleDirection = YogaDirection.LTR; root.CalculateLayout(); @@ -552,19 +552,19 @@ namespace Facebook.Yoga { YogaNode root = new YogaNode(); root.JustifyContent = YogaJustify.SpaceBetween; - root.Width = 102.Px(); - root.Height = 102.Px(); + root.Width = 102; + root.Height = 102; YogaNode root_child0 = new YogaNode(); - root_child0.Height = 10.Px(); + root_child0.Height = 10; root.Insert(0, root_child0); YogaNode root_child1 = new YogaNode(); - root_child1.Height = 10.Px(); + root_child1.Height = 10; root.Insert(1, root_child1); YogaNode root_child2 = new YogaNode(); - root_child2.Height = 10.Px(); + root_child2.Height = 10; root.Insert(2, root_child2); root.StyleDirection = YogaDirection.LTR; root.CalculateLayout(); @@ -618,19 +618,19 @@ namespace Facebook.Yoga { YogaNode root = new YogaNode(); root.JustifyContent = YogaJustify.SpaceAround; - root.Width = 102.Px(); - root.Height = 102.Px(); + root.Width = 102; + root.Height = 102; YogaNode root_child0 = new YogaNode(); - root_child0.Height = 10.Px(); + root_child0.Height = 10; root.Insert(0, root_child0); YogaNode root_child1 = new YogaNode(); - root_child1.Height = 10.Px(); + root_child1.Height = 10; root.Insert(1, root_child1); YogaNode root_child2 = new YogaNode(); - root_child2.Height = 10.Px(); + root_child2.Height = 10; root.Insert(2, root_child2); root.StyleDirection = YogaDirection.LTR; root.CalculateLayout(); diff --git a/csharp/tests/Facebook.Yoga/YGMarginTest.cs b/csharp/tests/Facebook.Yoga/YGMarginTest.cs index 9c070235..cc017ac4 100644 --- a/csharp/tests/Facebook.Yoga/YGMarginTest.cs +++ b/csharp/tests/Facebook.Yoga/YGMarginTest.cs @@ -22,12 +22,12 @@ namespace Facebook.Yoga { YogaNode root = new YogaNode(); root.FlexDirection = YogaFlexDirection.Row; - root.Width = 100.Px(); - root.Height = 100.Px(); + root.Width = 100; + root.Height = 100; YogaNode root_child0 = new YogaNode(); - root_child0.SetMargin(YogaEdge.Start, 10.Px()); - root_child0.Width = 10.Px(); + root_child0.SetMargin(YogaEdge.Start, 10); + root_child0.Width = 10; root.Insert(0, root_child0); root.StyleDirection = YogaDirection.LTR; root.CalculateLayout(); @@ -60,12 +60,12 @@ namespace Facebook.Yoga public void Test_margin_top() { YogaNode root = new YogaNode(); - root.Width = 100.Px(); - root.Height = 100.Px(); + root.Width = 100; + root.Height = 100; YogaNode root_child0 = new YogaNode(); - root_child0.SetMargin(YogaEdge.Top, 10.Px()); - root_child0.Height = 10.Px(); + root_child0.SetMargin(YogaEdge.Top, 10); + root_child0.Height = 10; root.Insert(0, root_child0); root.StyleDirection = YogaDirection.LTR; root.CalculateLayout(); @@ -100,12 +100,12 @@ namespace Facebook.Yoga YogaNode root = new YogaNode(); root.FlexDirection = YogaFlexDirection.Row; root.JustifyContent = YogaJustify.FlexEnd; - root.Width = 100.Px(); - root.Height = 100.Px(); + root.Width = 100; + root.Height = 100; YogaNode root_child0 = new YogaNode(); - root_child0.SetMargin(YogaEdge.End, 10.Px()); - root_child0.Width = 10.Px(); + root_child0.SetMargin(YogaEdge.End, 10); + root_child0.Width = 10; root.Insert(0, root_child0); root.StyleDirection = YogaDirection.LTR; root.CalculateLayout(); @@ -139,12 +139,12 @@ namespace Facebook.Yoga { YogaNode root = new YogaNode(); root.JustifyContent = YogaJustify.FlexEnd; - root.Width = 100.Px(); - root.Height = 100.Px(); + root.Width = 100; + root.Height = 100; YogaNode root_child0 = new YogaNode(); - root_child0.SetMargin(YogaEdge.Bottom, 10.Px()); - root_child0.Height = 10.Px(); + root_child0.SetMargin(YogaEdge.Bottom, 10); + root_child0.Height = 10; root.Insert(0, root_child0); root.StyleDirection = YogaDirection.LTR; root.CalculateLayout(); @@ -178,12 +178,12 @@ namespace Facebook.Yoga { YogaNode root = new YogaNode(); root.FlexDirection = YogaFlexDirection.Row; - root.Width = 100.Px(); - root.Height = 100.Px(); + root.Width = 100; + root.Height = 100; YogaNode root_child0 = new YogaNode(); root_child0.FlexGrow = 1; - root_child0.SetMargin(YogaEdge.Start, 10.Px()); + root_child0.SetMargin(YogaEdge.Start, 10); root.Insert(0, root_child0); root.StyleDirection = YogaDirection.LTR; root.CalculateLayout(); @@ -216,12 +216,12 @@ namespace Facebook.Yoga public void Test_margin_and_flex_column() { YogaNode root = new YogaNode(); - root.Width = 100.Px(); - root.Height = 100.Px(); + root.Width = 100; + root.Height = 100; YogaNode root_child0 = new YogaNode(); root_child0.FlexGrow = 1; - root_child0.SetMargin(YogaEdge.Top, 10.Px()); + root_child0.SetMargin(YogaEdge.Top, 10); root.Insert(0, root_child0); root.StyleDirection = YogaDirection.LTR; root.CalculateLayout(); @@ -255,12 +255,12 @@ namespace Facebook.Yoga { YogaNode root = new YogaNode(); root.FlexDirection = YogaFlexDirection.Row; - root.Width = 100.Px(); - root.Height = 100.Px(); + root.Width = 100; + root.Height = 100; YogaNode root_child0 = new YogaNode(); root_child0.FlexGrow = 1; - root_child0.SetMargin(YogaEdge.Top, 10.Px()); + root_child0.SetMargin(YogaEdge.Top, 10); root.Insert(0, root_child0); root.StyleDirection = YogaDirection.LTR; root.CalculateLayout(); @@ -293,12 +293,12 @@ namespace Facebook.Yoga public void Test_margin_and_stretch_column() { YogaNode root = new YogaNode(); - root.Width = 100.Px(); - root.Height = 100.Px(); + root.Width = 100; + root.Height = 100; YogaNode root_child0 = new YogaNode(); root_child0.FlexGrow = 1; - root_child0.SetMargin(YogaEdge.Start, 10.Px()); + root_child0.SetMargin(YogaEdge.Start, 10); root.Insert(0, root_child0); root.StyleDirection = YogaDirection.LTR; root.CalculateLayout(); @@ -332,8 +332,8 @@ namespace Facebook.Yoga { YogaNode root = new YogaNode(); root.FlexDirection = YogaFlexDirection.Row; - root.Width = 100.Px(); - root.Height = 100.Px(); + root.Width = 100; + root.Height = 100; YogaNode root_child0 = new YogaNode(); root_child0.FlexGrow = 1; @@ -383,8 +383,8 @@ namespace Facebook.Yoga public void Test_margin_with_sibling_column() { YogaNode root = new YogaNode(); - root.Width = 100.Px(); - root.Height = 100.Px(); + root.Width = 100; + root.Height = 100; YogaNode root_child0 = new YogaNode(); root_child0.FlexGrow = 1; diff --git a/csharp/tests/Facebook.Yoga/YGMinMaxDimensionTest.cs b/csharp/tests/Facebook.Yoga/YGMinMaxDimensionTest.cs index 857e65b7..47568b6e 100644 --- a/csharp/tests/Facebook.Yoga/YGMinMaxDimensionTest.cs +++ b/csharp/tests/Facebook.Yoga/YGMinMaxDimensionTest.cs @@ -21,12 +21,12 @@ namespace Facebook.Yoga public void Test_max_width() { YogaNode root = new YogaNode(); - root.Width = 100.Px(); - root.Height = 100.Px(); + root.Width = 100; + root.Height = 100; YogaNode root_child0 = new YogaNode(); - root_child0.MaxWidth = 50.Px(); - root_child0.Height = 10.Px(); + root_child0.MaxWidth = 50; + root_child0.Height = 10; root.Insert(0, root_child0); root.StyleDirection = YogaDirection.LTR; root.CalculateLayout(); @@ -60,12 +60,12 @@ namespace Facebook.Yoga { YogaNode root = new YogaNode(); root.FlexDirection = YogaFlexDirection.Row; - root.Width = 100.Px(); - root.Height = 100.Px(); + root.Width = 100; + root.Height = 100; YogaNode root_child0 = new YogaNode(); - root_child0.Width = 10.Px(); - root_child0.MaxHeight = 50.Px(); + root_child0.Width = 10; + root_child0.MaxHeight = 50; root.Insert(0, root_child0); root.StyleDirection = YogaDirection.LTR; root.CalculateLayout(); @@ -98,12 +98,12 @@ namespace Facebook.Yoga public void Test_min_height() { YogaNode root = new YogaNode(); - root.Width = 100.Px(); - root.Height = 100.Px(); + root.Width = 100; + root.Height = 100; YogaNode root_child0 = new YogaNode(); root_child0.FlexGrow = 1; - root_child0.MinHeight = 60.Px(); + root_child0.MinHeight = 60; root.Insert(0, root_child0); YogaNode root_child1 = new YogaNode(); @@ -151,12 +151,12 @@ namespace Facebook.Yoga { YogaNode root = new YogaNode(); root.FlexDirection = YogaFlexDirection.Row; - root.Width = 100.Px(); - root.Height = 100.Px(); + root.Width = 100; + root.Height = 100; YogaNode root_child0 = new YogaNode(); root_child0.FlexGrow = 1; - root_child0.MinWidth = 60.Px(); + root_child0.MinWidth = 60; root.Insert(0, root_child0); YogaNode root_child1 = new YogaNode(); @@ -204,13 +204,13 @@ namespace Facebook.Yoga { YogaNode root = new YogaNode(); root.JustifyContent = YogaJustify.Center; - root.Width = 100.Px(); - root.MinHeight = 100.Px(); - root.MaxHeight = 200.Px(); + root.Width = 100; + root.MinHeight = 100; + root.MaxHeight = 200; YogaNode root_child0 = new YogaNode(); - root_child0.Width = 60.Px(); - root_child0.Height = 60.Px(); + root_child0.Width = 60; + root_child0.Height = 60; root.Insert(0, root_child0); root.StyleDirection = YogaDirection.LTR; root.CalculateLayout(); @@ -244,13 +244,13 @@ namespace Facebook.Yoga { YogaNode root = new YogaNode(); root.AlignItems = YogaAlign.Center; - root.MinWidth = 100.Px(); - root.MaxWidth = 200.Px(); - root.Height = 100.Px(); + root.MinWidth = 100; + root.MaxWidth = 200; + root.Height = 100; YogaNode root_child0 = new YogaNode(); - root_child0.Width = 60.Px(); - root_child0.Height = 60.Px(); + root_child0.Width = 60; + root_child0.Height = 60; root.Insert(0, root_child0); root.StyleDirection = YogaDirection.LTR; root.CalculateLayout(); @@ -284,22 +284,22 @@ namespace Facebook.Yoga { YogaNode root = new YogaNode(); root.JustifyContent = YogaJustify.Center; - root.MinHeight = 100.Px(); - root.MaxHeight = 110.Px(); + root.MinHeight = 100; + root.MaxHeight = 110; YogaNode root_child0 = new YogaNode(); - root_child0.Width = 50.Px(); - root_child0.Height = 50.Px(); + root_child0.Width = 50; + root_child0.Height = 50; root.Insert(0, root_child0); YogaNode root_child1 = new YogaNode(); - root_child1.Width = 50.Px(); - root_child1.Height = 50.Px(); + root_child1.Width = 50; + root_child1.Height = 50; root.Insert(1, root_child1); YogaNode root_child2 = new YogaNode(); - root_child2.Width = 50.Px(); - root_child2.Height = 50.Px(); + root_child2.Width = 50; + root_child2.Height = 50; root.Insert(2, root_child2); root.StyleDirection = YogaDirection.LTR; root.CalculateLayout(); @@ -352,17 +352,17 @@ namespace Facebook.Yoga public void Test_flex_grow_within_max_width() { YogaNode root = new YogaNode(); - root.Width = 200.Px(); - root.Height = 100.Px(); + root.Width = 200; + root.Height = 100; YogaNode root_child0 = new YogaNode(); root_child0.FlexDirection = YogaFlexDirection.Row; - root_child0.MaxWidth = 100.Px(); + root_child0.MaxWidth = 100; root.Insert(0, root_child0); YogaNode root_child0_child0 = new YogaNode(); root_child0_child0.FlexGrow = 1; - root_child0_child0.Height = 20.Px(); + root_child0_child0.Height = 20; root_child0.Insert(0, root_child0_child0); root.StyleDirection = YogaDirection.LTR; root.CalculateLayout(); @@ -405,17 +405,17 @@ namespace Facebook.Yoga public void Test_flex_grow_within_constrained_max_width() { YogaNode root = new YogaNode(); - root.Width = 200.Px(); - root.Height = 100.Px(); + root.Width = 200; + root.Height = 100; YogaNode root_child0 = new YogaNode(); root_child0.FlexDirection = YogaFlexDirection.Row; - root_child0.MaxWidth = 300.Px(); + root_child0.MaxWidth = 300; root.Insert(0, root_child0); YogaNode root_child0_child0 = new YogaNode(); root_child0_child0.FlexGrow = 1; - root_child0_child0.Height = 20.Px(); + root_child0_child0.Height = 20; root_child0.Insert(0, root_child0_child0); root.StyleDirection = YogaDirection.LTR; root.CalculateLayout(); @@ -459,15 +459,15 @@ namespace Facebook.Yoga { YogaNode root = new YogaNode(); root.FlexDirection = YogaFlexDirection.Row; - root.MinWidth = 100.Px(); - root.Height = 100.Px(); + root.MinWidth = 100; + root.Height = 100; YogaNode root_child0 = new YogaNode(); root_child0.FlexGrow = 1; root.Insert(0, root_child0); YogaNode root_child1 = new YogaNode(); - root_child1.Width = 50.Px(); + root_child1.Width = 50; root.Insert(1, root_child1); root.StyleDirection = YogaDirection.LTR; root.CalculateLayout(); @@ -510,14 +510,14 @@ namespace Facebook.Yoga public void Test_flex_grow_within_constrained_min_column() { YogaNode root = new YogaNode(); - root.MinHeight = 100.Px(); + root.MinHeight = 100; YogaNode root_child0 = new YogaNode(); root_child0.FlexGrow = 1; root.Insert(0, root_child0); YogaNode root_child1 = new YogaNode(); - root_child1.Height = 50.Px(); + root_child1.Height = 50; root.Insert(1, root_child1); root.StyleDirection = YogaDirection.LTR; root.CalculateLayout(); @@ -560,21 +560,21 @@ namespace Facebook.Yoga public void Test_flex_grow_within_constrained_max_row() { YogaNode root = new YogaNode(); - root.Width = 200.Px(); + root.Width = 200; YogaNode root_child0 = new YogaNode(); root_child0.FlexDirection = YogaFlexDirection.Row; - root_child0.MaxWidth = 100.Px(); - root_child0.Height = 100.Px(); + root_child0.MaxWidth = 100; + root_child0.Height = 100; root.Insert(0, root_child0); YogaNode root_child0_child0 = new YogaNode(); root_child0_child0.FlexShrink = 1; - root_child0_child0.FlexBasis = 100.Px(); + root_child0_child0.FlexBasis = 100; root_child0.Insert(0, root_child0_child0); YogaNode root_child0_child1 = new YogaNode(); - root_child0_child1.Width = 50.Px(); + root_child0_child1.Width = 50; root_child0.Insert(1, root_child0_child1); root.StyleDirection = YogaDirection.LTR; root.CalculateLayout(); @@ -627,16 +627,16 @@ namespace Facebook.Yoga public void Test_flex_grow_within_constrained_max_column() { YogaNode root = new YogaNode(); - root.Width = 100.Px(); - root.MaxHeight = 100.Px(); + root.Width = 100; + root.MaxHeight = 100; YogaNode root_child0 = new YogaNode(); root_child0.FlexShrink = 1; - root_child0.FlexBasis = 100.Px(); + root_child0.FlexBasis = 100; root.Insert(0, root_child0); YogaNode root_child1 = new YogaNode(); - root_child1.Height = 50.Px(); + root_child1.Height = 50; root.Insert(1, root_child1); root.StyleDirection = YogaDirection.LTR; root.CalculateLayout(); diff --git a/csharp/tests/Facebook.Yoga/YGPaddingTest.cs b/csharp/tests/Facebook.Yoga/YGPaddingTest.cs index da05f23a..b3f17014 100644 --- a/csharp/tests/Facebook.Yoga/YGPaddingTest.cs +++ b/csharp/tests/Facebook.Yoga/YGPaddingTest.cs @@ -21,10 +21,10 @@ namespace Facebook.Yoga public void Test_padding_no_size() { YogaNode root = new YogaNode(); - root.SetPadding(YogaEdge.Left, 10.Px()); - root.SetPadding(YogaEdge.Top, 10.Px()); - root.SetPadding(YogaEdge.Right, 10.Px()); - root.SetPadding(YogaEdge.Bottom, 10.Px()); + root.SetPadding(YogaEdge.Left, 10); + root.SetPadding(YogaEdge.Top, 10); + root.SetPadding(YogaEdge.Right, 10); + root.SetPadding(YogaEdge.Bottom, 10); root.StyleDirection = YogaDirection.LTR; root.CalculateLayout(); @@ -46,14 +46,14 @@ namespace Facebook.Yoga public void Test_padding_container_match_child() { YogaNode root = new YogaNode(); - root.SetPadding(YogaEdge.Left, 10.Px()); - root.SetPadding(YogaEdge.Top, 10.Px()); - root.SetPadding(YogaEdge.Right, 10.Px()); - root.SetPadding(YogaEdge.Bottom, 10.Px()); + root.SetPadding(YogaEdge.Left, 10); + root.SetPadding(YogaEdge.Top, 10); + root.SetPadding(YogaEdge.Right, 10); + root.SetPadding(YogaEdge.Bottom, 10); YogaNode root_child0 = new YogaNode(); - root_child0.Width = 10.Px(); - root_child0.Height = 10.Px(); + root_child0.Width = 10; + root_child0.Height = 10; root.Insert(0, root_child0); root.StyleDirection = YogaDirection.LTR; root.CalculateLayout(); @@ -86,16 +86,16 @@ namespace Facebook.Yoga public void Test_padding_flex_child() { YogaNode root = new YogaNode(); - root.SetPadding(YogaEdge.Left, 10.Px()); - root.SetPadding(YogaEdge.Top, 10.Px()); - root.SetPadding(YogaEdge.Right, 10.Px()); - root.SetPadding(YogaEdge.Bottom, 10.Px()); - root.Width = 100.Px(); - root.Height = 100.Px(); + root.SetPadding(YogaEdge.Left, 10); + root.SetPadding(YogaEdge.Top, 10); + root.SetPadding(YogaEdge.Right, 10); + root.SetPadding(YogaEdge.Bottom, 10); + root.Width = 100; + root.Height = 100; YogaNode root_child0 = new YogaNode(); root_child0.FlexGrow = 1; - root_child0.Width = 10.Px(); + root_child0.Width = 10; root.Insert(0, root_child0); root.StyleDirection = YogaDirection.LTR; root.CalculateLayout(); @@ -128,15 +128,15 @@ namespace Facebook.Yoga public void Test_padding_stretch_child() { YogaNode root = new YogaNode(); - root.SetPadding(YogaEdge.Left, 10.Px()); - root.SetPadding(YogaEdge.Top, 10.Px()); - root.SetPadding(YogaEdge.Right, 10.Px()); - root.SetPadding(YogaEdge.Bottom, 10.Px()); - root.Width = 100.Px(); - root.Height = 100.Px(); + root.SetPadding(YogaEdge.Left, 10); + root.SetPadding(YogaEdge.Top, 10); + root.SetPadding(YogaEdge.Right, 10); + root.SetPadding(YogaEdge.Bottom, 10); + root.Width = 100; + root.Height = 100; YogaNode root_child0 = new YogaNode(); - root_child0.Height = 10.Px(); + root_child0.Height = 10; root.Insert(0, root_child0); root.StyleDirection = YogaDirection.LTR; root.CalculateLayout(); @@ -171,15 +171,15 @@ namespace Facebook.Yoga YogaNode root = new YogaNode(); root.JustifyContent = YogaJustify.Center; root.AlignItems = YogaAlign.Center; - root.SetPadding(YogaEdge.Start, 10.Px()); - root.SetPadding(YogaEdge.End, 20.Px()); - root.SetPadding(YogaEdge.Bottom, 20.Px()); - root.Width = 100.Px(); - root.Height = 100.Px(); + root.SetPadding(YogaEdge.Start, 10); + root.SetPadding(YogaEdge.End, 20); + root.SetPadding(YogaEdge.Bottom, 20); + root.Width = 100; + root.Height = 100; YogaNode root_child0 = new YogaNode(); - root_child0.Width = 10.Px(); - root_child0.Height = 10.Px(); + root_child0.Width = 10; + root_child0.Height = 10; root.Insert(0, root_child0); root.StyleDirection = YogaDirection.LTR; root.CalculateLayout(); @@ -214,16 +214,16 @@ namespace Facebook.Yoga YogaNode root = new YogaNode(); root.JustifyContent = YogaJustify.FlexEnd; root.AlignItems = YogaAlign.FlexEnd; - root.Width = 200.Px(); - root.Height = 200.Px(); + root.Width = 200; + root.Height = 200; YogaNode root_child0 = new YogaNode(); - root_child0.SetPadding(YogaEdge.Left, 20.Px()); - root_child0.SetPadding(YogaEdge.Top, 20.Px()); - root_child0.SetPadding(YogaEdge.Right, 20.Px()); - root_child0.SetPadding(YogaEdge.Bottom, 20.Px()); - root_child0.Width = 100.Px(); - root_child0.Height = 100.Px(); + root_child0.SetPadding(YogaEdge.Left, 20); + root_child0.SetPadding(YogaEdge.Top, 20); + root_child0.SetPadding(YogaEdge.Right, 20); + root_child0.SetPadding(YogaEdge.Bottom, 20); + root_child0.Width = 100; + root_child0.Height = 100; root.Insert(0, root_child0); root.StyleDirection = YogaDirection.LTR; root.CalculateLayout(); diff --git a/csharp/tests/Facebook.Yoga/YGPercentageTest.cs b/csharp/tests/Facebook.Yoga/YGPercentageTest.cs index 277df479..7c9bc423 100644 --- a/csharp/tests/Facebook.Yoga/YGPercentageTest.cs +++ b/csharp/tests/Facebook.Yoga/YGPercentageTest.cs @@ -24,8 +24,8 @@ namespace Facebook.Yoga YogaNode root = new YogaNode(); root.FlexDirection = YogaFlexDirection.Row; - root.Width = 200.Px(); - root.Height = 200.Px(); + root.Width = 200; + root.Height = 200; YogaNode root_child0 = new YogaNode(); root_child0.Width = 30.Percent(); @@ -67,8 +67,8 @@ namespace Facebook.Yoga YogaNode root = new YogaNode(); root.FlexDirection = YogaFlexDirection.Row; - root.Width = 400.Px(); - root.Height = 400.Px(); + root.Width = 400; + root.Height = 400; YogaNode root_child0 = new YogaNode(); root_child0.SetPosition(YogaEdge.Left, 10.Percent()); @@ -112,8 +112,8 @@ namespace Facebook.Yoga YogaNode root = new YogaNode(); root.FlexDirection = YogaFlexDirection.Row; - root.Width = 500.Px(); - root.Height = 500.Px(); + root.Width = 500; + root.Height = 500; YogaNode root_child0 = new YogaNode(); root_child0.SetPosition(YogaEdge.Right, 20.Percent()); @@ -157,8 +157,8 @@ namespace Facebook.Yoga YogaNode root = new YogaNode(); root.FlexDirection = YogaFlexDirection.Row; - root.Width = 200.Px(); - root.Height = 200.Px(); + root.Width = 200; + root.Height = 200; YogaNode root_child0 = new YogaNode(); root_child0.FlexGrow = 1; @@ -214,8 +214,8 @@ namespace Facebook.Yoga YogaNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, true); YogaNode root = new YogaNode(); - root.Width = 200.Px(); - root.Height = 200.Px(); + root.Width = 200; + root.Height = 200; YogaNode root_child0 = new YogaNode(); root_child0.FlexGrow = 1; @@ -271,8 +271,8 @@ namespace Facebook.Yoga YogaNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, true); YogaNode root = new YogaNode(); - root.Width = 200.Px(); - root.Height = 200.Px(); + root.Width = 200; + root.Height = 200; YogaNode root_child0 = new YogaNode(); root_child0.FlexGrow = 1; @@ -329,8 +329,8 @@ namespace Facebook.Yoga YogaNode root = new YogaNode(); root.FlexDirection = YogaFlexDirection.Row; - root.Width = 200.Px(); - root.Height = 200.Px(); + root.Width = 200; + root.Height = 200; YogaNode root_child0 = new YogaNode(); root_child0.FlexGrow = 1; @@ -388,8 +388,8 @@ namespace Facebook.Yoga YogaNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, true); YogaNode root = new YogaNode(); - root.Width = 200.Px(); - root.Height = 200.Px(); + root.Width = 200; + root.Height = 200; YogaNode root_child0 = new YogaNode(); root_child0.FlexGrow = 1; @@ -448,8 +448,8 @@ namespace Facebook.Yoga YogaNode root = new YogaNode(); root.FlexDirection = YogaFlexDirection.Row; - root.Width = 200.Px(); - root.Height = 200.Px(); + root.Width = 200; + root.Height = 200; YogaNode root_child0 = new YogaNode(); root_child0.FlexGrow = 1; @@ -507,8 +507,8 @@ namespace Facebook.Yoga YogaNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, true); YogaNode root = new YogaNode(); - root.Width = 200.Px(); - root.Height = 200.Px(); + root.Width = 200; + root.Height = 200; YogaNode root_child0 = new YogaNode(); root_child0.FlexGrow = 1; @@ -567,8 +567,8 @@ namespace Facebook.Yoga YogaNode root = new YogaNode(); root.FlexDirection = YogaFlexDirection.Row; - root.Width = 200.Px(); - root.Height = 200.Px(); + root.Width = 200; + root.Height = 200; YogaNode root_child0 = new YogaNode(); root_child0.FlexGrow = 1; @@ -626,8 +626,8 @@ namespace Facebook.Yoga YogaNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, true); YogaNode root = new YogaNode(); - root.Width = 200.Px(); - root.Height = 200.Px(); + root.Width = 200; + root.Height = 200; YogaNode root_child0 = new YogaNode(); root_child0.FlexGrow = 1; @@ -685,28 +685,28 @@ namespace Facebook.Yoga YogaNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, true); YogaNode root = new YogaNode(); - root.Width = 200.Px(); - root.Height = 200.Px(); + root.Width = 200; + root.Height = 200; YogaNode root_child0 = new YogaNode(); root_child0.FlexGrow = 1; root_child0.FlexBasis = 10.Percent(); - root_child0.SetMargin(YogaEdge.Left, 5.Px()); - root_child0.SetMargin(YogaEdge.Top, 5.Px()); - root_child0.SetMargin(YogaEdge.Right, 5.Px()); - root_child0.SetMargin(YogaEdge.Bottom, 5.Px()); - root_child0.SetPadding(YogaEdge.Left, 3.Px()); - root_child0.SetPadding(YogaEdge.Top, 3.Px()); - root_child0.SetPadding(YogaEdge.Right, 3.Px()); - root_child0.SetPadding(YogaEdge.Bottom, 3.Px()); + root_child0.SetMargin(YogaEdge.Left, 5); + root_child0.SetMargin(YogaEdge.Top, 5); + root_child0.SetMargin(YogaEdge.Right, 5); + root_child0.SetMargin(YogaEdge.Bottom, 5); + root_child0.SetPadding(YogaEdge.Left, 3); + root_child0.SetPadding(YogaEdge.Top, 3); + root_child0.SetPadding(YogaEdge.Right, 3); + root_child0.SetPadding(YogaEdge.Bottom, 3); root_child0.MinWidth = 60.Percent(); root.Insert(0, root_child0); YogaNode root_child0_child0 = new YogaNode(); - root_child0_child0.SetMargin(YogaEdge.Left, 5.Px()); - root_child0_child0.SetMargin(YogaEdge.Top, 5.Px()); - root_child0_child0.SetMargin(YogaEdge.Right, 5.Px()); - root_child0_child0.SetMargin(YogaEdge.Bottom, 5.Px()); + root_child0_child0.SetMargin(YogaEdge.Left, 5); + root_child0_child0.SetMargin(YogaEdge.Top, 5); + root_child0_child0.SetMargin(YogaEdge.Right, 5); + root_child0_child0.SetMargin(YogaEdge.Bottom, 5); root_child0_child0.SetPadding(YogaEdge.Left, 3.Percent()); root_child0_child0.SetPadding(YogaEdge.Top, 3.Percent()); root_child0_child0.SetPadding(YogaEdge.Right, 3.Percent()); @@ -719,10 +719,10 @@ namespace Facebook.Yoga root_child0_child0_child0.SetMargin(YogaEdge.Top, 5.Percent()); root_child0_child0_child0.SetMargin(YogaEdge.Right, 5.Percent()); root_child0_child0_child0.SetMargin(YogaEdge.Bottom, 5.Percent()); - root_child0_child0_child0.SetPadding(YogaEdge.Left, 3.Px()); - root_child0_child0_child0.SetPadding(YogaEdge.Top, 3.Px()); - root_child0_child0_child0.SetPadding(YogaEdge.Right, 3.Px()); - root_child0_child0_child0.SetPadding(YogaEdge.Bottom, 3.Px()); + root_child0_child0_child0.SetPadding(YogaEdge.Left, 3); + root_child0_child0_child0.SetPadding(YogaEdge.Top, 3); + root_child0_child0_child0.SetPadding(YogaEdge.Right, 3); + root_child0_child0_child0.SetPadding(YogaEdge.Bottom, 3); root_child0_child0_child0.Width = 45.Percent(); root_child0_child0.Insert(0, root_child0_child0_child0); @@ -796,8 +796,8 @@ namespace Facebook.Yoga YogaNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, true); YogaNode root = new YogaNode(); - root.Width = 200.Px(); - root.Height = 100.Px(); + root.Width = 200; + root.Height = 100; YogaNode root_child0 = new YogaNode(); root_child0.FlexGrow = 1; @@ -808,8 +808,8 @@ namespace Facebook.Yoga root.Insert(0, root_child0); YogaNode root_child0_child0 = new YogaNode(); - root_child0_child0.Width = 10.Px(); - root_child0_child0.Height = 10.Px(); + root_child0_child0.Width = 10; + root_child0_child0.Height = 10; root_child0.Insert(0, root_child0_child0); root.StyleDirection = YogaDirection.LTR; root.CalculateLayout(); @@ -856,8 +856,8 @@ namespace Facebook.Yoga YogaNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, true); YogaNode root = new YogaNode(); - root.Width = 200.Px(); - root.Height = 100.Px(); + root.Width = 200; + root.Height = 100; YogaNode root_child0 = new YogaNode(); root_child0.FlexGrow = 1; @@ -868,8 +868,8 @@ namespace Facebook.Yoga root.Insert(0, root_child0); YogaNode root_child0_child0 = new YogaNode(); - root_child0_child0.Width = 10.Px(); - root_child0_child0.Height = 10.Px(); + root_child0_child0.Width = 10; + root_child0_child0.Height = 10; root_child0.Insert(0, root_child0_child0); root.StyleDirection = YogaDirection.LTR; root.CalculateLayout(); @@ -916,15 +916,15 @@ namespace Facebook.Yoga YogaNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, true); YogaNode root = new YogaNode(); - root.Width = 200.Px(); - root.Height = 100.Px(); + root.Width = 200; + root.Height = 100; YogaNode root_child0 = new YogaNode(); root_child0.PositionType = YogaPositionType.Absolute; root_child0.SetPosition(YogaEdge.Left, 30.Percent()); root_child0.SetPosition(YogaEdge.Top, 10.Percent()); - root_child0.Width = 10.Px(); - root_child0.Height = 10.Px(); + root_child0.Width = 10; + root_child0.Height = 10; root.Insert(0, root_child0); root.StyleDirection = YogaDirection.LTR; root.CalculateLayout(); diff --git a/csharp/tests/Facebook.Yoga/YGRoundingTest.cs b/csharp/tests/Facebook.Yoga/YGRoundingTest.cs index 88c8c5a1..2ed2c39d 100644 --- a/csharp/tests/Facebook.Yoga/YGRoundingTest.cs +++ b/csharp/tests/Facebook.Yoga/YGRoundingTest.cs @@ -24,8 +24,8 @@ namespace Facebook.Yoga YogaNode root = new YogaNode(); root.FlexDirection = YogaFlexDirection.Row; - root.Width = 100.Px(); - root.Height = 100.Px(); + root.Width = 100; + root.Height = 100; YogaNode root_child0 = new YogaNode(); root_child0.FlexGrow = 1; @@ -94,8 +94,8 @@ namespace Facebook.Yoga YogaNode root = new YogaNode(); root.FlexDirection = YogaFlexDirection.Row; - root.Width = 113.Px(); - root.Height = 100.Px(); + root.Width = 113; + root.Height = 100; YogaNode root_child0 = new YogaNode(); root_child0.FlexGrow = 1; @@ -192,20 +192,20 @@ namespace Facebook.Yoga YogaNode root = new YogaNode(); root.FlexDirection = YogaFlexDirection.Row; - root.Width = 101.Px(); - root.Height = 100.Px(); + root.Width = 101; + root.Height = 100; YogaNode root_child0 = new YogaNode(); root_child0.FlexShrink = 1; - root_child0.FlexBasis = 100.Px(); + root_child0.FlexBasis = 100; root.Insert(0, root_child0); YogaNode root_child1 = new YogaNode(); - root_child1.FlexBasis = 25.Px(); + root_child1.FlexBasis = 25; root.Insert(1, root_child1); YogaNode root_child2 = new YogaNode(); - root_child2.FlexBasis = 25.Px(); + root_child2.FlexBasis = 25; root.Insert(2, root_child2); root.StyleDirection = YogaDirection.LTR; root.CalculateLayout(); @@ -262,23 +262,23 @@ namespace Facebook.Yoga YogaNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, true); YogaNode root = new YogaNode(); - root.Width = 100.Px(); - root.Height = 113.Px(); + root.Width = 100; + root.Height = 113; YogaNode root_child0 = new YogaNode(); root_child0.FlexGrow = 1; - root_child0.FlexBasis = 50.Px(); - root_child0.Height = 20.Px(); + root_child0.FlexBasis = 50; + root_child0.Height = 20; root.Insert(0, root_child0); YogaNode root_child1 = new YogaNode(); root_child1.FlexGrow = 1; - root_child1.Height = 10.Px(); + root_child1.Height = 10; root.Insert(1, root_child1); YogaNode root_child2 = new YogaNode(); root_child2.FlexGrow = 1; - root_child2.Height = 10.Px(); + root_child2.Height = 10; root.Insert(2, root_child2); root.StyleDirection = YogaDirection.LTR; root.CalculateLayout(); @@ -335,23 +335,23 @@ namespace Facebook.Yoga YogaNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, true); YogaNode root = new YogaNode(); - root.Width = 87.4f.Px(); - root.Height = 113.4f.Px(); + root.Width = 87.4f; + root.Height = 113.4f; YogaNode root_child0 = new YogaNode(); root_child0.FlexGrow = 0.7f; - root_child0.FlexBasis = 50.3f.Px(); - root_child0.Height = 20.3f.Px(); + root_child0.FlexBasis = 50.3f; + root_child0.Height = 20.3f; root.Insert(0, root_child0); YogaNode root_child1 = new YogaNode(); root_child1.FlexGrow = 1.6f; - root_child1.Height = 10.Px(); + root_child1.Height = 10; root.Insert(1, root_child1); YogaNode root_child2 = new YogaNode(); root_child2.FlexGrow = 1.1f; - root_child2.Height = 10.7f.Px(); + root_child2.Height = 10.7f; root.Insert(2, root_child2); root.StyleDirection = YogaDirection.LTR; root.CalculateLayout(); @@ -408,37 +408,37 @@ namespace Facebook.Yoga YogaNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, true); YogaNode root = new YogaNode(); - root.Width = 87.4f.Px(); - root.Height = 113.4f.Px(); + root.Width = 87.4f; + root.Height = 113.4f; YogaNode root_child0 = new YogaNode(); root_child0.FlexGrow = 0.7f; - root_child0.FlexBasis = 50.3f.Px(); - root_child0.Height = 20.3f.Px(); + root_child0.FlexBasis = 50.3f; + root_child0.Height = 20.3f; root.Insert(0, root_child0); YogaNode root_child0_child0 = new YogaNode(); root_child0_child0.FlexGrow = 1; - root_child0_child0.FlexBasis = 0.3f.Px(); - root_child0_child0.SetPosition(YogaEdge.Bottom, 13.3f.Px()); - root_child0_child0.Height = 9.9f.Px(); + root_child0_child0.FlexBasis = 0.3f; + root_child0_child0.SetPosition(YogaEdge.Bottom, 13.3f); + root_child0_child0.Height = 9.9f; root_child0.Insert(0, root_child0_child0); YogaNode root_child0_child1 = new YogaNode(); root_child0_child1.FlexGrow = 4; - root_child0_child1.FlexBasis = 0.3f.Px(); - root_child0_child1.SetPosition(YogaEdge.Top, 13.3f.Px()); - root_child0_child1.Height = 1.1f.Px(); + root_child0_child1.FlexBasis = 0.3f; + root_child0_child1.SetPosition(YogaEdge.Top, 13.3f); + root_child0_child1.Height = 1.1f; root_child0.Insert(1, root_child0_child1); YogaNode root_child1 = new YogaNode(); root_child1.FlexGrow = 1.6f; - root_child1.Height = 10.Px(); + root_child1.Height = 10; root.Insert(1, root_child1); YogaNode root_child2 = new YogaNode(); root_child2.FlexGrow = 1.1f; - root_child2.Height = 10.7f.Px(); + root_child2.Height = 10.7f; root.Insert(2, root_child2); root.StyleDirection = YogaDirection.LTR; root.CalculateLayout(); @@ -515,23 +515,23 @@ namespace Facebook.Yoga YogaNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, true); YogaNode root = new YogaNode(); - root.Width = 100.Px(); - root.Height = 113.4f.Px(); + root.Width = 100; + root.Height = 113.4f; YogaNode root_child0 = new YogaNode(); root_child0.FlexGrow = 1; - root_child0.FlexBasis = 50.Px(); - root_child0.Height = 20.Px(); + root_child0.FlexBasis = 50; + root_child0.Height = 20; root.Insert(0, root_child0); YogaNode root_child1 = new YogaNode(); root_child1.FlexGrow = 1; - root_child1.Height = 10.Px(); + root_child1.Height = 10; root.Insert(1, root_child1); YogaNode root_child2 = new YogaNode(); root_child2.FlexGrow = 1; - root_child2.Height = 10.Px(); + root_child2.Height = 10; root.Insert(2, root_child2); root.StyleDirection = YogaDirection.LTR; root.CalculateLayout(); @@ -588,23 +588,23 @@ namespace Facebook.Yoga YogaNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, true); YogaNode root = new YogaNode(); - root.Width = 100.Px(); - root.Height = 113.6f.Px(); + root.Width = 100; + root.Height = 113.6f; YogaNode root_child0 = new YogaNode(); root_child0.FlexGrow = 1; - root_child0.FlexBasis = 50.Px(); - root_child0.Height = 20.Px(); + root_child0.FlexBasis = 50; + root_child0.Height = 20; root.Insert(0, root_child0); YogaNode root_child1 = new YogaNode(); root_child1.FlexGrow = 1; - root_child1.Height = 10.Px(); + root_child1.Height = 10; root.Insert(1, root_child1); YogaNode root_child2 = new YogaNode(); root_child2.FlexGrow = 1; - root_child2.Height = 10.Px(); + root_child2.Height = 10; root.Insert(2, root_child2); root.StyleDirection = YogaDirection.LTR; root.CalculateLayout(); @@ -661,24 +661,24 @@ namespace Facebook.Yoga YogaNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, true); YogaNode root = new YogaNode(); - root.SetPosition(YogaEdge.Top, 0.3f.Px()); - root.Width = 100.Px(); - root.Height = 113.4f.Px(); + root.SetPosition(YogaEdge.Top, 0.3f); + root.Width = 100; + root.Height = 113.4f; YogaNode root_child0 = new YogaNode(); root_child0.FlexGrow = 1; - root_child0.FlexBasis = 50.Px(); - root_child0.Height = 20.Px(); + root_child0.FlexBasis = 50; + root_child0.Height = 20; root.Insert(0, root_child0); YogaNode root_child1 = new YogaNode(); root_child1.FlexGrow = 1; - root_child1.Height = 10.Px(); + root_child1.Height = 10; root.Insert(1, root_child1); YogaNode root_child2 = new YogaNode(); root_child2.FlexGrow = 1; - root_child2.Height = 10.Px(); + root_child2.Height = 10; root.Insert(2, root_child2); root.StyleDirection = YogaDirection.LTR; root.CalculateLayout(); @@ -735,24 +735,24 @@ namespace Facebook.Yoga YogaNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, true); YogaNode root = new YogaNode(); - root.SetPosition(YogaEdge.Top, 0.7f.Px()); - root.Width = 100.Px(); - root.Height = 113.4f.Px(); + root.SetPosition(YogaEdge.Top, 0.7f); + root.Width = 100; + root.Height = 113.4f; YogaNode root_child0 = new YogaNode(); root_child0.FlexGrow = 1; - root_child0.FlexBasis = 50.Px(); - root_child0.Height = 20.Px(); + root_child0.FlexBasis = 50; + root_child0.Height = 20; root.Insert(0, root_child0); YogaNode root_child1 = new YogaNode(); root_child1.FlexGrow = 1; - root_child1.Height = 10.Px(); + root_child1.Height = 10; root.Insert(1, root_child1); YogaNode root_child2 = new YogaNode(); root_child2.FlexGrow = 1; - root_child2.Height = 10.Px(); + root_child2.Height = 10; root.Insert(2, root_child2); root.StyleDirection = YogaDirection.LTR; root.CalculateLayout(); diff --git a/gentest/gentest-cs.js b/gentest/gentest-cs.js index 59da4144..3a647d94 100644 --- a/gentest/gentest-cs.js +++ b/gentest/gentest-cs.js @@ -14,12 +14,10 @@ function toValueCs(value) { function toValueCsCs(value) { var methodName = ''; - if(value.indexOf('px') >= 0){ - methodName = 'Px'; - }else if (value.indexOf('%') >= 0){ - methodName = 'Percent'; + if (value.indexOf('%') >= 0){ + methodName = '.Percent()'; } - return toValueCs(value) + '.' + methodName + '()'; + return toValueCs(value) + methodName; } var CSEmitter = function() {