Move configuration to new YGConfig and pass them down to CalculateLayout

Summary:
Move configuration to new ```YGConfig``` and pass them down to CalculateLayout. See #418 .

Adds ```YGConfigNew()``` + ```YGConfigFree```, and changed ```YGSetExperimentalFeatureEnabled``` to use the config.

New function for calculation is ```YGNodeCalculateLayoutWithConfig```.
Closes https://github.com/facebook/yoga/pull/432

Reviewed By: astreet

Differential Revision: D4611359

Pulled By: emilsjolander

fbshipit-source-id: a1332f0e1b21cec02129dd021ee57408449e10b0
This commit is contained in:
Lukas Wöhrl
2017-03-01 09:19:55 -08:00
committed by Facebook Github Bot
parent 8668e43f6d
commit 37c48257ae
89 changed files with 4536 additions and 3049 deletions

View File

@@ -20,7 +20,9 @@ namespace Facebook.Yoga
[Test]
public void Test_border_no_size()
{
YogaNode root = new YogaNode();
YogaConfig config = new YogaConfig();
YogaNode root = new YogaNode(config);
root.BorderLeftWidth = 10;
root.BorderTopWidth = 10;
root.BorderRightWidth = 10;
@@ -45,13 +47,15 @@ namespace Facebook.Yoga
[Test]
public void Test_border_container_match_child()
{
YogaNode root = new YogaNode();
YogaConfig config = new YogaConfig();
YogaNode root = new YogaNode(config);
root.BorderLeftWidth = 10;
root.BorderTopWidth = 10;
root.BorderRightWidth = 10;
root.BorderBottomWidth = 10;
YogaNode root_child0 = new YogaNode();
YogaNode root_child0 = new YogaNode(config);
root_child0.Width = 10;
root_child0.Height = 10;
root.Insert(0, root_child0);
@@ -85,7 +89,9 @@ namespace Facebook.Yoga
[Test]
public void Test_border_flex_child()
{
YogaNode root = new YogaNode();
YogaConfig config = new YogaConfig();
YogaNode root = new YogaNode(config);
root.BorderLeftWidth = 10;
root.BorderTopWidth = 10;
root.BorderRightWidth = 10;
@@ -93,7 +99,7 @@ namespace Facebook.Yoga
root.Width = 100;
root.Height = 100;
YogaNode root_child0 = new YogaNode();
YogaNode root_child0 = new YogaNode(config);
root_child0.FlexGrow = 1;
root_child0.Width = 10;
root.Insert(0, root_child0);
@@ -127,7 +133,9 @@ namespace Facebook.Yoga
[Test]
public void Test_border_stretch_child()
{
YogaNode root = new YogaNode();
YogaConfig config = new YogaConfig();
YogaNode root = new YogaNode(config);
root.BorderLeftWidth = 10;
root.BorderTopWidth = 10;
root.BorderRightWidth = 10;
@@ -135,7 +143,7 @@ namespace Facebook.Yoga
root.Width = 100;
root.Height = 100;
YogaNode root_child0 = new YogaNode();
YogaNode root_child0 = new YogaNode(config);
root_child0.Height = 10;
root.Insert(0, root_child0);
root.StyleDirection = YogaDirection.LTR;
@@ -168,7 +176,9 @@ namespace Facebook.Yoga
[Test]
public void Test_border_center_child()
{
YogaNode root = new YogaNode();
YogaConfig config = new YogaConfig();
YogaNode root = new YogaNode(config);
root.JustifyContent = YogaJustify.Center;
root.AlignItems = YogaAlign.Center;
root.BorderStartWidth = 10;
@@ -177,7 +187,7 @@ namespace Facebook.Yoga
root.Width = 100;
root.Height = 100;
YogaNode root_child0 = new YogaNode();
YogaNode root_child0 = new YogaNode(config);
root_child0.Width = 10;
root_child0.Height = 10;
root.Insert(0, root_child0);