Rename enums
Summary: new name, start by renaming enums Differential Revision: D4244360 fbshipit-source-id: c9fcbdd231098c9ff230a6055676bbc7cbd11001
This commit is contained in:
committed by
Facebook Github Bot
parent
07cf47baad
commit
42b6f6b6e5
@@ -25,13 +25,13 @@ namespace Facebook.CSSLayout
|
||||
root.Height = 100f;
|
||||
|
||||
CSSNode root_child0 = new CSSNode();
|
||||
root_child0.PositionType = CSSPositionType.Absolute;
|
||||
root_child0.SetPosition(CSSEdge.Start, 10f);
|
||||
root_child0.SetPosition(CSSEdge.Top, 10f);
|
||||
root_child0.PositionType = YogaPositionType.Absolute;
|
||||
root_child0.SetPosition(YogaEdge.Start, 10f);
|
||||
root_child0.SetPosition(YogaEdge.Top, 10f);
|
||||
root_child0.Width = 10f;
|
||||
root_child0.Height = 10f;
|
||||
root.Insert(0, root_child0);
|
||||
root.StyleDirection = CSSDirection.LTR;
|
||||
root.StyleDirection = YogaDirection.LTR;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -44,7 +44,7 @@ namespace Facebook.CSSLayout
|
||||
Assert.AreEqual(10f, root_child0.LayoutWidth);
|
||||
Assert.AreEqual(10f, root_child0.LayoutHeight);
|
||||
|
||||
root.StyleDirection = CSSDirection.RTL;
|
||||
root.StyleDirection = YogaDirection.RTL;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -66,13 +66,13 @@ namespace Facebook.CSSLayout
|
||||
root.Height = 100f;
|
||||
|
||||
CSSNode root_child0 = new CSSNode();
|
||||
root_child0.PositionType = CSSPositionType.Absolute;
|
||||
root_child0.SetPosition(CSSEdge.End, 10f);
|
||||
root_child0.SetPosition(CSSEdge.Bottom, 10f);
|
||||
root_child0.PositionType = YogaPositionType.Absolute;
|
||||
root_child0.SetPosition(YogaEdge.End, 10f);
|
||||
root_child0.SetPosition(YogaEdge.Bottom, 10f);
|
||||
root_child0.Width = 10f;
|
||||
root_child0.Height = 10f;
|
||||
root.Insert(0, root_child0);
|
||||
root.StyleDirection = CSSDirection.LTR;
|
||||
root.StyleDirection = YogaDirection.LTR;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -85,7 +85,7 @@ namespace Facebook.CSSLayout
|
||||
Assert.AreEqual(10f, root_child0.LayoutWidth);
|
||||
Assert.AreEqual(10f, root_child0.LayoutHeight);
|
||||
|
||||
root.StyleDirection = CSSDirection.RTL;
|
||||
root.StyleDirection = YogaDirection.RTL;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -107,13 +107,13 @@ namespace Facebook.CSSLayout
|
||||
root.Height = 100f;
|
||||
|
||||
CSSNode root_child0 = new CSSNode();
|
||||
root_child0.PositionType = CSSPositionType.Absolute;
|
||||
root_child0.SetPosition(CSSEdge.Start, 10f);
|
||||
root_child0.SetPosition(CSSEdge.Top, 10f);
|
||||
root_child0.SetPosition(CSSEdge.End, 10f);
|
||||
root_child0.SetPosition(CSSEdge.Bottom, 10f);
|
||||
root_child0.PositionType = YogaPositionType.Absolute;
|
||||
root_child0.SetPosition(YogaEdge.Start, 10f);
|
||||
root_child0.SetPosition(YogaEdge.Top, 10f);
|
||||
root_child0.SetPosition(YogaEdge.End, 10f);
|
||||
root_child0.SetPosition(YogaEdge.Bottom, 10f);
|
||||
root.Insert(0, root_child0);
|
||||
root.StyleDirection = CSSDirection.LTR;
|
||||
root.StyleDirection = YogaDirection.LTR;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -126,7 +126,7 @@ namespace Facebook.CSSLayout
|
||||
Assert.AreEqual(80f, root_child0.LayoutWidth);
|
||||
Assert.AreEqual(80f, root_child0.LayoutHeight);
|
||||
|
||||
root.StyleDirection = CSSDirection.RTL;
|
||||
root.StyleDirection = YogaDirection.RTL;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -148,15 +148,15 @@ namespace Facebook.CSSLayout
|
||||
root.Height = 100f;
|
||||
|
||||
CSSNode root_child0 = new CSSNode();
|
||||
root_child0.PositionType = CSSPositionType.Absolute;
|
||||
root_child0.SetPosition(CSSEdge.Start, 10f);
|
||||
root_child0.SetPosition(CSSEdge.Top, 10f);
|
||||
root_child0.SetPosition(CSSEdge.End, 10f);
|
||||
root_child0.SetPosition(CSSEdge.Bottom, 10f);
|
||||
root_child0.PositionType = YogaPositionType.Absolute;
|
||||
root_child0.SetPosition(YogaEdge.Start, 10f);
|
||||
root_child0.SetPosition(YogaEdge.Top, 10f);
|
||||
root_child0.SetPosition(YogaEdge.End, 10f);
|
||||
root_child0.SetPosition(YogaEdge.Bottom, 10f);
|
||||
root_child0.Width = 10f;
|
||||
root_child0.Height = 10f;
|
||||
root.Insert(0, root_child0);
|
||||
root.StyleDirection = CSSDirection.LTR;
|
||||
root.StyleDirection = YogaDirection.LTR;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -169,7 +169,7 @@ namespace Facebook.CSSLayout
|
||||
Assert.AreEqual(10f, root_child0.LayoutWidth);
|
||||
Assert.AreEqual(10f, root_child0.LayoutHeight);
|
||||
|
||||
root.StyleDirection = CSSDirection.RTL;
|
||||
root.StyleDirection = YogaDirection.RTL;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -187,22 +187,22 @@ namespace Facebook.CSSLayout
|
||||
public void Test_do_not_clamp_height_of_absolute_node_to_height_of_its_overflow_hidden_parent()
|
||||
{
|
||||
CSSNode root = new CSSNode();
|
||||
root.FlexDirection = CSSFlexDirection.Row;
|
||||
root.Overflow = CSSOverflow.Hidden;
|
||||
root.FlexDirection = YogaFlexDirection.Row;
|
||||
root.Overflow = YogaOverflow.Hidden;
|
||||
root.Width = 50f;
|
||||
root.Height = 50f;
|
||||
|
||||
CSSNode root_child0 = new CSSNode();
|
||||
root_child0.PositionType = CSSPositionType.Absolute;
|
||||
root_child0.SetPosition(CSSEdge.Start, 0f);
|
||||
root_child0.SetPosition(CSSEdge.Top, 0f);
|
||||
root_child0.PositionType = YogaPositionType.Absolute;
|
||||
root_child0.SetPosition(YogaEdge.Start, 0f);
|
||||
root_child0.SetPosition(YogaEdge.Top, 0f);
|
||||
root.Insert(0, root_child0);
|
||||
|
||||
CSSNode root_child0_child0 = new CSSNode();
|
||||
root_child0_child0.Width = 100f;
|
||||
root_child0_child0.Height = 100f;
|
||||
root_child0.Insert(0, root_child0_child0);
|
||||
root.StyleDirection = CSSDirection.LTR;
|
||||
root.StyleDirection = YogaDirection.LTR;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -220,7 +220,7 @@ namespace Facebook.CSSLayout
|
||||
Assert.AreEqual(100f, root_child0_child0.LayoutWidth);
|
||||
Assert.AreEqual(100f, root_child0_child0.LayoutHeight);
|
||||
|
||||
root.StyleDirection = CSSDirection.RTL;
|
||||
root.StyleDirection = YogaDirection.RTL;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -243,37 +243,37 @@ namespace Facebook.CSSLayout
|
||||
public void Test_absolute_layout_within_border()
|
||||
{
|
||||
CSSNode root = new CSSNode();
|
||||
root.SetMargin(CSSEdge.Left, 10f);
|
||||
root.SetMargin(CSSEdge.Top, 10f);
|
||||
root.SetMargin(CSSEdge.Right, 10f);
|
||||
root.SetMargin(CSSEdge.Bottom, 10f);
|
||||
root.SetPadding(CSSEdge.Left, 10f);
|
||||
root.SetPadding(CSSEdge.Top, 10f);
|
||||
root.SetPadding(CSSEdge.Right, 10f);
|
||||
root.SetPadding(CSSEdge.Bottom, 10f);
|
||||
root.SetBorder(CSSEdge.Left, 10f);
|
||||
root.SetBorder(CSSEdge.Top, 10f);
|
||||
root.SetBorder(CSSEdge.Right, 10f);
|
||||
root.SetBorder(CSSEdge.Bottom, 10f);
|
||||
root.SetMargin(YogaEdge.Left, 10f);
|
||||
root.SetMargin(YogaEdge.Top, 10f);
|
||||
root.SetMargin(YogaEdge.Right, 10f);
|
||||
root.SetMargin(YogaEdge.Bottom, 10f);
|
||||
root.SetPadding(YogaEdge.Left, 10f);
|
||||
root.SetPadding(YogaEdge.Top, 10f);
|
||||
root.SetPadding(YogaEdge.Right, 10f);
|
||||
root.SetPadding(YogaEdge.Bottom, 10f);
|
||||
root.SetBorder(YogaEdge.Left, 10f);
|
||||
root.SetBorder(YogaEdge.Top, 10f);
|
||||
root.SetBorder(YogaEdge.Right, 10f);
|
||||
root.SetBorder(YogaEdge.Bottom, 10f);
|
||||
root.Width = 100f;
|
||||
root.Height = 100f;
|
||||
|
||||
CSSNode root_child0 = new CSSNode();
|
||||
root_child0.PositionType = CSSPositionType.Absolute;
|
||||
root_child0.SetPosition(CSSEdge.Left, 0f);
|
||||
root_child0.SetPosition(CSSEdge.Top, 0f);
|
||||
root_child0.PositionType = YogaPositionType.Absolute;
|
||||
root_child0.SetPosition(YogaEdge.Left, 0f);
|
||||
root_child0.SetPosition(YogaEdge.Top, 0f);
|
||||
root_child0.Width = 50f;
|
||||
root_child0.Height = 50f;
|
||||
root.Insert(0, root_child0);
|
||||
|
||||
CSSNode root_child1 = new CSSNode();
|
||||
root_child1.PositionType = CSSPositionType.Absolute;
|
||||
root_child1.SetPosition(CSSEdge.Right, 0f);
|
||||
root_child1.SetPosition(CSSEdge.Bottom, 0f);
|
||||
root_child1.PositionType = YogaPositionType.Absolute;
|
||||
root_child1.SetPosition(YogaEdge.Right, 0f);
|
||||
root_child1.SetPosition(YogaEdge.Bottom, 0f);
|
||||
root_child1.Width = 50f;
|
||||
root_child1.Height = 50f;
|
||||
root.Insert(1, root_child1);
|
||||
root.StyleDirection = CSSDirection.LTR;
|
||||
root.StyleDirection = YogaDirection.LTR;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(10f, root.LayoutX);
|
||||
@@ -291,7 +291,7 @@ namespace Facebook.CSSLayout
|
||||
Assert.AreEqual(50f, root_child1.LayoutWidth);
|
||||
Assert.AreEqual(50f, root_child1.LayoutHeight);
|
||||
|
||||
root.StyleDirection = CSSDirection.RTL;
|
||||
root.StyleDirection = YogaDirection.RTL;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(10f, root.LayoutX);
|
||||
|
@@ -21,7 +21,7 @@ namespace Facebook.CSSLayout
|
||||
public void Test_align_content_flex_start()
|
||||
{
|
||||
CSSNode root = new CSSNode();
|
||||
root.Wrap = CSSWrap.Wrap;
|
||||
root.Wrap = YogaWrap.Wrap;
|
||||
root.Width = 100f;
|
||||
root.Height = 100f;
|
||||
|
||||
@@ -49,7 +49,7 @@ namespace Facebook.CSSLayout
|
||||
root_child4.Width = 50f;
|
||||
root_child4.Height = 10f;
|
||||
root.Insert(4, root_child4);
|
||||
root.StyleDirection = CSSDirection.LTR;
|
||||
root.StyleDirection = YogaDirection.LTR;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -82,7 +82,7 @@ namespace Facebook.CSSLayout
|
||||
Assert.AreEqual(50f, root_child4.LayoutWidth);
|
||||
Assert.AreEqual(10f, root_child4.LayoutHeight);
|
||||
|
||||
root.StyleDirection = CSSDirection.RTL;
|
||||
root.StyleDirection = YogaDirection.RTL;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -120,8 +120,8 @@ namespace Facebook.CSSLayout
|
||||
public void Test_align_content_flex_end()
|
||||
{
|
||||
CSSNode root = new CSSNode();
|
||||
root.AlignContent = CSSAlign.FlexEnd;
|
||||
root.Wrap = CSSWrap.Wrap;
|
||||
root.AlignContent = YogaAlign.FlexEnd;
|
||||
root.Wrap = YogaWrap.Wrap;
|
||||
root.Width = 100f;
|
||||
root.Height = 100f;
|
||||
|
||||
@@ -149,7 +149,7 @@ namespace Facebook.CSSLayout
|
||||
root_child4.Width = 50f;
|
||||
root_child4.Height = 10f;
|
||||
root.Insert(4, root_child4);
|
||||
root.StyleDirection = CSSDirection.LTR;
|
||||
root.StyleDirection = YogaDirection.LTR;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -182,7 +182,7 @@ namespace Facebook.CSSLayout
|
||||
Assert.AreEqual(50f, root_child4.LayoutWidth);
|
||||
Assert.AreEqual(10f, root_child4.LayoutHeight);
|
||||
|
||||
root.StyleDirection = CSSDirection.RTL;
|
||||
root.StyleDirection = YogaDirection.RTL;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -220,8 +220,8 @@ namespace Facebook.CSSLayout
|
||||
public void Test_align_content_center()
|
||||
{
|
||||
CSSNode root = new CSSNode();
|
||||
root.AlignContent = CSSAlign.Center;
|
||||
root.Wrap = CSSWrap.Wrap;
|
||||
root.AlignContent = YogaAlign.Center;
|
||||
root.Wrap = YogaWrap.Wrap;
|
||||
root.Width = 100f;
|
||||
root.Height = 100f;
|
||||
|
||||
@@ -249,7 +249,7 @@ namespace Facebook.CSSLayout
|
||||
root_child4.Width = 50f;
|
||||
root_child4.Height = 10f;
|
||||
root.Insert(4, root_child4);
|
||||
root.StyleDirection = CSSDirection.LTR;
|
||||
root.StyleDirection = YogaDirection.LTR;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -282,7 +282,7 @@ namespace Facebook.CSSLayout
|
||||
Assert.AreEqual(50f, root_child4.LayoutWidth);
|
||||
Assert.AreEqual(10f, root_child4.LayoutHeight);
|
||||
|
||||
root.StyleDirection = CSSDirection.RTL;
|
||||
root.StyleDirection = YogaDirection.RTL;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -320,8 +320,8 @@ namespace Facebook.CSSLayout
|
||||
public void Test_align_content_stretch()
|
||||
{
|
||||
CSSNode root = new CSSNode();
|
||||
root.AlignContent = CSSAlign.Stretch;
|
||||
root.Wrap = CSSWrap.Wrap;
|
||||
root.AlignContent = YogaAlign.Stretch;
|
||||
root.Wrap = YogaWrap.Wrap;
|
||||
root.Width = 100f;
|
||||
root.Height = 100f;
|
||||
|
||||
@@ -344,7 +344,7 @@ namespace Facebook.CSSLayout
|
||||
CSSNode root_child4 = new CSSNode();
|
||||
root_child4.Width = 50f;
|
||||
root.Insert(4, root_child4);
|
||||
root.StyleDirection = CSSDirection.LTR;
|
||||
root.StyleDirection = YogaDirection.LTR;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -377,7 +377,7 @@ namespace Facebook.CSSLayout
|
||||
Assert.AreEqual(50f, root_child4.LayoutWidth);
|
||||
Assert.AreEqual(0f, root_child4.LayoutHeight);
|
||||
|
||||
root.StyleDirection = CSSDirection.RTL;
|
||||
root.StyleDirection = YogaDirection.RTL;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
|
@@ -27,7 +27,7 @@ namespace Facebook.CSSLayout
|
||||
CSSNode root_child0 = new CSSNode();
|
||||
root_child0.Height = 10f;
|
||||
root.Insert(0, root_child0);
|
||||
root.StyleDirection = CSSDirection.LTR;
|
||||
root.StyleDirection = YogaDirection.LTR;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -40,7 +40,7 @@ namespace Facebook.CSSLayout
|
||||
Assert.AreEqual(100f, root_child0.LayoutWidth);
|
||||
Assert.AreEqual(10f, root_child0.LayoutHeight);
|
||||
|
||||
root.StyleDirection = CSSDirection.RTL;
|
||||
root.StyleDirection = YogaDirection.RTL;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -58,7 +58,7 @@ namespace Facebook.CSSLayout
|
||||
public void Test_align_items_center()
|
||||
{
|
||||
CSSNode root = new CSSNode();
|
||||
root.AlignItems = CSSAlign.Center;
|
||||
root.AlignItems = YogaAlign.Center;
|
||||
root.Width = 100f;
|
||||
root.Height = 100f;
|
||||
|
||||
@@ -66,7 +66,7 @@ namespace Facebook.CSSLayout
|
||||
root_child0.Width = 10f;
|
||||
root_child0.Height = 10f;
|
||||
root.Insert(0, root_child0);
|
||||
root.StyleDirection = CSSDirection.LTR;
|
||||
root.StyleDirection = YogaDirection.LTR;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -79,7 +79,7 @@ namespace Facebook.CSSLayout
|
||||
Assert.AreEqual(10f, root_child0.LayoutWidth);
|
||||
Assert.AreEqual(10f, root_child0.LayoutHeight);
|
||||
|
||||
root.StyleDirection = CSSDirection.RTL;
|
||||
root.StyleDirection = YogaDirection.RTL;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -97,7 +97,7 @@ namespace Facebook.CSSLayout
|
||||
public void Test_align_items_flex_start()
|
||||
{
|
||||
CSSNode root = new CSSNode();
|
||||
root.AlignItems = CSSAlign.FlexStart;
|
||||
root.AlignItems = YogaAlign.FlexStart;
|
||||
root.Width = 100f;
|
||||
root.Height = 100f;
|
||||
|
||||
@@ -105,7 +105,7 @@ namespace Facebook.CSSLayout
|
||||
root_child0.Width = 10f;
|
||||
root_child0.Height = 10f;
|
||||
root.Insert(0, root_child0);
|
||||
root.StyleDirection = CSSDirection.LTR;
|
||||
root.StyleDirection = YogaDirection.LTR;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -118,7 +118,7 @@ namespace Facebook.CSSLayout
|
||||
Assert.AreEqual(10f, root_child0.LayoutWidth);
|
||||
Assert.AreEqual(10f, root_child0.LayoutHeight);
|
||||
|
||||
root.StyleDirection = CSSDirection.RTL;
|
||||
root.StyleDirection = YogaDirection.RTL;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -136,7 +136,7 @@ namespace Facebook.CSSLayout
|
||||
public void Test_align_items_flex_end()
|
||||
{
|
||||
CSSNode root = new CSSNode();
|
||||
root.AlignItems = CSSAlign.FlexEnd;
|
||||
root.AlignItems = YogaAlign.FlexEnd;
|
||||
root.Width = 100f;
|
||||
root.Height = 100f;
|
||||
|
||||
@@ -144,7 +144,7 @@ namespace Facebook.CSSLayout
|
||||
root_child0.Width = 10f;
|
||||
root_child0.Height = 10f;
|
||||
root.Insert(0, root_child0);
|
||||
root.StyleDirection = CSSDirection.LTR;
|
||||
root.StyleDirection = YogaDirection.LTR;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -157,7 +157,7 @@ namespace Facebook.CSSLayout
|
||||
Assert.AreEqual(10f, root_child0.LayoutWidth);
|
||||
Assert.AreEqual(10f, root_child0.LayoutHeight);
|
||||
|
||||
root.StyleDirection = CSSDirection.RTL;
|
||||
root.StyleDirection = YogaDirection.RTL;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
|
@@ -25,11 +25,11 @@ namespace Facebook.CSSLayout
|
||||
root.Height = 100f;
|
||||
|
||||
CSSNode root_child0 = new CSSNode();
|
||||
root_child0.AlignSelf = CSSAlign.Center;
|
||||
root_child0.AlignSelf = YogaAlign.Center;
|
||||
root_child0.Width = 10f;
|
||||
root_child0.Height = 10f;
|
||||
root.Insert(0, root_child0);
|
||||
root.StyleDirection = CSSDirection.LTR;
|
||||
root.StyleDirection = YogaDirection.LTR;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -42,7 +42,7 @@ namespace Facebook.CSSLayout
|
||||
Assert.AreEqual(10f, root_child0.LayoutWidth);
|
||||
Assert.AreEqual(10f, root_child0.LayoutHeight);
|
||||
|
||||
root.StyleDirection = CSSDirection.RTL;
|
||||
root.StyleDirection = YogaDirection.RTL;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -64,11 +64,11 @@ namespace Facebook.CSSLayout
|
||||
root.Height = 100f;
|
||||
|
||||
CSSNode root_child0 = new CSSNode();
|
||||
root_child0.AlignSelf = CSSAlign.FlexEnd;
|
||||
root_child0.AlignSelf = YogaAlign.FlexEnd;
|
||||
root_child0.Width = 10f;
|
||||
root_child0.Height = 10f;
|
||||
root.Insert(0, root_child0);
|
||||
root.StyleDirection = CSSDirection.LTR;
|
||||
root.StyleDirection = YogaDirection.LTR;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -81,7 +81,7 @@ namespace Facebook.CSSLayout
|
||||
Assert.AreEqual(10f, root_child0.LayoutWidth);
|
||||
Assert.AreEqual(10f, root_child0.LayoutHeight);
|
||||
|
||||
root.StyleDirection = CSSDirection.RTL;
|
||||
root.StyleDirection = YogaDirection.RTL;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -103,11 +103,11 @@ namespace Facebook.CSSLayout
|
||||
root.Height = 100f;
|
||||
|
||||
CSSNode root_child0 = new CSSNode();
|
||||
root_child0.AlignSelf = CSSAlign.FlexStart;
|
||||
root_child0.AlignSelf = YogaAlign.FlexStart;
|
||||
root_child0.Width = 10f;
|
||||
root_child0.Height = 10f;
|
||||
root.Insert(0, root_child0);
|
||||
root.StyleDirection = CSSDirection.LTR;
|
||||
root.StyleDirection = YogaDirection.LTR;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -120,7 +120,7 @@ namespace Facebook.CSSLayout
|
||||
Assert.AreEqual(10f, root_child0.LayoutWidth);
|
||||
Assert.AreEqual(10f, root_child0.LayoutHeight);
|
||||
|
||||
root.StyleDirection = CSSDirection.RTL;
|
||||
root.StyleDirection = YogaDirection.RTL;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -138,16 +138,16 @@ namespace Facebook.CSSLayout
|
||||
public void Test_align_self_flex_end_override_flex_start()
|
||||
{
|
||||
CSSNode root = new CSSNode();
|
||||
root.AlignItems = CSSAlign.FlexStart;
|
||||
root.AlignItems = YogaAlign.FlexStart;
|
||||
root.Width = 100f;
|
||||
root.Height = 100f;
|
||||
|
||||
CSSNode root_child0 = new CSSNode();
|
||||
root_child0.AlignSelf = CSSAlign.FlexEnd;
|
||||
root_child0.AlignSelf = YogaAlign.FlexEnd;
|
||||
root_child0.Width = 10f;
|
||||
root_child0.Height = 10f;
|
||||
root.Insert(0, root_child0);
|
||||
root.StyleDirection = CSSDirection.LTR;
|
||||
root.StyleDirection = YogaDirection.LTR;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -160,7 +160,7 @@ namespace Facebook.CSSLayout
|
||||
Assert.AreEqual(10f, root_child0.LayoutWidth);
|
||||
Assert.AreEqual(10f, root_child0.LayoutHeight);
|
||||
|
||||
root.StyleDirection = CSSDirection.RTL;
|
||||
root.StyleDirection = YogaDirection.RTL;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
|
@@ -21,11 +21,11 @@ namespace Facebook.CSSLayout
|
||||
public void Test_border_no_size()
|
||||
{
|
||||
CSSNode root = new CSSNode();
|
||||
root.SetBorder(CSSEdge.Left, 10f);
|
||||
root.SetBorder(CSSEdge.Top, 10f);
|
||||
root.SetBorder(CSSEdge.Right, 10f);
|
||||
root.SetBorder(CSSEdge.Bottom, 10f);
|
||||
root.StyleDirection = CSSDirection.LTR;
|
||||
root.SetBorder(YogaEdge.Left, 10f);
|
||||
root.SetBorder(YogaEdge.Top, 10f);
|
||||
root.SetBorder(YogaEdge.Right, 10f);
|
||||
root.SetBorder(YogaEdge.Bottom, 10f);
|
||||
root.StyleDirection = YogaDirection.LTR;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -33,7 +33,7 @@ namespace Facebook.CSSLayout
|
||||
Assert.AreEqual(20f, root.LayoutWidth);
|
||||
Assert.AreEqual(20f, root.LayoutHeight);
|
||||
|
||||
root.StyleDirection = CSSDirection.RTL;
|
||||
root.StyleDirection = YogaDirection.RTL;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -46,16 +46,16 @@ namespace Facebook.CSSLayout
|
||||
public void Test_border_container_match_child()
|
||||
{
|
||||
CSSNode root = new CSSNode();
|
||||
root.SetBorder(CSSEdge.Left, 10f);
|
||||
root.SetBorder(CSSEdge.Top, 10f);
|
||||
root.SetBorder(CSSEdge.Right, 10f);
|
||||
root.SetBorder(CSSEdge.Bottom, 10f);
|
||||
root.SetBorder(YogaEdge.Left, 10f);
|
||||
root.SetBorder(YogaEdge.Top, 10f);
|
||||
root.SetBorder(YogaEdge.Right, 10f);
|
||||
root.SetBorder(YogaEdge.Bottom, 10f);
|
||||
|
||||
CSSNode root_child0 = new CSSNode();
|
||||
root_child0.Width = 10f;
|
||||
root_child0.Height = 10f;
|
||||
root.Insert(0, root_child0);
|
||||
root.StyleDirection = CSSDirection.LTR;
|
||||
root.StyleDirection = YogaDirection.LTR;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -68,7 +68,7 @@ namespace Facebook.CSSLayout
|
||||
Assert.AreEqual(10f, root_child0.LayoutWidth);
|
||||
Assert.AreEqual(10f, root_child0.LayoutHeight);
|
||||
|
||||
root.StyleDirection = CSSDirection.RTL;
|
||||
root.StyleDirection = YogaDirection.RTL;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -86,10 +86,10 @@ namespace Facebook.CSSLayout
|
||||
public void Test_border_flex_child()
|
||||
{
|
||||
CSSNode root = new CSSNode();
|
||||
root.SetBorder(CSSEdge.Left, 10f);
|
||||
root.SetBorder(CSSEdge.Top, 10f);
|
||||
root.SetBorder(CSSEdge.Right, 10f);
|
||||
root.SetBorder(CSSEdge.Bottom, 10f);
|
||||
root.SetBorder(YogaEdge.Left, 10f);
|
||||
root.SetBorder(YogaEdge.Top, 10f);
|
||||
root.SetBorder(YogaEdge.Right, 10f);
|
||||
root.SetBorder(YogaEdge.Bottom, 10f);
|
||||
root.Width = 100f;
|
||||
root.Height = 100f;
|
||||
|
||||
@@ -97,7 +97,7 @@ namespace Facebook.CSSLayout
|
||||
root_child0.FlexGrow = 1f;
|
||||
root_child0.Width = 10f;
|
||||
root.Insert(0, root_child0);
|
||||
root.StyleDirection = CSSDirection.LTR;
|
||||
root.StyleDirection = YogaDirection.LTR;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -110,7 +110,7 @@ namespace Facebook.CSSLayout
|
||||
Assert.AreEqual(10f, root_child0.LayoutWidth);
|
||||
Assert.AreEqual(80f, root_child0.LayoutHeight);
|
||||
|
||||
root.StyleDirection = CSSDirection.RTL;
|
||||
root.StyleDirection = YogaDirection.RTL;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -128,17 +128,17 @@ namespace Facebook.CSSLayout
|
||||
public void Test_border_stretch_child()
|
||||
{
|
||||
CSSNode root = new CSSNode();
|
||||
root.SetBorder(CSSEdge.Left, 10f);
|
||||
root.SetBorder(CSSEdge.Top, 10f);
|
||||
root.SetBorder(CSSEdge.Right, 10f);
|
||||
root.SetBorder(CSSEdge.Bottom, 10f);
|
||||
root.SetBorder(YogaEdge.Left, 10f);
|
||||
root.SetBorder(YogaEdge.Top, 10f);
|
||||
root.SetBorder(YogaEdge.Right, 10f);
|
||||
root.SetBorder(YogaEdge.Bottom, 10f);
|
||||
root.Width = 100f;
|
||||
root.Height = 100f;
|
||||
|
||||
CSSNode root_child0 = new CSSNode();
|
||||
root_child0.Height = 10f;
|
||||
root.Insert(0, root_child0);
|
||||
root.StyleDirection = CSSDirection.LTR;
|
||||
root.StyleDirection = YogaDirection.LTR;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -151,7 +151,7 @@ namespace Facebook.CSSLayout
|
||||
Assert.AreEqual(80f, root_child0.LayoutWidth);
|
||||
Assert.AreEqual(10f, root_child0.LayoutHeight);
|
||||
|
||||
root.StyleDirection = CSSDirection.RTL;
|
||||
root.StyleDirection = YogaDirection.RTL;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -169,11 +169,11 @@ namespace Facebook.CSSLayout
|
||||
public void Test_border_center_child()
|
||||
{
|
||||
CSSNode root = new CSSNode();
|
||||
root.JustifyContent = CSSJustify.Center;
|
||||
root.AlignItems = CSSAlign.Center;
|
||||
root.SetBorder(CSSEdge.Start, 10f);
|
||||
root.SetBorder(CSSEdge.End, 20f);
|
||||
root.SetBorder(CSSEdge.Bottom, 20f);
|
||||
root.JustifyContent = YogaJustify.Center;
|
||||
root.AlignItems = YogaAlign.Center;
|
||||
root.SetBorder(YogaEdge.Start, 10f);
|
||||
root.SetBorder(YogaEdge.End, 20f);
|
||||
root.SetBorder(YogaEdge.Bottom, 20f);
|
||||
root.Width = 100f;
|
||||
root.Height = 100f;
|
||||
|
||||
@@ -181,7 +181,7 @@ namespace Facebook.CSSLayout
|
||||
root_child0.Width = 10f;
|
||||
root_child0.Height = 10f;
|
||||
root.Insert(0, root_child0);
|
||||
root.StyleDirection = CSSDirection.LTR;
|
||||
root.StyleDirection = YogaDirection.LTR;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -194,7 +194,7 @@ namespace Facebook.CSSLayout
|
||||
Assert.AreEqual(10f, root_child0.LayoutWidth);
|
||||
Assert.AreEqual(10f, root_child0.LayoutHeight);
|
||||
|
||||
root.StyleDirection = CSSDirection.RTL;
|
||||
root.StyleDirection = YogaDirection.RTL;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
|
@@ -34,7 +34,7 @@ namespace Facebook.CSSLayout
|
||||
CSSNode root_child2 = new CSSNode();
|
||||
root_child2.Height = 10f;
|
||||
root.Insert(2, root_child2);
|
||||
root.StyleDirection = CSSDirection.LTR;
|
||||
root.StyleDirection = YogaDirection.LTR;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -57,7 +57,7 @@ namespace Facebook.CSSLayout
|
||||
Assert.AreEqual(100f, root_child2.LayoutWidth);
|
||||
Assert.AreEqual(10f, root_child2.LayoutHeight);
|
||||
|
||||
root.StyleDirection = CSSDirection.RTL;
|
||||
root.StyleDirection = YogaDirection.RTL;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -85,7 +85,7 @@ namespace Facebook.CSSLayout
|
||||
public void Test_flex_direction_row_no_width()
|
||||
{
|
||||
CSSNode root = new CSSNode();
|
||||
root.FlexDirection = CSSFlexDirection.Row;
|
||||
root.FlexDirection = YogaFlexDirection.Row;
|
||||
root.Height = 100f;
|
||||
|
||||
CSSNode root_child0 = new CSSNode();
|
||||
@@ -99,7 +99,7 @@ namespace Facebook.CSSLayout
|
||||
CSSNode root_child2 = new CSSNode();
|
||||
root_child2.Width = 10f;
|
||||
root.Insert(2, root_child2);
|
||||
root.StyleDirection = CSSDirection.LTR;
|
||||
root.StyleDirection = YogaDirection.LTR;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -122,7 +122,7 @@ namespace Facebook.CSSLayout
|
||||
Assert.AreEqual(10f, root_child2.LayoutWidth);
|
||||
Assert.AreEqual(100f, root_child2.LayoutHeight);
|
||||
|
||||
root.StyleDirection = CSSDirection.RTL;
|
||||
root.StyleDirection = YogaDirection.RTL;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -164,7 +164,7 @@ namespace Facebook.CSSLayout
|
||||
CSSNode root_child2 = new CSSNode();
|
||||
root_child2.Height = 10f;
|
||||
root.Insert(2, root_child2);
|
||||
root.StyleDirection = CSSDirection.LTR;
|
||||
root.StyleDirection = YogaDirection.LTR;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -187,7 +187,7 @@ namespace Facebook.CSSLayout
|
||||
Assert.AreEqual(100f, root_child2.LayoutWidth);
|
||||
Assert.AreEqual(10f, root_child2.LayoutHeight);
|
||||
|
||||
root.StyleDirection = CSSDirection.RTL;
|
||||
root.StyleDirection = YogaDirection.RTL;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -215,7 +215,7 @@ namespace Facebook.CSSLayout
|
||||
public void Test_flex_direction_row()
|
||||
{
|
||||
CSSNode root = new CSSNode();
|
||||
root.FlexDirection = CSSFlexDirection.Row;
|
||||
root.FlexDirection = YogaFlexDirection.Row;
|
||||
root.Width = 100f;
|
||||
root.Height = 100f;
|
||||
|
||||
@@ -230,7 +230,7 @@ namespace Facebook.CSSLayout
|
||||
CSSNode root_child2 = new CSSNode();
|
||||
root_child2.Width = 10f;
|
||||
root.Insert(2, root_child2);
|
||||
root.StyleDirection = CSSDirection.LTR;
|
||||
root.StyleDirection = YogaDirection.LTR;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -253,7 +253,7 @@ namespace Facebook.CSSLayout
|
||||
Assert.AreEqual(10f, root_child2.LayoutWidth);
|
||||
Assert.AreEqual(100f, root_child2.LayoutHeight);
|
||||
|
||||
root.StyleDirection = CSSDirection.RTL;
|
||||
root.StyleDirection = YogaDirection.RTL;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -281,7 +281,7 @@ namespace Facebook.CSSLayout
|
||||
public void Test_flex_direction_column_reverse()
|
||||
{
|
||||
CSSNode root = new CSSNode();
|
||||
root.FlexDirection = CSSFlexDirection.ColumnReverse;
|
||||
root.FlexDirection = YogaFlexDirection.ColumnReverse;
|
||||
root.Width = 100f;
|
||||
root.Height = 100f;
|
||||
|
||||
@@ -296,7 +296,7 @@ namespace Facebook.CSSLayout
|
||||
CSSNode root_child2 = new CSSNode();
|
||||
root_child2.Height = 10f;
|
||||
root.Insert(2, root_child2);
|
||||
root.StyleDirection = CSSDirection.LTR;
|
||||
root.StyleDirection = YogaDirection.LTR;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -319,7 +319,7 @@ namespace Facebook.CSSLayout
|
||||
Assert.AreEqual(100f, root_child2.LayoutWidth);
|
||||
Assert.AreEqual(10f, root_child2.LayoutHeight);
|
||||
|
||||
root.StyleDirection = CSSDirection.RTL;
|
||||
root.StyleDirection = YogaDirection.RTL;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -347,7 +347,7 @@ namespace Facebook.CSSLayout
|
||||
public void Test_flex_direction_row_reverse()
|
||||
{
|
||||
CSSNode root = new CSSNode();
|
||||
root.FlexDirection = CSSFlexDirection.RowReverse;
|
||||
root.FlexDirection = YogaFlexDirection.RowReverse;
|
||||
root.Width = 100f;
|
||||
root.Height = 100f;
|
||||
|
||||
@@ -362,7 +362,7 @@ namespace Facebook.CSSLayout
|
||||
CSSNode root_child2 = new CSSNode();
|
||||
root_child2.Width = 10f;
|
||||
root.Insert(2, root_child2);
|
||||
root.StyleDirection = CSSDirection.LTR;
|
||||
root.StyleDirection = YogaDirection.LTR;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -385,7 +385,7 @@ namespace Facebook.CSSLayout
|
||||
Assert.AreEqual(10f, root_child2.LayoutWidth);
|
||||
Assert.AreEqual(100f, root_child2.LayoutHeight);
|
||||
|
||||
root.StyleDirection = CSSDirection.RTL;
|
||||
root.StyleDirection = YogaDirection.RTL;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
|
@@ -32,7 +32,7 @@ namespace Facebook.CSSLayout
|
||||
CSSNode root_child1 = new CSSNode();
|
||||
root_child1.FlexGrow = 1f;
|
||||
root.Insert(1, root_child1);
|
||||
root.StyleDirection = CSSDirection.LTR;
|
||||
root.StyleDirection = YogaDirection.LTR;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -50,7 +50,7 @@ namespace Facebook.CSSLayout
|
||||
Assert.AreEqual(100f, root_child1.LayoutWidth);
|
||||
Assert.AreEqual(25f, root_child1.LayoutHeight);
|
||||
|
||||
root.StyleDirection = CSSDirection.RTL;
|
||||
root.StyleDirection = YogaDirection.RTL;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -73,7 +73,7 @@ namespace Facebook.CSSLayout
|
||||
public void Test_flex_basis_flex_grow_row()
|
||||
{
|
||||
CSSNode root = new CSSNode();
|
||||
root.FlexDirection = CSSFlexDirection.Row;
|
||||
root.FlexDirection = YogaFlexDirection.Row;
|
||||
root.Width = 100f;
|
||||
root.Height = 100f;
|
||||
|
||||
@@ -85,7 +85,7 @@ namespace Facebook.CSSLayout
|
||||
CSSNode root_child1 = new CSSNode();
|
||||
root_child1.FlexGrow = 1f;
|
||||
root.Insert(1, root_child1);
|
||||
root.StyleDirection = CSSDirection.LTR;
|
||||
root.StyleDirection = YogaDirection.LTR;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -103,7 +103,7 @@ namespace Facebook.CSSLayout
|
||||
Assert.AreEqual(25f, root_child1.LayoutWidth);
|
||||
Assert.AreEqual(100f, root_child1.LayoutHeight);
|
||||
|
||||
root.StyleDirection = CSSDirection.RTL;
|
||||
root.StyleDirection = YogaDirection.RTL;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -137,7 +137,7 @@ namespace Facebook.CSSLayout
|
||||
CSSNode root_child1 = new CSSNode();
|
||||
root_child1.FlexBasis = 50f;
|
||||
root.Insert(1, root_child1);
|
||||
root.StyleDirection = CSSDirection.LTR;
|
||||
root.StyleDirection = YogaDirection.LTR;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -155,7 +155,7 @@ namespace Facebook.CSSLayout
|
||||
Assert.AreEqual(100f, root_child1.LayoutWidth);
|
||||
Assert.AreEqual(50f, root_child1.LayoutHeight);
|
||||
|
||||
root.StyleDirection = CSSDirection.RTL;
|
||||
root.StyleDirection = YogaDirection.RTL;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -178,7 +178,7 @@ namespace Facebook.CSSLayout
|
||||
public void Test_flex_basis_flex_shrink_row()
|
||||
{
|
||||
CSSNode root = new CSSNode();
|
||||
root.FlexDirection = CSSFlexDirection.Row;
|
||||
root.FlexDirection = YogaFlexDirection.Row;
|
||||
root.Width = 100f;
|
||||
root.Height = 100f;
|
||||
|
||||
@@ -190,7 +190,7 @@ namespace Facebook.CSSLayout
|
||||
CSSNode root_child1 = new CSSNode();
|
||||
root_child1.FlexBasis = 50f;
|
||||
root.Insert(1, root_child1);
|
||||
root.StyleDirection = CSSDirection.LTR;
|
||||
root.StyleDirection = YogaDirection.LTR;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -208,7 +208,7 @@ namespace Facebook.CSSLayout
|
||||
Assert.AreEqual(50f, root_child1.LayoutWidth);
|
||||
Assert.AreEqual(100f, root_child1.LayoutHeight);
|
||||
|
||||
root.StyleDirection = CSSDirection.RTL;
|
||||
root.StyleDirection = YogaDirection.RTL;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -248,7 +248,7 @@ namespace Facebook.CSSLayout
|
||||
root_child2.Width = 50f;
|
||||
root_child2.Height = 50f;
|
||||
root.Insert(2, root_child2);
|
||||
root.StyleDirection = CSSDirection.LTR;
|
||||
root.StyleDirection = YogaDirection.LTR;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -271,7 +271,7 @@ namespace Facebook.CSSLayout
|
||||
Assert.AreEqual(50f, root_child2.LayoutWidth);
|
||||
Assert.AreEqual(50f, root_child2.LayoutHeight);
|
||||
|
||||
root.StyleDirection = CSSDirection.RTL;
|
||||
root.StyleDirection = YogaDirection.RTL;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -317,7 +317,7 @@ namespace Facebook.CSSLayout
|
||||
root_child2.FlexGrow = 1f;
|
||||
root_child2.Height = 10f;
|
||||
root.Insert(2, root_child2);
|
||||
root.StyleDirection = CSSDirection.LTR;
|
||||
root.StyleDirection = YogaDirection.LTR;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -340,7 +340,7 @@ namespace Facebook.CSSLayout
|
||||
Assert.AreEqual(100f, root_child2.LayoutWidth);
|
||||
Assert.AreEqual(20f, root_child2.LayoutHeight);
|
||||
|
||||
root.StyleDirection = CSSDirection.RTL;
|
||||
root.StyleDirection = YogaDirection.RTL;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -378,7 +378,7 @@ namespace Facebook.CSSLayout
|
||||
root_child0_child0.FlexGrow = 1f;
|
||||
root_child0_child0.FlexShrink = 1f;
|
||||
root_child0.Insert(0, root_child0_child0);
|
||||
root.StyleDirection = CSSDirection.LTR;
|
||||
root.StyleDirection = YogaDirection.LTR;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -396,7 +396,7 @@ namespace Facebook.CSSLayout
|
||||
Assert.AreEqual(100f, root_child0_child0.LayoutWidth);
|
||||
Assert.AreEqual(0f, root_child0_child0.LayoutHeight);
|
||||
|
||||
root.StyleDirection = CSSDirection.RTL;
|
||||
root.StyleDirection = YogaDirection.RTL;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
|
@@ -21,7 +21,7 @@ namespace Facebook.CSSLayout
|
||||
public void Test_wrap_column()
|
||||
{
|
||||
CSSNode root = new CSSNode();
|
||||
root.Wrap = CSSWrap.Wrap;
|
||||
root.Wrap = YogaWrap.Wrap;
|
||||
root.Height = 100f;
|
||||
|
||||
CSSNode root_child0 = new CSSNode();
|
||||
@@ -43,7 +43,7 @@ namespace Facebook.CSSLayout
|
||||
root_child3.Width = 30f;
|
||||
root_child3.Height = 30f;
|
||||
root.Insert(3, root_child3);
|
||||
root.StyleDirection = CSSDirection.LTR;
|
||||
root.StyleDirection = YogaDirection.LTR;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -71,7 +71,7 @@ namespace Facebook.CSSLayout
|
||||
Assert.AreEqual(30f, root_child3.LayoutWidth);
|
||||
Assert.AreEqual(30f, root_child3.LayoutHeight);
|
||||
|
||||
root.StyleDirection = CSSDirection.RTL;
|
||||
root.StyleDirection = YogaDirection.RTL;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -104,8 +104,8 @@ namespace Facebook.CSSLayout
|
||||
public void Test_wrap_row()
|
||||
{
|
||||
CSSNode root = new CSSNode();
|
||||
root.FlexDirection = CSSFlexDirection.Row;
|
||||
root.Wrap = CSSWrap.Wrap;
|
||||
root.FlexDirection = YogaFlexDirection.Row;
|
||||
root.Wrap = YogaWrap.Wrap;
|
||||
root.Width = 100f;
|
||||
|
||||
CSSNode root_child0 = new CSSNode();
|
||||
@@ -127,7 +127,7 @@ namespace Facebook.CSSLayout
|
||||
root_child3.Width = 30f;
|
||||
root_child3.Height = 30f;
|
||||
root.Insert(3, root_child3);
|
||||
root.StyleDirection = CSSDirection.LTR;
|
||||
root.StyleDirection = YogaDirection.LTR;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -155,7 +155,7 @@ namespace Facebook.CSSLayout
|
||||
Assert.AreEqual(30f, root_child3.LayoutWidth);
|
||||
Assert.AreEqual(30f, root_child3.LayoutHeight);
|
||||
|
||||
root.StyleDirection = CSSDirection.RTL;
|
||||
root.StyleDirection = YogaDirection.RTL;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -188,9 +188,9 @@ namespace Facebook.CSSLayout
|
||||
public void Test_wrap_row_align_items_flex_end()
|
||||
{
|
||||
CSSNode root = new CSSNode();
|
||||
root.FlexDirection = CSSFlexDirection.Row;
|
||||
root.AlignItems = CSSAlign.FlexEnd;
|
||||
root.Wrap = CSSWrap.Wrap;
|
||||
root.FlexDirection = YogaFlexDirection.Row;
|
||||
root.AlignItems = YogaAlign.FlexEnd;
|
||||
root.Wrap = YogaWrap.Wrap;
|
||||
root.Width = 100f;
|
||||
|
||||
CSSNode root_child0 = new CSSNode();
|
||||
@@ -212,7 +212,7 @@ namespace Facebook.CSSLayout
|
||||
root_child3.Width = 30f;
|
||||
root_child3.Height = 30f;
|
||||
root.Insert(3, root_child3);
|
||||
root.StyleDirection = CSSDirection.LTR;
|
||||
root.StyleDirection = YogaDirection.LTR;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -240,7 +240,7 @@ namespace Facebook.CSSLayout
|
||||
Assert.AreEqual(30f, root_child3.LayoutWidth);
|
||||
Assert.AreEqual(30f, root_child3.LayoutHeight);
|
||||
|
||||
root.StyleDirection = CSSDirection.RTL;
|
||||
root.StyleDirection = YogaDirection.RTL;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -273,9 +273,9 @@ namespace Facebook.CSSLayout
|
||||
public void Test_wrap_row_align_items_center()
|
||||
{
|
||||
CSSNode root = new CSSNode();
|
||||
root.FlexDirection = CSSFlexDirection.Row;
|
||||
root.AlignItems = CSSAlign.Center;
|
||||
root.Wrap = CSSWrap.Wrap;
|
||||
root.FlexDirection = YogaFlexDirection.Row;
|
||||
root.AlignItems = YogaAlign.Center;
|
||||
root.Wrap = YogaWrap.Wrap;
|
||||
root.Width = 100f;
|
||||
|
||||
CSSNode root_child0 = new CSSNode();
|
||||
@@ -297,7 +297,7 @@ namespace Facebook.CSSLayout
|
||||
root_child3.Width = 30f;
|
||||
root_child3.Height = 30f;
|
||||
root.Insert(3, root_child3);
|
||||
root.StyleDirection = CSSDirection.LTR;
|
||||
root.StyleDirection = YogaDirection.LTR;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -325,7 +325,7 @@ namespace Facebook.CSSLayout
|
||||
Assert.AreEqual(30f, root_child3.LayoutWidth);
|
||||
Assert.AreEqual(30f, root_child3.LayoutHeight);
|
||||
|
||||
root.StyleDirection = CSSDirection.RTL;
|
||||
root.StyleDirection = YogaDirection.RTL;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
|
@@ -21,7 +21,7 @@ namespace Facebook.CSSLayout
|
||||
public void Test_justify_content_row_flex_start()
|
||||
{
|
||||
CSSNode root = new CSSNode();
|
||||
root.FlexDirection = CSSFlexDirection.Row;
|
||||
root.FlexDirection = YogaFlexDirection.Row;
|
||||
root.Width = 102f;
|
||||
root.Height = 102f;
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace Facebook.CSSLayout
|
||||
CSSNode root_child2 = new CSSNode();
|
||||
root_child2.Width = 10f;
|
||||
root.Insert(2, root_child2);
|
||||
root.StyleDirection = CSSDirection.LTR;
|
||||
root.StyleDirection = YogaDirection.LTR;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -59,7 +59,7 @@ namespace Facebook.CSSLayout
|
||||
Assert.AreEqual(10f, root_child2.LayoutWidth);
|
||||
Assert.AreEqual(102f, root_child2.LayoutHeight);
|
||||
|
||||
root.StyleDirection = CSSDirection.RTL;
|
||||
root.StyleDirection = YogaDirection.RTL;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -87,8 +87,8 @@ namespace Facebook.CSSLayout
|
||||
public void Test_justify_content_row_flex_end()
|
||||
{
|
||||
CSSNode root = new CSSNode();
|
||||
root.FlexDirection = CSSFlexDirection.Row;
|
||||
root.JustifyContent = CSSJustify.FlexEnd;
|
||||
root.FlexDirection = YogaFlexDirection.Row;
|
||||
root.JustifyContent = YogaJustify.FlexEnd;
|
||||
root.Width = 102f;
|
||||
root.Height = 102f;
|
||||
|
||||
@@ -103,7 +103,7 @@ namespace Facebook.CSSLayout
|
||||
CSSNode root_child2 = new CSSNode();
|
||||
root_child2.Width = 10f;
|
||||
root.Insert(2, root_child2);
|
||||
root.StyleDirection = CSSDirection.LTR;
|
||||
root.StyleDirection = YogaDirection.LTR;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -126,7 +126,7 @@ namespace Facebook.CSSLayout
|
||||
Assert.AreEqual(10f, root_child2.LayoutWidth);
|
||||
Assert.AreEqual(102f, root_child2.LayoutHeight);
|
||||
|
||||
root.StyleDirection = CSSDirection.RTL;
|
||||
root.StyleDirection = YogaDirection.RTL;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -154,8 +154,8 @@ namespace Facebook.CSSLayout
|
||||
public void Test_justify_content_row_center()
|
||||
{
|
||||
CSSNode root = new CSSNode();
|
||||
root.FlexDirection = CSSFlexDirection.Row;
|
||||
root.JustifyContent = CSSJustify.Center;
|
||||
root.FlexDirection = YogaFlexDirection.Row;
|
||||
root.JustifyContent = YogaJustify.Center;
|
||||
root.Width = 102f;
|
||||
root.Height = 102f;
|
||||
|
||||
@@ -170,7 +170,7 @@ namespace Facebook.CSSLayout
|
||||
CSSNode root_child2 = new CSSNode();
|
||||
root_child2.Width = 10f;
|
||||
root.Insert(2, root_child2);
|
||||
root.StyleDirection = CSSDirection.LTR;
|
||||
root.StyleDirection = YogaDirection.LTR;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -193,7 +193,7 @@ namespace Facebook.CSSLayout
|
||||
Assert.AreEqual(10f, root_child2.LayoutWidth);
|
||||
Assert.AreEqual(102f, root_child2.LayoutHeight);
|
||||
|
||||
root.StyleDirection = CSSDirection.RTL;
|
||||
root.StyleDirection = YogaDirection.RTL;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -221,8 +221,8 @@ namespace Facebook.CSSLayout
|
||||
public void Test_justify_content_row_space_between()
|
||||
{
|
||||
CSSNode root = new CSSNode();
|
||||
root.FlexDirection = CSSFlexDirection.Row;
|
||||
root.JustifyContent = CSSJustify.SpaceBetween;
|
||||
root.FlexDirection = YogaFlexDirection.Row;
|
||||
root.JustifyContent = YogaJustify.SpaceBetween;
|
||||
root.Width = 102f;
|
||||
root.Height = 102f;
|
||||
|
||||
@@ -237,7 +237,7 @@ namespace Facebook.CSSLayout
|
||||
CSSNode root_child2 = new CSSNode();
|
||||
root_child2.Width = 10f;
|
||||
root.Insert(2, root_child2);
|
||||
root.StyleDirection = CSSDirection.LTR;
|
||||
root.StyleDirection = YogaDirection.LTR;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -260,7 +260,7 @@ namespace Facebook.CSSLayout
|
||||
Assert.AreEqual(10f, root_child2.LayoutWidth);
|
||||
Assert.AreEqual(102f, root_child2.LayoutHeight);
|
||||
|
||||
root.StyleDirection = CSSDirection.RTL;
|
||||
root.StyleDirection = YogaDirection.RTL;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -288,8 +288,8 @@ namespace Facebook.CSSLayout
|
||||
public void Test_justify_content_row_space_around()
|
||||
{
|
||||
CSSNode root = new CSSNode();
|
||||
root.FlexDirection = CSSFlexDirection.Row;
|
||||
root.JustifyContent = CSSJustify.SpaceAround;
|
||||
root.FlexDirection = YogaFlexDirection.Row;
|
||||
root.JustifyContent = YogaJustify.SpaceAround;
|
||||
root.Width = 102f;
|
||||
root.Height = 102f;
|
||||
|
||||
@@ -304,7 +304,7 @@ namespace Facebook.CSSLayout
|
||||
CSSNode root_child2 = new CSSNode();
|
||||
root_child2.Width = 10f;
|
||||
root.Insert(2, root_child2);
|
||||
root.StyleDirection = CSSDirection.LTR;
|
||||
root.StyleDirection = YogaDirection.LTR;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -327,7 +327,7 @@ namespace Facebook.CSSLayout
|
||||
Assert.AreEqual(10f, root_child2.LayoutWidth);
|
||||
Assert.AreEqual(102f, root_child2.LayoutHeight);
|
||||
|
||||
root.StyleDirection = CSSDirection.RTL;
|
||||
root.StyleDirection = YogaDirection.RTL;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -368,7 +368,7 @@ namespace Facebook.CSSLayout
|
||||
CSSNode root_child2 = new CSSNode();
|
||||
root_child2.Height = 10f;
|
||||
root.Insert(2, root_child2);
|
||||
root.StyleDirection = CSSDirection.LTR;
|
||||
root.StyleDirection = YogaDirection.LTR;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -391,7 +391,7 @@ namespace Facebook.CSSLayout
|
||||
Assert.AreEqual(102f, root_child2.LayoutWidth);
|
||||
Assert.AreEqual(10f, root_child2.LayoutHeight);
|
||||
|
||||
root.StyleDirection = CSSDirection.RTL;
|
||||
root.StyleDirection = YogaDirection.RTL;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -419,7 +419,7 @@ namespace Facebook.CSSLayout
|
||||
public void Test_justify_content_column_flex_end()
|
||||
{
|
||||
CSSNode root = new CSSNode();
|
||||
root.JustifyContent = CSSJustify.FlexEnd;
|
||||
root.JustifyContent = YogaJustify.FlexEnd;
|
||||
root.Width = 102f;
|
||||
root.Height = 102f;
|
||||
|
||||
@@ -434,7 +434,7 @@ namespace Facebook.CSSLayout
|
||||
CSSNode root_child2 = new CSSNode();
|
||||
root_child2.Height = 10f;
|
||||
root.Insert(2, root_child2);
|
||||
root.StyleDirection = CSSDirection.LTR;
|
||||
root.StyleDirection = YogaDirection.LTR;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -457,7 +457,7 @@ namespace Facebook.CSSLayout
|
||||
Assert.AreEqual(102f, root_child2.LayoutWidth);
|
||||
Assert.AreEqual(10f, root_child2.LayoutHeight);
|
||||
|
||||
root.StyleDirection = CSSDirection.RTL;
|
||||
root.StyleDirection = YogaDirection.RTL;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -485,7 +485,7 @@ namespace Facebook.CSSLayout
|
||||
public void Test_justify_content_column_center()
|
||||
{
|
||||
CSSNode root = new CSSNode();
|
||||
root.JustifyContent = CSSJustify.Center;
|
||||
root.JustifyContent = YogaJustify.Center;
|
||||
root.Width = 102f;
|
||||
root.Height = 102f;
|
||||
|
||||
@@ -500,7 +500,7 @@ namespace Facebook.CSSLayout
|
||||
CSSNode root_child2 = new CSSNode();
|
||||
root_child2.Height = 10f;
|
||||
root.Insert(2, root_child2);
|
||||
root.StyleDirection = CSSDirection.LTR;
|
||||
root.StyleDirection = YogaDirection.LTR;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -523,7 +523,7 @@ namespace Facebook.CSSLayout
|
||||
Assert.AreEqual(102f, root_child2.LayoutWidth);
|
||||
Assert.AreEqual(10f, root_child2.LayoutHeight);
|
||||
|
||||
root.StyleDirection = CSSDirection.RTL;
|
||||
root.StyleDirection = YogaDirection.RTL;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -551,7 +551,7 @@ namespace Facebook.CSSLayout
|
||||
public void Test_justify_content_column_space_between()
|
||||
{
|
||||
CSSNode root = new CSSNode();
|
||||
root.JustifyContent = CSSJustify.SpaceBetween;
|
||||
root.JustifyContent = YogaJustify.SpaceBetween;
|
||||
root.Width = 102f;
|
||||
root.Height = 102f;
|
||||
|
||||
@@ -566,7 +566,7 @@ namespace Facebook.CSSLayout
|
||||
CSSNode root_child2 = new CSSNode();
|
||||
root_child2.Height = 10f;
|
||||
root.Insert(2, root_child2);
|
||||
root.StyleDirection = CSSDirection.LTR;
|
||||
root.StyleDirection = YogaDirection.LTR;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -589,7 +589,7 @@ namespace Facebook.CSSLayout
|
||||
Assert.AreEqual(102f, root_child2.LayoutWidth);
|
||||
Assert.AreEqual(10f, root_child2.LayoutHeight);
|
||||
|
||||
root.StyleDirection = CSSDirection.RTL;
|
||||
root.StyleDirection = YogaDirection.RTL;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -617,7 +617,7 @@ namespace Facebook.CSSLayout
|
||||
public void Test_justify_content_column_space_around()
|
||||
{
|
||||
CSSNode root = new CSSNode();
|
||||
root.JustifyContent = CSSJustify.SpaceAround;
|
||||
root.JustifyContent = YogaJustify.SpaceAround;
|
||||
root.Width = 102f;
|
||||
root.Height = 102f;
|
||||
|
||||
@@ -632,7 +632,7 @@ namespace Facebook.CSSLayout
|
||||
CSSNode root_child2 = new CSSNode();
|
||||
root_child2.Height = 10f;
|
||||
root.Insert(2, root_child2);
|
||||
root.StyleDirection = CSSDirection.LTR;
|
||||
root.StyleDirection = YogaDirection.LTR;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -655,7 +655,7 @@ namespace Facebook.CSSLayout
|
||||
Assert.AreEqual(102f, root_child2.LayoutWidth);
|
||||
Assert.AreEqual(10f, root_child2.LayoutHeight);
|
||||
|
||||
root.StyleDirection = CSSDirection.RTL;
|
||||
root.StyleDirection = YogaDirection.RTL;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
|
@@ -21,15 +21,15 @@ namespace Facebook.CSSLayout
|
||||
public void Test_margin_start()
|
||||
{
|
||||
CSSNode root = new CSSNode();
|
||||
root.FlexDirection = CSSFlexDirection.Row;
|
||||
root.FlexDirection = YogaFlexDirection.Row;
|
||||
root.Width = 100f;
|
||||
root.Height = 100f;
|
||||
|
||||
CSSNode root_child0 = new CSSNode();
|
||||
root_child0.SetMargin(CSSEdge.Start, 10f);
|
||||
root_child0.SetMargin(YogaEdge.Start, 10f);
|
||||
root_child0.Width = 10f;
|
||||
root.Insert(0, root_child0);
|
||||
root.StyleDirection = CSSDirection.LTR;
|
||||
root.StyleDirection = YogaDirection.LTR;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -42,7 +42,7 @@ namespace Facebook.CSSLayout
|
||||
Assert.AreEqual(10f, root_child0.LayoutWidth);
|
||||
Assert.AreEqual(100f, root_child0.LayoutHeight);
|
||||
|
||||
root.StyleDirection = CSSDirection.RTL;
|
||||
root.StyleDirection = YogaDirection.RTL;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -64,10 +64,10 @@ namespace Facebook.CSSLayout
|
||||
root.Height = 100f;
|
||||
|
||||
CSSNode root_child0 = new CSSNode();
|
||||
root_child0.SetMargin(CSSEdge.Top, 10f);
|
||||
root_child0.SetMargin(YogaEdge.Top, 10f);
|
||||
root_child0.Height = 10f;
|
||||
root.Insert(0, root_child0);
|
||||
root.StyleDirection = CSSDirection.LTR;
|
||||
root.StyleDirection = YogaDirection.LTR;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -80,7 +80,7 @@ namespace Facebook.CSSLayout
|
||||
Assert.AreEqual(100f, root_child0.LayoutWidth);
|
||||
Assert.AreEqual(10f, root_child0.LayoutHeight);
|
||||
|
||||
root.StyleDirection = CSSDirection.RTL;
|
||||
root.StyleDirection = YogaDirection.RTL;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -98,16 +98,16 @@ namespace Facebook.CSSLayout
|
||||
public void Test_margin_end()
|
||||
{
|
||||
CSSNode root = new CSSNode();
|
||||
root.FlexDirection = CSSFlexDirection.Row;
|
||||
root.JustifyContent = CSSJustify.FlexEnd;
|
||||
root.FlexDirection = YogaFlexDirection.Row;
|
||||
root.JustifyContent = YogaJustify.FlexEnd;
|
||||
root.Width = 100f;
|
||||
root.Height = 100f;
|
||||
|
||||
CSSNode root_child0 = new CSSNode();
|
||||
root_child0.SetMargin(CSSEdge.End, 10f);
|
||||
root_child0.SetMargin(YogaEdge.End, 10f);
|
||||
root_child0.Width = 10f;
|
||||
root.Insert(0, root_child0);
|
||||
root.StyleDirection = CSSDirection.LTR;
|
||||
root.StyleDirection = YogaDirection.LTR;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -120,7 +120,7 @@ namespace Facebook.CSSLayout
|
||||
Assert.AreEqual(10f, root_child0.LayoutWidth);
|
||||
Assert.AreEqual(100f, root_child0.LayoutHeight);
|
||||
|
||||
root.StyleDirection = CSSDirection.RTL;
|
||||
root.StyleDirection = YogaDirection.RTL;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -138,15 +138,15 @@ namespace Facebook.CSSLayout
|
||||
public void Test_margin_bottom()
|
||||
{
|
||||
CSSNode root = new CSSNode();
|
||||
root.JustifyContent = CSSJustify.FlexEnd;
|
||||
root.JustifyContent = YogaJustify.FlexEnd;
|
||||
root.Width = 100f;
|
||||
root.Height = 100f;
|
||||
|
||||
CSSNode root_child0 = new CSSNode();
|
||||
root_child0.SetMargin(CSSEdge.Bottom, 10f);
|
||||
root_child0.SetMargin(YogaEdge.Bottom, 10f);
|
||||
root_child0.Height = 10f;
|
||||
root.Insert(0, root_child0);
|
||||
root.StyleDirection = CSSDirection.LTR;
|
||||
root.StyleDirection = YogaDirection.LTR;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -159,7 +159,7 @@ namespace Facebook.CSSLayout
|
||||
Assert.AreEqual(100f, root_child0.LayoutWidth);
|
||||
Assert.AreEqual(10f, root_child0.LayoutHeight);
|
||||
|
||||
root.StyleDirection = CSSDirection.RTL;
|
||||
root.StyleDirection = YogaDirection.RTL;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -177,15 +177,15 @@ namespace Facebook.CSSLayout
|
||||
public void Test_margin_and_flex_row()
|
||||
{
|
||||
CSSNode root = new CSSNode();
|
||||
root.FlexDirection = CSSFlexDirection.Row;
|
||||
root.FlexDirection = YogaFlexDirection.Row;
|
||||
root.Width = 100f;
|
||||
root.Height = 100f;
|
||||
|
||||
CSSNode root_child0 = new CSSNode();
|
||||
root_child0.FlexGrow = 1f;
|
||||
root_child0.SetMargin(CSSEdge.Start, 10f);
|
||||
root_child0.SetMargin(YogaEdge.Start, 10f);
|
||||
root.Insert(0, root_child0);
|
||||
root.StyleDirection = CSSDirection.LTR;
|
||||
root.StyleDirection = YogaDirection.LTR;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -198,7 +198,7 @@ namespace Facebook.CSSLayout
|
||||
Assert.AreEqual(90f, root_child0.LayoutWidth);
|
||||
Assert.AreEqual(100f, root_child0.LayoutHeight);
|
||||
|
||||
root.StyleDirection = CSSDirection.RTL;
|
||||
root.StyleDirection = YogaDirection.RTL;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -221,9 +221,9 @@ namespace Facebook.CSSLayout
|
||||
|
||||
CSSNode root_child0 = new CSSNode();
|
||||
root_child0.FlexGrow = 1f;
|
||||
root_child0.SetMargin(CSSEdge.Top, 10f);
|
||||
root_child0.SetMargin(YogaEdge.Top, 10f);
|
||||
root.Insert(0, root_child0);
|
||||
root.StyleDirection = CSSDirection.LTR;
|
||||
root.StyleDirection = YogaDirection.LTR;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -236,7 +236,7 @@ namespace Facebook.CSSLayout
|
||||
Assert.AreEqual(100f, root_child0.LayoutWidth);
|
||||
Assert.AreEqual(90f, root_child0.LayoutHeight);
|
||||
|
||||
root.StyleDirection = CSSDirection.RTL;
|
||||
root.StyleDirection = YogaDirection.RTL;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -254,15 +254,15 @@ namespace Facebook.CSSLayout
|
||||
public void Test_margin_and_stretch_row()
|
||||
{
|
||||
CSSNode root = new CSSNode();
|
||||
root.FlexDirection = CSSFlexDirection.Row;
|
||||
root.FlexDirection = YogaFlexDirection.Row;
|
||||
root.Width = 100f;
|
||||
root.Height = 100f;
|
||||
|
||||
CSSNode root_child0 = new CSSNode();
|
||||
root_child0.FlexGrow = 1f;
|
||||
root_child0.SetMargin(CSSEdge.Top, 10f);
|
||||
root_child0.SetMargin(YogaEdge.Top, 10f);
|
||||
root.Insert(0, root_child0);
|
||||
root.StyleDirection = CSSDirection.LTR;
|
||||
root.StyleDirection = YogaDirection.LTR;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -275,7 +275,7 @@ namespace Facebook.CSSLayout
|
||||
Assert.AreEqual(100f, root_child0.LayoutWidth);
|
||||
Assert.AreEqual(90f, root_child0.LayoutHeight);
|
||||
|
||||
root.StyleDirection = CSSDirection.RTL;
|
||||
root.StyleDirection = YogaDirection.RTL;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -298,9 +298,9 @@ namespace Facebook.CSSLayout
|
||||
|
||||
CSSNode root_child0 = new CSSNode();
|
||||
root_child0.FlexGrow = 1f;
|
||||
root_child0.SetMargin(CSSEdge.Start, 10f);
|
||||
root_child0.SetMargin(YogaEdge.Start, 10f);
|
||||
root.Insert(0, root_child0);
|
||||
root.StyleDirection = CSSDirection.LTR;
|
||||
root.StyleDirection = YogaDirection.LTR;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -313,7 +313,7 @@ namespace Facebook.CSSLayout
|
||||
Assert.AreEqual(90f, root_child0.LayoutWidth);
|
||||
Assert.AreEqual(100f, root_child0.LayoutHeight);
|
||||
|
||||
root.StyleDirection = CSSDirection.RTL;
|
||||
root.StyleDirection = YogaDirection.RTL;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -331,7 +331,7 @@ namespace Facebook.CSSLayout
|
||||
public void Test_margin_with_sibling_row()
|
||||
{
|
||||
CSSNode root = new CSSNode();
|
||||
root.FlexDirection = CSSFlexDirection.Row;
|
||||
root.FlexDirection = YogaFlexDirection.Row;
|
||||
root.Width = 100f;
|
||||
root.Height = 100f;
|
||||
|
||||
@@ -342,7 +342,7 @@ namespace Facebook.CSSLayout
|
||||
CSSNode root_child1 = new CSSNode();
|
||||
root_child1.FlexGrow = 1f;
|
||||
root.Insert(1, root_child1);
|
||||
root.StyleDirection = CSSDirection.LTR;
|
||||
root.StyleDirection = YogaDirection.LTR;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -360,7 +360,7 @@ namespace Facebook.CSSLayout
|
||||
Assert.AreEqual(50f, root_child1.LayoutWidth);
|
||||
Assert.AreEqual(100f, root_child1.LayoutHeight);
|
||||
|
||||
root.StyleDirection = CSSDirection.RTL;
|
||||
root.StyleDirection = YogaDirection.RTL;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -393,7 +393,7 @@ namespace Facebook.CSSLayout
|
||||
CSSNode root_child1 = new CSSNode();
|
||||
root_child1.FlexGrow = 1f;
|
||||
root.Insert(1, root_child1);
|
||||
root.StyleDirection = CSSDirection.LTR;
|
||||
root.StyleDirection = YogaDirection.LTR;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -411,7 +411,7 @@ namespace Facebook.CSSLayout
|
||||
Assert.AreEqual(100f, root_child1.LayoutWidth);
|
||||
Assert.AreEqual(50f, root_child1.LayoutHeight);
|
||||
|
||||
root.StyleDirection = CSSDirection.RTL;
|
||||
root.StyleDirection = YogaDirection.RTL;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
|
@@ -28,7 +28,7 @@ namespace Facebook.CSSLayout
|
||||
root_child0.MaxWidth = 50f;
|
||||
root_child0.Height = 10f;
|
||||
root.Insert(0, root_child0);
|
||||
root.StyleDirection = CSSDirection.LTR;
|
||||
root.StyleDirection = YogaDirection.LTR;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -41,7 +41,7 @@ namespace Facebook.CSSLayout
|
||||
Assert.AreEqual(50f, root_child0.LayoutWidth);
|
||||
Assert.AreEqual(10f, root_child0.LayoutHeight);
|
||||
|
||||
root.StyleDirection = CSSDirection.RTL;
|
||||
root.StyleDirection = YogaDirection.RTL;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -59,7 +59,7 @@ namespace Facebook.CSSLayout
|
||||
public void Test_max_height()
|
||||
{
|
||||
CSSNode root = new CSSNode();
|
||||
root.FlexDirection = CSSFlexDirection.Row;
|
||||
root.FlexDirection = YogaFlexDirection.Row;
|
||||
root.Width = 100f;
|
||||
root.Height = 100f;
|
||||
|
||||
@@ -67,7 +67,7 @@ namespace Facebook.CSSLayout
|
||||
root_child0.Width = 10f;
|
||||
root_child0.MaxHeight = 50f;
|
||||
root.Insert(0, root_child0);
|
||||
root.StyleDirection = CSSDirection.LTR;
|
||||
root.StyleDirection = YogaDirection.LTR;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -80,7 +80,7 @@ namespace Facebook.CSSLayout
|
||||
Assert.AreEqual(10f, root_child0.LayoutWidth);
|
||||
Assert.AreEqual(50f, root_child0.LayoutHeight);
|
||||
|
||||
root.StyleDirection = CSSDirection.RTL;
|
||||
root.StyleDirection = YogaDirection.RTL;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -109,7 +109,7 @@ namespace Facebook.CSSLayout
|
||||
CSSNode root_child1 = new CSSNode();
|
||||
root_child1.FlexGrow = 1f;
|
||||
root.Insert(1, root_child1);
|
||||
root.StyleDirection = CSSDirection.LTR;
|
||||
root.StyleDirection = YogaDirection.LTR;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -127,7 +127,7 @@ namespace Facebook.CSSLayout
|
||||
Assert.AreEqual(100f, root_child1.LayoutWidth);
|
||||
Assert.AreEqual(20f, root_child1.LayoutHeight);
|
||||
|
||||
root.StyleDirection = CSSDirection.RTL;
|
||||
root.StyleDirection = YogaDirection.RTL;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -150,7 +150,7 @@ namespace Facebook.CSSLayout
|
||||
public void Test_min_width()
|
||||
{
|
||||
CSSNode root = new CSSNode();
|
||||
root.FlexDirection = CSSFlexDirection.Row;
|
||||
root.FlexDirection = YogaFlexDirection.Row;
|
||||
root.Width = 100f;
|
||||
root.Height = 100f;
|
||||
|
||||
@@ -162,7 +162,7 @@ namespace Facebook.CSSLayout
|
||||
CSSNode root_child1 = new CSSNode();
|
||||
root_child1.FlexGrow = 1f;
|
||||
root.Insert(1, root_child1);
|
||||
root.StyleDirection = CSSDirection.LTR;
|
||||
root.StyleDirection = YogaDirection.LTR;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -180,7 +180,7 @@ namespace Facebook.CSSLayout
|
||||
Assert.AreEqual(20f, root_child1.LayoutWidth);
|
||||
Assert.AreEqual(100f, root_child1.LayoutHeight);
|
||||
|
||||
root.StyleDirection = CSSDirection.RTL;
|
||||
root.StyleDirection = YogaDirection.RTL;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -203,7 +203,7 @@ namespace Facebook.CSSLayout
|
||||
public void Test_justify_content_min_max()
|
||||
{
|
||||
CSSNode root = new CSSNode();
|
||||
root.JustifyContent = CSSJustify.Center;
|
||||
root.JustifyContent = YogaJustify.Center;
|
||||
root.Width = 100f;
|
||||
root.MinHeight = 100f;
|
||||
root.MaxHeight = 200f;
|
||||
@@ -212,7 +212,7 @@ namespace Facebook.CSSLayout
|
||||
root_child0.Width = 60f;
|
||||
root_child0.Height = 60f;
|
||||
root.Insert(0, root_child0);
|
||||
root.StyleDirection = CSSDirection.LTR;
|
||||
root.StyleDirection = YogaDirection.LTR;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -225,7 +225,7 @@ namespace Facebook.CSSLayout
|
||||
Assert.AreEqual(60f, root_child0.LayoutWidth);
|
||||
Assert.AreEqual(60f, root_child0.LayoutHeight);
|
||||
|
||||
root.StyleDirection = CSSDirection.RTL;
|
||||
root.StyleDirection = YogaDirection.RTL;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -243,7 +243,7 @@ namespace Facebook.CSSLayout
|
||||
public void Test_align_items_min_max()
|
||||
{
|
||||
CSSNode root = new CSSNode();
|
||||
root.AlignItems = CSSAlign.Center;
|
||||
root.AlignItems = YogaAlign.Center;
|
||||
root.MinWidth = 100f;
|
||||
root.MaxWidth = 200f;
|
||||
root.Height = 100f;
|
||||
@@ -252,7 +252,7 @@ namespace Facebook.CSSLayout
|
||||
root_child0.Width = 60f;
|
||||
root_child0.Height = 60f;
|
||||
root.Insert(0, root_child0);
|
||||
root.StyleDirection = CSSDirection.LTR;
|
||||
root.StyleDirection = YogaDirection.LTR;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -265,7 +265,7 @@ namespace Facebook.CSSLayout
|
||||
Assert.AreEqual(60f, root_child0.LayoutWidth);
|
||||
Assert.AreEqual(60f, root_child0.LayoutHeight);
|
||||
|
||||
root.StyleDirection = CSSDirection.RTL;
|
||||
root.StyleDirection = YogaDirection.RTL;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -283,7 +283,7 @@ namespace Facebook.CSSLayout
|
||||
public void Test_justify_content_overflow_min_max()
|
||||
{
|
||||
CSSNode root = new CSSNode();
|
||||
root.JustifyContent = CSSJustify.Center;
|
||||
root.JustifyContent = YogaJustify.Center;
|
||||
root.MinHeight = 100f;
|
||||
root.MaxHeight = 110f;
|
||||
|
||||
@@ -301,7 +301,7 @@ namespace Facebook.CSSLayout
|
||||
root_child2.Width = 50f;
|
||||
root_child2.Height = 50f;
|
||||
root.Insert(2, root_child2);
|
||||
root.StyleDirection = CSSDirection.LTR;
|
||||
root.StyleDirection = YogaDirection.LTR;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -324,7 +324,7 @@ namespace Facebook.CSSLayout
|
||||
Assert.AreEqual(50f, root_child2.LayoutWidth);
|
||||
Assert.AreEqual(50f, root_child2.LayoutHeight);
|
||||
|
||||
root.StyleDirection = CSSDirection.RTL;
|
||||
root.StyleDirection = YogaDirection.RTL;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -356,7 +356,7 @@ namespace Facebook.CSSLayout
|
||||
root.Height = 100f;
|
||||
|
||||
CSSNode root_child0 = new CSSNode();
|
||||
root_child0.FlexDirection = CSSFlexDirection.Row;
|
||||
root_child0.FlexDirection = YogaFlexDirection.Row;
|
||||
root_child0.MaxWidth = 100f;
|
||||
root.Insert(0, root_child0);
|
||||
|
||||
@@ -364,7 +364,7 @@ namespace Facebook.CSSLayout
|
||||
root_child0_child0.FlexGrow = 1f;
|
||||
root_child0_child0.Height = 20f;
|
||||
root_child0.Insert(0, root_child0_child0);
|
||||
root.StyleDirection = CSSDirection.LTR;
|
||||
root.StyleDirection = YogaDirection.LTR;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -382,7 +382,7 @@ namespace Facebook.CSSLayout
|
||||
Assert.AreEqual(100f, root_child0_child0.LayoutWidth);
|
||||
Assert.AreEqual(20f, root_child0_child0.LayoutHeight);
|
||||
|
||||
root.StyleDirection = CSSDirection.RTL;
|
||||
root.StyleDirection = YogaDirection.RTL;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -409,7 +409,7 @@ namespace Facebook.CSSLayout
|
||||
root.Height = 100f;
|
||||
|
||||
CSSNode root_child0 = new CSSNode();
|
||||
root_child0.FlexDirection = CSSFlexDirection.Row;
|
||||
root_child0.FlexDirection = YogaFlexDirection.Row;
|
||||
root_child0.MaxWidth = 300f;
|
||||
root.Insert(0, root_child0);
|
||||
|
||||
@@ -417,7 +417,7 @@ namespace Facebook.CSSLayout
|
||||
root_child0_child0.FlexGrow = 1f;
|
||||
root_child0_child0.Height = 20f;
|
||||
root_child0.Insert(0, root_child0_child0);
|
||||
root.StyleDirection = CSSDirection.LTR;
|
||||
root.StyleDirection = YogaDirection.LTR;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -435,7 +435,7 @@ namespace Facebook.CSSLayout
|
||||
Assert.AreEqual(200f, root_child0_child0.LayoutWidth);
|
||||
Assert.AreEqual(20f, root_child0_child0.LayoutHeight);
|
||||
|
||||
root.StyleDirection = CSSDirection.RTL;
|
||||
root.StyleDirection = YogaDirection.RTL;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
|
@@ -21,11 +21,11 @@ namespace Facebook.CSSLayout
|
||||
public void Test_padding_no_size()
|
||||
{
|
||||
CSSNode root = new CSSNode();
|
||||
root.SetPadding(CSSEdge.Left, 10f);
|
||||
root.SetPadding(CSSEdge.Top, 10f);
|
||||
root.SetPadding(CSSEdge.Right, 10f);
|
||||
root.SetPadding(CSSEdge.Bottom, 10f);
|
||||
root.StyleDirection = CSSDirection.LTR;
|
||||
root.SetPadding(YogaEdge.Left, 10f);
|
||||
root.SetPadding(YogaEdge.Top, 10f);
|
||||
root.SetPadding(YogaEdge.Right, 10f);
|
||||
root.SetPadding(YogaEdge.Bottom, 10f);
|
||||
root.StyleDirection = YogaDirection.LTR;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -33,7 +33,7 @@ namespace Facebook.CSSLayout
|
||||
Assert.AreEqual(20f, root.LayoutWidth);
|
||||
Assert.AreEqual(20f, root.LayoutHeight);
|
||||
|
||||
root.StyleDirection = CSSDirection.RTL;
|
||||
root.StyleDirection = YogaDirection.RTL;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -46,16 +46,16 @@ namespace Facebook.CSSLayout
|
||||
public void Test_padding_container_match_child()
|
||||
{
|
||||
CSSNode root = new CSSNode();
|
||||
root.SetPadding(CSSEdge.Left, 10f);
|
||||
root.SetPadding(CSSEdge.Top, 10f);
|
||||
root.SetPadding(CSSEdge.Right, 10f);
|
||||
root.SetPadding(CSSEdge.Bottom, 10f);
|
||||
root.SetPadding(YogaEdge.Left, 10f);
|
||||
root.SetPadding(YogaEdge.Top, 10f);
|
||||
root.SetPadding(YogaEdge.Right, 10f);
|
||||
root.SetPadding(YogaEdge.Bottom, 10f);
|
||||
|
||||
CSSNode root_child0 = new CSSNode();
|
||||
root_child0.Width = 10f;
|
||||
root_child0.Height = 10f;
|
||||
root.Insert(0, root_child0);
|
||||
root.StyleDirection = CSSDirection.LTR;
|
||||
root.StyleDirection = YogaDirection.LTR;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -68,7 +68,7 @@ namespace Facebook.CSSLayout
|
||||
Assert.AreEqual(10f, root_child0.LayoutWidth);
|
||||
Assert.AreEqual(10f, root_child0.LayoutHeight);
|
||||
|
||||
root.StyleDirection = CSSDirection.RTL;
|
||||
root.StyleDirection = YogaDirection.RTL;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -86,10 +86,10 @@ namespace Facebook.CSSLayout
|
||||
public void Test_padding_flex_child()
|
||||
{
|
||||
CSSNode root = new CSSNode();
|
||||
root.SetPadding(CSSEdge.Left, 10f);
|
||||
root.SetPadding(CSSEdge.Top, 10f);
|
||||
root.SetPadding(CSSEdge.Right, 10f);
|
||||
root.SetPadding(CSSEdge.Bottom, 10f);
|
||||
root.SetPadding(YogaEdge.Left, 10f);
|
||||
root.SetPadding(YogaEdge.Top, 10f);
|
||||
root.SetPadding(YogaEdge.Right, 10f);
|
||||
root.SetPadding(YogaEdge.Bottom, 10f);
|
||||
root.Width = 100f;
|
||||
root.Height = 100f;
|
||||
|
||||
@@ -97,7 +97,7 @@ namespace Facebook.CSSLayout
|
||||
root_child0.FlexGrow = 1f;
|
||||
root_child0.Width = 10f;
|
||||
root.Insert(0, root_child0);
|
||||
root.StyleDirection = CSSDirection.LTR;
|
||||
root.StyleDirection = YogaDirection.LTR;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -110,7 +110,7 @@ namespace Facebook.CSSLayout
|
||||
Assert.AreEqual(10f, root_child0.LayoutWidth);
|
||||
Assert.AreEqual(80f, root_child0.LayoutHeight);
|
||||
|
||||
root.StyleDirection = CSSDirection.RTL;
|
||||
root.StyleDirection = YogaDirection.RTL;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -128,17 +128,17 @@ namespace Facebook.CSSLayout
|
||||
public void Test_padding_stretch_child()
|
||||
{
|
||||
CSSNode root = new CSSNode();
|
||||
root.SetPadding(CSSEdge.Left, 10f);
|
||||
root.SetPadding(CSSEdge.Top, 10f);
|
||||
root.SetPadding(CSSEdge.Right, 10f);
|
||||
root.SetPadding(CSSEdge.Bottom, 10f);
|
||||
root.SetPadding(YogaEdge.Left, 10f);
|
||||
root.SetPadding(YogaEdge.Top, 10f);
|
||||
root.SetPadding(YogaEdge.Right, 10f);
|
||||
root.SetPadding(YogaEdge.Bottom, 10f);
|
||||
root.Width = 100f;
|
||||
root.Height = 100f;
|
||||
|
||||
CSSNode root_child0 = new CSSNode();
|
||||
root_child0.Height = 10f;
|
||||
root.Insert(0, root_child0);
|
||||
root.StyleDirection = CSSDirection.LTR;
|
||||
root.StyleDirection = YogaDirection.LTR;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -151,7 +151,7 @@ namespace Facebook.CSSLayout
|
||||
Assert.AreEqual(80f, root_child0.LayoutWidth);
|
||||
Assert.AreEqual(10f, root_child0.LayoutHeight);
|
||||
|
||||
root.StyleDirection = CSSDirection.RTL;
|
||||
root.StyleDirection = YogaDirection.RTL;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -169,11 +169,11 @@ namespace Facebook.CSSLayout
|
||||
public void Test_padding_center_child()
|
||||
{
|
||||
CSSNode root = new CSSNode();
|
||||
root.JustifyContent = CSSJustify.Center;
|
||||
root.AlignItems = CSSAlign.Center;
|
||||
root.SetPadding(CSSEdge.Start, 10f);
|
||||
root.SetPadding(CSSEdge.End, 20f);
|
||||
root.SetPadding(CSSEdge.Bottom, 20f);
|
||||
root.JustifyContent = YogaJustify.Center;
|
||||
root.AlignItems = YogaAlign.Center;
|
||||
root.SetPadding(YogaEdge.Start, 10f);
|
||||
root.SetPadding(YogaEdge.End, 20f);
|
||||
root.SetPadding(YogaEdge.Bottom, 20f);
|
||||
root.Width = 100f;
|
||||
root.Height = 100f;
|
||||
|
||||
@@ -181,7 +181,7 @@ namespace Facebook.CSSLayout
|
||||
root_child0.Width = 10f;
|
||||
root_child0.Height = 10f;
|
||||
root.Insert(0, root_child0);
|
||||
root.StyleDirection = CSSDirection.LTR;
|
||||
root.StyleDirection = YogaDirection.LTR;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -194,7 +194,7 @@ namespace Facebook.CSSLayout
|
||||
Assert.AreEqual(10f, root_child0.LayoutWidth);
|
||||
Assert.AreEqual(10f, root_child0.LayoutHeight);
|
||||
|
||||
root.StyleDirection = CSSDirection.RTL;
|
||||
root.StyleDirection = YogaDirection.RTL;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -212,20 +212,20 @@ namespace Facebook.CSSLayout
|
||||
public void Test_child_with_padding_align_end()
|
||||
{
|
||||
CSSNode root = new CSSNode();
|
||||
root.JustifyContent = CSSJustify.FlexEnd;
|
||||
root.AlignItems = CSSAlign.FlexEnd;
|
||||
root.JustifyContent = YogaJustify.FlexEnd;
|
||||
root.AlignItems = YogaAlign.FlexEnd;
|
||||
root.Width = 200f;
|
||||
root.Height = 200f;
|
||||
|
||||
CSSNode root_child0 = new CSSNode();
|
||||
root_child0.SetPadding(CSSEdge.Left, 20f);
|
||||
root_child0.SetPadding(CSSEdge.Top, 20f);
|
||||
root_child0.SetPadding(CSSEdge.Right, 20f);
|
||||
root_child0.SetPadding(CSSEdge.Bottom, 20f);
|
||||
root_child0.SetPadding(YogaEdge.Left, 20f);
|
||||
root_child0.SetPadding(YogaEdge.Top, 20f);
|
||||
root_child0.SetPadding(YogaEdge.Right, 20f);
|
||||
root_child0.SetPadding(YogaEdge.Bottom, 20f);
|
||||
root_child0.Width = 100f;
|
||||
root_child0.Height = 100f;
|
||||
root.Insert(0, root_child0);
|
||||
root.StyleDirection = CSSDirection.LTR;
|
||||
root.StyleDirection = YogaDirection.LTR;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -238,7 +238,7 @@ namespace Facebook.CSSLayout
|
||||
Assert.AreEqual(100f, root_child0.LayoutWidth);
|
||||
Assert.AreEqual(100f, root_child0.LayoutHeight);
|
||||
|
||||
root.StyleDirection = CSSDirection.RTL;
|
||||
root.StyleDirection = YogaDirection.RTL;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
|
@@ -20,10 +20,10 @@ namespace Facebook.CSSLayout
|
||||
[Test]
|
||||
public void Test_rounding_flex_basis_flex_grow_row_width_of_100()
|
||||
{
|
||||
CSSNode.SetExperimentalFeatureEnabled(CSSExperimentalFeature.Rounding, true);
|
||||
CSSNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, true);
|
||||
|
||||
CSSNode root = new CSSNode();
|
||||
root.FlexDirection = CSSFlexDirection.Row;
|
||||
root.FlexDirection = YogaFlexDirection.Row;
|
||||
root.Width = 100f;
|
||||
root.Height = 100f;
|
||||
|
||||
@@ -38,7 +38,7 @@ namespace Facebook.CSSLayout
|
||||
CSSNode root_child2 = new CSSNode();
|
||||
root_child2.FlexGrow = 1f;
|
||||
root.Insert(2, root_child2);
|
||||
root.StyleDirection = CSSDirection.LTR;
|
||||
root.StyleDirection = YogaDirection.LTR;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -61,7 +61,7 @@ namespace Facebook.CSSLayout
|
||||
Assert.AreEqual(33f, root_child2.LayoutWidth);
|
||||
Assert.AreEqual(100f, root_child2.LayoutHeight);
|
||||
|
||||
root.StyleDirection = CSSDirection.RTL;
|
||||
root.StyleDirection = YogaDirection.RTL;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -84,16 +84,16 @@ namespace Facebook.CSSLayout
|
||||
Assert.AreEqual(33f, root_child2.LayoutWidth);
|
||||
Assert.AreEqual(100f, root_child2.LayoutHeight);
|
||||
|
||||
CSSNode.SetExperimentalFeatureEnabled(CSSExperimentalFeature.Rounding, false);
|
||||
CSSNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, false);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Test_rounding_flex_basis_flex_grow_row_prime_number_width()
|
||||
{
|
||||
CSSNode.SetExperimentalFeatureEnabled(CSSExperimentalFeature.Rounding, true);
|
||||
CSSNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, true);
|
||||
|
||||
CSSNode root = new CSSNode();
|
||||
root.FlexDirection = CSSFlexDirection.Row;
|
||||
root.FlexDirection = YogaFlexDirection.Row;
|
||||
root.Width = 113f;
|
||||
root.Height = 100f;
|
||||
|
||||
@@ -116,7 +116,7 @@ namespace Facebook.CSSLayout
|
||||
CSSNode root_child4 = new CSSNode();
|
||||
root_child4.FlexGrow = 1f;
|
||||
root.Insert(4, root_child4);
|
||||
root.StyleDirection = CSSDirection.LTR;
|
||||
root.StyleDirection = YogaDirection.LTR;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -149,7 +149,7 @@ namespace Facebook.CSSLayout
|
||||
Assert.AreEqual(23f, root_child4.LayoutWidth);
|
||||
Assert.AreEqual(100f, root_child4.LayoutHeight);
|
||||
|
||||
root.StyleDirection = CSSDirection.RTL;
|
||||
root.StyleDirection = YogaDirection.RTL;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -182,16 +182,16 @@ namespace Facebook.CSSLayout
|
||||
Assert.AreEqual(23f, root_child4.LayoutWidth);
|
||||
Assert.AreEqual(100f, root_child4.LayoutHeight);
|
||||
|
||||
CSSNode.SetExperimentalFeatureEnabled(CSSExperimentalFeature.Rounding, false);
|
||||
CSSNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, false);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Test_rounding_flex_basis_flex_shrink_row()
|
||||
{
|
||||
CSSNode.SetExperimentalFeatureEnabled(CSSExperimentalFeature.Rounding, true);
|
||||
CSSNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, true);
|
||||
|
||||
CSSNode root = new CSSNode();
|
||||
root.FlexDirection = CSSFlexDirection.Row;
|
||||
root.FlexDirection = YogaFlexDirection.Row;
|
||||
root.Width = 101f;
|
||||
root.Height = 100f;
|
||||
|
||||
@@ -207,7 +207,7 @@ namespace Facebook.CSSLayout
|
||||
CSSNode root_child2 = new CSSNode();
|
||||
root_child2.FlexBasis = 25f;
|
||||
root.Insert(2, root_child2);
|
||||
root.StyleDirection = CSSDirection.LTR;
|
||||
root.StyleDirection = YogaDirection.LTR;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -230,7 +230,7 @@ namespace Facebook.CSSLayout
|
||||
Assert.AreEqual(25f, root_child2.LayoutWidth);
|
||||
Assert.AreEqual(100f, root_child2.LayoutHeight);
|
||||
|
||||
root.StyleDirection = CSSDirection.RTL;
|
||||
root.StyleDirection = YogaDirection.RTL;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -253,13 +253,13 @@ namespace Facebook.CSSLayout
|
||||
Assert.AreEqual(25f, root_child2.LayoutWidth);
|
||||
Assert.AreEqual(100f, root_child2.LayoutHeight);
|
||||
|
||||
CSSNode.SetExperimentalFeatureEnabled(CSSExperimentalFeature.Rounding, false);
|
||||
CSSNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, false);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Test_rounding_flex_basis_overrides_main_size()
|
||||
{
|
||||
CSSNode.SetExperimentalFeatureEnabled(CSSExperimentalFeature.Rounding, true);
|
||||
CSSNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, true);
|
||||
|
||||
CSSNode root = new CSSNode();
|
||||
root.Width = 100f;
|
||||
@@ -280,7 +280,7 @@ namespace Facebook.CSSLayout
|
||||
root_child2.FlexGrow = 1f;
|
||||
root_child2.Height = 10f;
|
||||
root.Insert(2, root_child2);
|
||||
root.StyleDirection = CSSDirection.LTR;
|
||||
root.StyleDirection = YogaDirection.LTR;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -303,7 +303,7 @@ namespace Facebook.CSSLayout
|
||||
Assert.AreEqual(100f, root_child2.LayoutWidth);
|
||||
Assert.AreEqual(24f, root_child2.LayoutHeight);
|
||||
|
||||
root.StyleDirection = CSSDirection.RTL;
|
||||
root.StyleDirection = YogaDirection.RTL;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -326,13 +326,13 @@ namespace Facebook.CSSLayout
|
||||
Assert.AreEqual(100f, root_child2.LayoutWidth);
|
||||
Assert.AreEqual(24f, root_child2.LayoutHeight);
|
||||
|
||||
CSSNode.SetExperimentalFeatureEnabled(CSSExperimentalFeature.Rounding, false);
|
||||
CSSNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, false);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Test_rounding_total_fractial()
|
||||
{
|
||||
CSSNode.SetExperimentalFeatureEnabled(CSSExperimentalFeature.Rounding, true);
|
||||
CSSNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, true);
|
||||
|
||||
CSSNode root = new CSSNode();
|
||||
root.Width = 87.4f;
|
||||
@@ -353,7 +353,7 @@ namespace Facebook.CSSLayout
|
||||
root_child2.FlexGrow = 1.1f;
|
||||
root_child2.Height = 10.7f;
|
||||
root.Insert(2, root_child2);
|
||||
root.StyleDirection = CSSDirection.LTR;
|
||||
root.StyleDirection = YogaDirection.LTR;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -376,7 +376,7 @@ namespace Facebook.CSSLayout
|
||||
Assert.AreEqual(87f, root_child2.LayoutWidth);
|
||||
Assert.AreEqual(24f, root_child2.LayoutHeight);
|
||||
|
||||
root.StyleDirection = CSSDirection.RTL;
|
||||
root.StyleDirection = YogaDirection.RTL;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -399,13 +399,13 @@ namespace Facebook.CSSLayout
|
||||
Assert.AreEqual(87f, root_child2.LayoutWidth);
|
||||
Assert.AreEqual(24f, root_child2.LayoutHeight);
|
||||
|
||||
CSSNode.SetExperimentalFeatureEnabled(CSSExperimentalFeature.Rounding, false);
|
||||
CSSNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, false);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Test_rounding_total_fractial_nested()
|
||||
{
|
||||
CSSNode.SetExperimentalFeatureEnabled(CSSExperimentalFeature.Rounding, true);
|
||||
CSSNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, true);
|
||||
|
||||
CSSNode root = new CSSNode();
|
||||
root.Width = 87.4f;
|
||||
@@ -420,14 +420,14 @@ namespace Facebook.CSSLayout
|
||||
CSSNode root_child0_child0 = new CSSNode();
|
||||
root_child0_child0.FlexGrow = 1f;
|
||||
root_child0_child0.FlexBasis = 0.3f;
|
||||
root_child0_child0.SetPosition(CSSEdge.Bottom, 13.3f);
|
||||
root_child0_child0.SetPosition(YogaEdge.Bottom, 13.3f);
|
||||
root_child0_child0.Height = 9.9f;
|
||||
root_child0.Insert(0, root_child0_child0);
|
||||
|
||||
CSSNode root_child0_child1 = new CSSNode();
|
||||
root_child0_child1.FlexGrow = 4f;
|
||||
root_child0_child1.FlexBasis = 0.3f;
|
||||
root_child0_child1.SetPosition(CSSEdge.Top, 13.3f);
|
||||
root_child0_child1.SetPosition(YogaEdge.Top, 13.3f);
|
||||
root_child0_child1.Height = 1.1f;
|
||||
root_child0.Insert(1, root_child0_child1);
|
||||
|
||||
@@ -440,7 +440,7 @@ namespace Facebook.CSSLayout
|
||||
root_child2.FlexGrow = 1.1f;
|
||||
root_child2.Height = 10.7f;
|
||||
root.Insert(2, root_child2);
|
||||
root.StyleDirection = CSSDirection.LTR;
|
||||
root.StyleDirection = YogaDirection.LTR;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -473,7 +473,7 @@ namespace Facebook.CSSLayout
|
||||
Assert.AreEqual(87f, root_child2.LayoutWidth);
|
||||
Assert.AreEqual(24f, root_child2.LayoutHeight);
|
||||
|
||||
root.StyleDirection = CSSDirection.RTL;
|
||||
root.StyleDirection = YogaDirection.RTL;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -506,13 +506,13 @@ namespace Facebook.CSSLayout
|
||||
Assert.AreEqual(87f, root_child2.LayoutWidth);
|
||||
Assert.AreEqual(24f, root_child2.LayoutHeight);
|
||||
|
||||
CSSNode.SetExperimentalFeatureEnabled(CSSExperimentalFeature.Rounding, false);
|
||||
CSSNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, false);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Test_rounding_fractial_input_1()
|
||||
{
|
||||
CSSNode.SetExperimentalFeatureEnabled(CSSExperimentalFeature.Rounding, true);
|
||||
CSSNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, true);
|
||||
|
||||
CSSNode root = new CSSNode();
|
||||
root.Width = 100f;
|
||||
@@ -533,7 +533,7 @@ namespace Facebook.CSSLayout
|
||||
root_child2.FlexGrow = 1f;
|
||||
root_child2.Height = 10f;
|
||||
root.Insert(2, root_child2);
|
||||
root.StyleDirection = CSSDirection.LTR;
|
||||
root.StyleDirection = YogaDirection.LTR;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -556,7 +556,7 @@ namespace Facebook.CSSLayout
|
||||
Assert.AreEqual(100f, root_child2.LayoutWidth);
|
||||
Assert.AreEqual(24f, root_child2.LayoutHeight);
|
||||
|
||||
root.StyleDirection = CSSDirection.RTL;
|
||||
root.StyleDirection = YogaDirection.RTL;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -579,13 +579,13 @@ namespace Facebook.CSSLayout
|
||||
Assert.AreEqual(100f, root_child2.LayoutWidth);
|
||||
Assert.AreEqual(24f, root_child2.LayoutHeight);
|
||||
|
||||
CSSNode.SetExperimentalFeatureEnabled(CSSExperimentalFeature.Rounding, false);
|
||||
CSSNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, false);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Test_rounding_fractial_input_2()
|
||||
{
|
||||
CSSNode.SetExperimentalFeatureEnabled(CSSExperimentalFeature.Rounding, true);
|
||||
CSSNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, true);
|
||||
|
||||
CSSNode root = new CSSNode();
|
||||
root.Width = 100f;
|
||||
@@ -606,7 +606,7 @@ namespace Facebook.CSSLayout
|
||||
root_child2.FlexGrow = 1f;
|
||||
root_child2.Height = 10f;
|
||||
root.Insert(2, root_child2);
|
||||
root.StyleDirection = CSSDirection.LTR;
|
||||
root.StyleDirection = YogaDirection.LTR;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -629,7 +629,7 @@ namespace Facebook.CSSLayout
|
||||
Assert.AreEqual(100f, root_child2.LayoutWidth);
|
||||
Assert.AreEqual(25f, root_child2.LayoutHeight);
|
||||
|
||||
root.StyleDirection = CSSDirection.RTL;
|
||||
root.StyleDirection = YogaDirection.RTL;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -652,16 +652,16 @@ namespace Facebook.CSSLayout
|
||||
Assert.AreEqual(100f, root_child2.LayoutWidth);
|
||||
Assert.AreEqual(25f, root_child2.LayoutHeight);
|
||||
|
||||
CSSNode.SetExperimentalFeatureEnabled(CSSExperimentalFeature.Rounding, false);
|
||||
CSSNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, false);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Test_rounding_fractial_input_3()
|
||||
{
|
||||
CSSNode.SetExperimentalFeatureEnabled(CSSExperimentalFeature.Rounding, true);
|
||||
CSSNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, true);
|
||||
|
||||
CSSNode root = new CSSNode();
|
||||
root.SetPosition(CSSEdge.Top, 0.3f);
|
||||
root.SetPosition(YogaEdge.Top, 0.3f);
|
||||
root.Width = 100f;
|
||||
root.Height = 113.4f;
|
||||
|
||||
@@ -680,7 +680,7 @@ namespace Facebook.CSSLayout
|
||||
root_child2.FlexGrow = 1f;
|
||||
root_child2.Height = 10f;
|
||||
root.Insert(2, root_child2);
|
||||
root.StyleDirection = CSSDirection.LTR;
|
||||
root.StyleDirection = YogaDirection.LTR;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -703,7 +703,7 @@ namespace Facebook.CSSLayout
|
||||
Assert.AreEqual(100f, root_child2.LayoutWidth);
|
||||
Assert.AreEqual(24f, root_child2.LayoutHeight);
|
||||
|
||||
root.StyleDirection = CSSDirection.RTL;
|
||||
root.StyleDirection = YogaDirection.RTL;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -726,16 +726,16 @@ namespace Facebook.CSSLayout
|
||||
Assert.AreEqual(100f, root_child2.LayoutWidth);
|
||||
Assert.AreEqual(24f, root_child2.LayoutHeight);
|
||||
|
||||
CSSNode.SetExperimentalFeatureEnabled(CSSExperimentalFeature.Rounding, false);
|
||||
CSSNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, false);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Test_rounding_fractial_input_4()
|
||||
{
|
||||
CSSNode.SetExperimentalFeatureEnabled(CSSExperimentalFeature.Rounding, true);
|
||||
CSSNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, true);
|
||||
|
||||
CSSNode root = new CSSNode();
|
||||
root.SetPosition(CSSEdge.Top, 0.7f);
|
||||
root.SetPosition(YogaEdge.Top, 0.7f);
|
||||
root.Width = 100f;
|
||||
root.Height = 113.4f;
|
||||
|
||||
@@ -754,7 +754,7 @@ namespace Facebook.CSSLayout
|
||||
root_child2.FlexGrow = 1f;
|
||||
root_child2.Height = 10f;
|
||||
root.Insert(2, root_child2);
|
||||
root.StyleDirection = CSSDirection.LTR;
|
||||
root.StyleDirection = YogaDirection.LTR;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -777,7 +777,7 @@ namespace Facebook.CSSLayout
|
||||
Assert.AreEqual(100f, root_child2.LayoutWidth);
|
||||
Assert.AreEqual(24f, root_child2.LayoutHeight);
|
||||
|
||||
root.StyleDirection = CSSDirection.RTL;
|
||||
root.StyleDirection = YogaDirection.RTL;
|
||||
root.CalculateLayout();
|
||||
|
||||
Assert.AreEqual(0f, root.LayoutX);
|
||||
@@ -800,7 +800,7 @@ namespace Facebook.CSSLayout
|
||||
Assert.AreEqual(100f, root_child2.LayoutWidth);
|
||||
Assert.AreEqual(24f, root_child2.LayoutHeight);
|
||||
|
||||
CSSNode.SetExperimentalFeatureEnabled(CSSExperimentalFeature.Rounding, false);
|
||||
CSSNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, false);
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -22,8 +22,8 @@ namespace Facebook.CSSLayout
|
||||
public void TestSimple()
|
||||
{
|
||||
CSSNode nodeDefault = new CSSNode();
|
||||
CSSNode nodeCreated = CSSNode.Create(flexDirection: CSSFlexDirection.Row);
|
||||
Assert.AreEqual(CSSFlexDirection.Row, nodeCreated.FlexDirection);
|
||||
CSSNode nodeCreated = CSSNode.Create(flexDirection: YogaFlexDirection.Row);
|
||||
Assert.AreEqual(YogaFlexDirection.Row, nodeCreated.FlexDirection);
|
||||
Assert.IsFalse(nodeDefault.IsDirty);
|
||||
nodeDefault.CopyStyle(nodeCreated);
|
||||
Assert.IsTrue(nodeDefault.IsDirty);
|
||||
@@ -43,39 +43,39 @@ namespace Facebook.CSSLayout
|
||||
public void TestMultiple()
|
||||
{
|
||||
CSSNode node = CSSNode.Create(
|
||||
positionType: CSSPositionType.Absolute,
|
||||
wrap: CSSWrap.Wrap,
|
||||
positionType: YogaPositionType.Absolute,
|
||||
wrap: YogaWrap.Wrap,
|
||||
position: new Spacing(top:6, right:4),
|
||||
margin: new Spacing(bottom:5, left:3));
|
||||
|
||||
Assert.AreEqual(CSSFlexDirection.Column, node.FlexDirection);
|
||||
Assert.AreEqual(CSSPositionType.Absolute, node.PositionType);
|
||||
Assert.AreEqual(CSSWrap.Wrap, node.Wrap);
|
||||
Assert.AreEqual(6, node.GetPosition(CSSEdge.Top));
|
||||
Assert.IsTrue(CSSConstants.IsUndefined(node.GetPosition(CSSEdge.Bottom)));
|
||||
Assert.AreEqual(4, node.GetPosition(CSSEdge.Right));
|
||||
Assert.IsTrue(CSSConstants.IsUndefined(node.GetPosition(CSSEdge.Left)));
|
||||
Assert.AreEqual(0, node.GetMargin(CSSEdge.Top));
|
||||
Assert.AreEqual(5, node.GetMargin(CSSEdge.Bottom));
|
||||
Assert.AreEqual(3, node.GetMargin(CSSEdge.Left));
|
||||
Assert.AreEqual(0, node.GetMargin(CSSEdge.Right));
|
||||
Assert.AreEqual(YogaFlexDirection.Column, node.FlexDirection);
|
||||
Assert.AreEqual(YogaPositionType.Absolute, node.PositionType);
|
||||
Assert.AreEqual(YogaWrap.Wrap, node.Wrap);
|
||||
Assert.AreEqual(6, node.GetPosition(YogaEdge.Top));
|
||||
Assert.IsTrue(YogaConstants.IsUndefined(node.GetPosition(YogaEdge.Bottom)));
|
||||
Assert.AreEqual(4, node.GetPosition(YogaEdge.Right));
|
||||
Assert.IsTrue(YogaConstants.IsUndefined(node.GetPosition(YogaEdge.Left)));
|
||||
Assert.AreEqual(0, node.GetMargin(YogaEdge.Top));
|
||||
Assert.AreEqual(5, node.GetMargin(YogaEdge.Bottom));
|
||||
Assert.AreEqual(3, node.GetMargin(YogaEdge.Left));
|
||||
Assert.AreEqual(0, node.GetMargin(YogaEdge.Right));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestFull()
|
||||
{
|
||||
CSSNode node = CSSNode.Create(
|
||||
styleDirection: CSSDirection.RTL,
|
||||
flexDirection: CSSFlexDirection.RowReverse,
|
||||
styleDirection: YogaDirection.RTL,
|
||||
flexDirection: YogaFlexDirection.RowReverse,
|
||||
|
||||
justifyContent: CSSJustify.SpaceAround,
|
||||
alignContent: CSSAlign.Center,
|
||||
alignItems: CSSAlign.FlexEnd,
|
||||
alignSelf: CSSAlign.Stretch,
|
||||
justifyContent: YogaJustify.SpaceAround,
|
||||
alignContent: YogaAlign.Center,
|
||||
alignItems: YogaAlign.FlexEnd,
|
||||
alignSelf: YogaAlign.Stretch,
|
||||
|
||||
positionType: CSSPositionType.Absolute,
|
||||
wrap: CSSWrap.Wrap,
|
||||
overflow: CSSOverflow.Scroll,
|
||||
positionType: YogaPositionType.Absolute,
|
||||
wrap: YogaWrap.Wrap,
|
||||
overflow: YogaOverflow.Scroll,
|
||||
|
||||
flex: 1,
|
||||
flexGrow: 2,
|
||||
@@ -94,43 +94,43 @@ namespace Facebook.CSSLayout
|
||||
maxWidth: 25,
|
||||
maxHeight: 26);
|
||||
|
||||
Assert.AreEqual(CSSDirection.RTL, node.StyleDirection);
|
||||
Assert.AreEqual(CSSFlexDirection.RowReverse, node.FlexDirection);
|
||||
Assert.AreEqual(YogaDirection.RTL, node.StyleDirection);
|
||||
Assert.AreEqual(YogaFlexDirection.RowReverse, node.FlexDirection);
|
||||
|
||||
Assert.AreEqual(CSSJustify.SpaceAround, node.JustifyContent);
|
||||
Assert.AreEqual(CSSAlign.Center, node.AlignContent);
|
||||
Assert.AreEqual(CSSAlign.FlexEnd, node.AlignItems);
|
||||
Assert.AreEqual(CSSAlign.Stretch, node.AlignSelf);
|
||||
Assert.AreEqual(YogaJustify.SpaceAround, node.JustifyContent);
|
||||
Assert.AreEqual(YogaAlign.Center, node.AlignContent);
|
||||
Assert.AreEqual(YogaAlign.FlexEnd, node.AlignItems);
|
||||
Assert.AreEqual(YogaAlign.Stretch, node.AlignSelf);
|
||||
|
||||
Assert.AreEqual(CSSPositionType.Absolute, node.PositionType);
|
||||
Assert.AreEqual(CSSWrap.Wrap, node.Wrap);
|
||||
Assert.AreEqual(CSSOverflow.Scroll, node.Overflow);
|
||||
Assert.AreEqual(YogaPositionType.Absolute, node.PositionType);
|
||||
Assert.AreEqual(YogaWrap.Wrap, node.Wrap);
|
||||
Assert.AreEqual(YogaOverflow.Scroll, node.Overflow);
|
||||
|
||||
Assert.AreEqual(2, node.FlexGrow);
|
||||
Assert.AreEqual(3, node.FlexShrink);
|
||||
Assert.AreEqual(4, node.FlexBasis);
|
||||
node.FlexGrow = CSSConstants.Undefined;
|
||||
node.FlexGrow = YogaConstants.Undefined;
|
||||
Assert.AreEqual(1, node.FlexGrow);
|
||||
|
||||
Assert.AreEqual(5, node.GetPosition(CSSEdge.Top));
|
||||
Assert.AreEqual(6, node.GetPosition(CSSEdge.Bottom));
|
||||
Assert.AreEqual(7, node.GetPosition(CSSEdge.Left));
|
||||
Assert.AreEqual(8, node.GetPosition(CSSEdge.Right));
|
||||
Assert.AreEqual(5, node.GetPosition(YogaEdge.Top));
|
||||
Assert.AreEqual(6, node.GetPosition(YogaEdge.Bottom));
|
||||
Assert.AreEqual(7, node.GetPosition(YogaEdge.Left));
|
||||
Assert.AreEqual(8, node.GetPosition(YogaEdge.Right));
|
||||
|
||||
Assert.AreEqual(9, node.GetMargin(CSSEdge.Top));
|
||||
Assert.AreEqual(10, node.GetMargin(CSSEdge.Bottom));
|
||||
Assert.AreEqual(11, node.GetMargin(CSSEdge.Left));
|
||||
Assert.AreEqual(12, node.GetMargin(CSSEdge.Right));
|
||||
Assert.AreEqual(9, node.GetMargin(YogaEdge.Top));
|
||||
Assert.AreEqual(10, node.GetMargin(YogaEdge.Bottom));
|
||||
Assert.AreEqual(11, node.GetMargin(YogaEdge.Left));
|
||||
Assert.AreEqual(12, node.GetMargin(YogaEdge.Right));
|
||||
|
||||
Assert.AreEqual(13, node.GetPadding(CSSEdge.Top));
|
||||
Assert.AreEqual(14, node.GetPadding(CSSEdge.Bottom));
|
||||
Assert.AreEqual(15, node.GetPadding(CSSEdge.Left));
|
||||
Assert.AreEqual(16, node.GetPadding(CSSEdge.Right));
|
||||
Assert.AreEqual(13, node.GetPadding(YogaEdge.Top));
|
||||
Assert.AreEqual(14, node.GetPadding(YogaEdge.Bottom));
|
||||
Assert.AreEqual(15, node.GetPadding(YogaEdge.Left));
|
||||
Assert.AreEqual(16, node.GetPadding(YogaEdge.Right));
|
||||
|
||||
Assert.AreEqual(17, node.GetBorder(CSSEdge.Top));
|
||||
Assert.AreEqual(18, node.GetBorder(CSSEdge.Bottom));
|
||||
Assert.AreEqual(19, node.GetBorder(CSSEdge.Left));
|
||||
Assert.AreEqual(20, node.GetBorder(CSSEdge.Right));
|
||||
Assert.AreEqual(17, node.GetBorder(YogaEdge.Top));
|
||||
Assert.AreEqual(18, node.GetBorder(YogaEdge.Bottom));
|
||||
Assert.AreEqual(19, node.GetBorder(YogaEdge.Left));
|
||||
Assert.AreEqual(20, node.GetBorder(YogaEdge.Right));
|
||||
|
||||
Assert.AreEqual(21, node.Width);
|
||||
Assert.AreEqual(22, node.Height);
|
||||
|
@@ -219,7 +219,7 @@ namespace Facebook.CSSLayout
|
||||
public void TestCopyStyle()
|
||||
{
|
||||
CSSNode node0 = new CSSNode();
|
||||
Assert.IsTrue(CSSConstants.IsUndefined(node0.MaxHeight));
|
||||
Assert.IsTrue(YogaConstants.IsUndefined(node0.MaxHeight));
|
||||
|
||||
CSSNode node1 = new CSSNode();
|
||||
node1.MaxHeight = 100;
|
||||
|
Reference in New Issue
Block a user