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:
committed by
Facebook Github Bot
parent
8668e43f6d
commit
37c48257ae
@@ -13,11 +13,11 @@ var Yoga = Yoga || require("../../sources/entry-" + process.env.TEST_ENTRY);
|
||||
|
||||
it("align_items_stretch", function () {
|
||||
try {
|
||||
var root = Yoga.Node.create();
|
||||
var root = Yoga.Node.create(config);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
|
||||
var root_child0 = Yoga.Node.create();
|
||||
var root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setHeight(10);
|
||||
root.insertChild(root_child0, 0);
|
||||
root.calculateLayout(Yoga.UNDEFINED, Yoga.UNDEFINED, Yoga.DIRECTION_LTR);
|
||||
@@ -51,12 +51,12 @@ it("align_items_stretch", function () {
|
||||
});
|
||||
it("align_items_center", function () {
|
||||
try {
|
||||
var root = Yoga.Node.create();
|
||||
var root = Yoga.Node.create(config);
|
||||
root.setAlignItems(Yoga.ALIGN_CENTER);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
|
||||
var root_child0 = Yoga.Node.create();
|
||||
var root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setWidth(10);
|
||||
root_child0.setHeight(10);
|
||||
root.insertChild(root_child0, 0);
|
||||
@@ -91,12 +91,12 @@ it("align_items_center", function () {
|
||||
});
|
||||
it("align_items_flex_start", function () {
|
||||
try {
|
||||
var root = Yoga.Node.create();
|
||||
var root = Yoga.Node.create(config);
|
||||
root.setAlignItems(Yoga.ALIGN_FLEX_START);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
|
||||
var root_child0 = Yoga.Node.create();
|
||||
var root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setWidth(10);
|
||||
root_child0.setHeight(10);
|
||||
root.insertChild(root_child0, 0);
|
||||
@@ -131,12 +131,12 @@ it("align_items_flex_start", function () {
|
||||
});
|
||||
it("align_items_flex_end", function () {
|
||||
try {
|
||||
var root = Yoga.Node.create();
|
||||
var root = Yoga.Node.create(config);
|
||||
root.setAlignItems(Yoga.ALIGN_FLEX_END);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
|
||||
var root_child0 = Yoga.Node.create();
|
||||
var root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setWidth(10);
|
||||
root_child0.setHeight(10);
|
||||
root.insertChild(root_child0, 0);
|
||||
@@ -171,18 +171,18 @@ it("align_items_flex_end", function () {
|
||||
});
|
||||
it("align_baseline", function () {
|
||||
try {
|
||||
var root = Yoga.Node.create();
|
||||
var root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
|
||||
root.setAlignItems(Yoga.ALIGN_BASELINE);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
|
||||
var root_child0 = Yoga.Node.create();
|
||||
var root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setWidth(50);
|
||||
root_child0.setHeight(50);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
var root_child1 = Yoga.Node.create();
|
||||
var root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setWidth(50);
|
||||
root_child1.setHeight(20);
|
||||
root.insertChild(root_child1, 1);
|
||||
@@ -227,23 +227,23 @@ it("align_baseline", function () {
|
||||
});
|
||||
it("align_baseline_child", function () {
|
||||
try {
|
||||
var root = Yoga.Node.create();
|
||||
var root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
|
||||
root.setAlignItems(Yoga.ALIGN_BASELINE);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
|
||||
var root_child0 = Yoga.Node.create();
|
||||
var root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setWidth(50);
|
||||
root_child0.setHeight(50);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
var root_child1 = Yoga.Node.create();
|
||||
var root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setWidth(50);
|
||||
root_child1.setHeight(20);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
var root_child1_child0 = Yoga.Node.create();
|
||||
var root_child1_child0 = Yoga.Node.create(config);
|
||||
root_child1_child0.setWidth(50);
|
||||
root_child1_child0.setHeight(10);
|
||||
root_child1.insertChild(root_child1_child0, 0);
|
||||
@@ -298,40 +298,40 @@ it("align_baseline_child", function () {
|
||||
});
|
||||
it("align_baseline_child_multiline", function () {
|
||||
try {
|
||||
var root = Yoga.Node.create();
|
||||
var root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
|
||||
root.setAlignItems(Yoga.ALIGN_BASELINE);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
|
||||
var root_child0 = Yoga.Node.create();
|
||||
var root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setWidth(50);
|
||||
root_child0.setHeight(60);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
var root_child1 = Yoga.Node.create();
|
||||
var root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
|
||||
root_child1.setFlexWrap(Yoga.WRAP_WRAP);
|
||||
root_child1.setWidth(50);
|
||||
root_child1.setHeight(25);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
var root_child1_child0 = Yoga.Node.create();
|
||||
var root_child1_child0 = Yoga.Node.create(config);
|
||||
root_child1_child0.setWidth(25);
|
||||
root_child1_child0.setHeight(20);
|
||||
root_child1.insertChild(root_child1_child0, 0);
|
||||
|
||||
var root_child1_child1 = Yoga.Node.create();
|
||||
var root_child1_child1 = Yoga.Node.create(config);
|
||||
root_child1_child1.setWidth(25);
|
||||
root_child1_child1.setHeight(10);
|
||||
root_child1.insertChild(root_child1_child1, 1);
|
||||
|
||||
var root_child1_child2 = Yoga.Node.create();
|
||||
var root_child1_child2 = Yoga.Node.create(config);
|
||||
root_child1_child2.setWidth(25);
|
||||
root_child1_child2.setHeight(20);
|
||||
root_child1.insertChild(root_child1_child2, 2);
|
||||
|
||||
var root_child1_child3 = Yoga.Node.create();
|
||||
var root_child1_child3 = Yoga.Node.create(config);
|
||||
root_child1_child3.setWidth(25);
|
||||
root_child1_child3.setHeight(10);
|
||||
root_child1.insertChild(root_child1_child3, 3);
|
||||
@@ -416,41 +416,41 @@ it("align_baseline_child_multiline", function () {
|
||||
});
|
||||
it("align_baseline_child_multiline_override", function () {
|
||||
try {
|
||||
var root = Yoga.Node.create();
|
||||
var root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
|
||||
root.setAlignItems(Yoga.ALIGN_BASELINE);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
|
||||
var root_child0 = Yoga.Node.create();
|
||||
var root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setWidth(50);
|
||||
root_child0.setHeight(60);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
var root_child1 = Yoga.Node.create();
|
||||
var root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
|
||||
root_child1.setFlexWrap(Yoga.WRAP_WRAP);
|
||||
root_child1.setWidth(50);
|
||||
root_child1.setHeight(25);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
var root_child1_child0 = Yoga.Node.create();
|
||||
var root_child1_child0 = Yoga.Node.create(config);
|
||||
root_child1_child0.setWidth(25);
|
||||
root_child1_child0.setHeight(20);
|
||||
root_child1.insertChild(root_child1_child0, 0);
|
||||
|
||||
var root_child1_child1 = Yoga.Node.create();
|
||||
var root_child1_child1 = Yoga.Node.create(config);
|
||||
root_child1_child1.setAlignSelf(Yoga.ALIGN_BASELINE);
|
||||
root_child1_child1.setWidth(25);
|
||||
root_child1_child1.setHeight(10);
|
||||
root_child1.insertChild(root_child1_child1, 1);
|
||||
|
||||
var root_child1_child2 = Yoga.Node.create();
|
||||
var root_child1_child2 = Yoga.Node.create(config);
|
||||
root_child1_child2.setWidth(25);
|
||||
root_child1_child2.setHeight(20);
|
||||
root_child1.insertChild(root_child1_child2, 2);
|
||||
|
||||
var root_child1_child3 = Yoga.Node.create();
|
||||
var root_child1_child3 = Yoga.Node.create(config);
|
||||
root_child1_child3.setAlignSelf(Yoga.ALIGN_BASELINE);
|
||||
root_child1_child3.setWidth(25);
|
||||
root_child1_child3.setHeight(10);
|
||||
@@ -536,40 +536,40 @@ it("align_baseline_child_multiline_override", function () {
|
||||
});
|
||||
it("align_baseline_child_multiline_no_override_on_secondline", function () {
|
||||
try {
|
||||
var root = Yoga.Node.create();
|
||||
var root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
|
||||
root.setAlignItems(Yoga.ALIGN_BASELINE);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
|
||||
var root_child0 = Yoga.Node.create();
|
||||
var root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setWidth(50);
|
||||
root_child0.setHeight(60);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
var root_child1 = Yoga.Node.create();
|
||||
var root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
|
||||
root_child1.setFlexWrap(Yoga.WRAP_WRAP);
|
||||
root_child1.setWidth(50);
|
||||
root_child1.setHeight(25);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
var root_child1_child0 = Yoga.Node.create();
|
||||
var root_child1_child0 = Yoga.Node.create(config);
|
||||
root_child1_child0.setWidth(25);
|
||||
root_child1_child0.setHeight(20);
|
||||
root_child1.insertChild(root_child1_child0, 0);
|
||||
|
||||
var root_child1_child1 = Yoga.Node.create();
|
||||
var root_child1_child1 = Yoga.Node.create(config);
|
||||
root_child1_child1.setWidth(25);
|
||||
root_child1_child1.setHeight(10);
|
||||
root_child1.insertChild(root_child1_child1, 1);
|
||||
|
||||
var root_child1_child2 = Yoga.Node.create();
|
||||
var root_child1_child2 = Yoga.Node.create(config);
|
||||
root_child1_child2.setWidth(25);
|
||||
root_child1_child2.setHeight(20);
|
||||
root_child1.insertChild(root_child1_child2, 2);
|
||||
|
||||
var root_child1_child3 = Yoga.Node.create();
|
||||
var root_child1_child3 = Yoga.Node.create(config);
|
||||
root_child1_child3.setAlignSelf(Yoga.ALIGN_BASELINE);
|
||||
root_child1_child3.setWidth(25);
|
||||
root_child1_child3.setHeight(10);
|
||||
@@ -655,24 +655,24 @@ it("align_baseline_child_multiline_no_override_on_secondline", function () {
|
||||
});
|
||||
it("align_baseline_child_top", function () {
|
||||
try {
|
||||
var root = Yoga.Node.create();
|
||||
var root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
|
||||
root.setAlignItems(Yoga.ALIGN_BASELINE);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
|
||||
var root_child0 = Yoga.Node.create();
|
||||
var root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setPosition(Yoga.EDGE_TOP, 10);
|
||||
root_child0.setWidth(50);
|
||||
root_child0.setHeight(50);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
var root_child1 = Yoga.Node.create();
|
||||
var root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setWidth(50);
|
||||
root_child1.setHeight(20);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
var root_child1_child0 = Yoga.Node.create();
|
||||
var root_child1_child0 = Yoga.Node.create(config);
|
||||
root_child1_child0.setWidth(50);
|
||||
root_child1_child0.setHeight(10);
|
||||
root_child1.insertChild(root_child1_child0, 0);
|
||||
@@ -727,24 +727,24 @@ it("align_baseline_child_top", function () {
|
||||
});
|
||||
it("align_baseline_child_top2", function () {
|
||||
try {
|
||||
var root = Yoga.Node.create();
|
||||
var root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
|
||||
root.setAlignItems(Yoga.ALIGN_BASELINE);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
|
||||
var root_child0 = Yoga.Node.create();
|
||||
var root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setWidth(50);
|
||||
root_child0.setHeight(50);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
var root_child1 = Yoga.Node.create();
|
||||
var root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPosition(Yoga.EDGE_TOP, 5);
|
||||
root_child1.setWidth(50);
|
||||
root_child1.setHeight(20);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
var root_child1_child0 = Yoga.Node.create();
|
||||
var root_child1_child0 = Yoga.Node.create(config);
|
||||
root_child1_child0.setWidth(50);
|
||||
root_child1_child0.setHeight(10);
|
||||
root_child1.insertChild(root_child1_child0, 0);
|
||||
@@ -799,28 +799,28 @@ it("align_baseline_child_top2", function () {
|
||||
});
|
||||
it("align_baseline_double_nested_child", function () {
|
||||
try {
|
||||
var root = Yoga.Node.create();
|
||||
var root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
|
||||
root.setAlignItems(Yoga.ALIGN_BASELINE);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
|
||||
var root_child0 = Yoga.Node.create();
|
||||
var root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setWidth(50);
|
||||
root_child0.setHeight(50);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
var root_child0_child0 = Yoga.Node.create();
|
||||
var root_child0_child0 = Yoga.Node.create(config);
|
||||
root_child0_child0.setWidth(50);
|
||||
root_child0_child0.setHeight(20);
|
||||
root_child0.insertChild(root_child0_child0, 0);
|
||||
|
||||
var root_child1 = Yoga.Node.create();
|
||||
var root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setWidth(50);
|
||||
root_child1.setHeight(20);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
var root_child1_child0 = Yoga.Node.create();
|
||||
var root_child1_child0 = Yoga.Node.create(config);
|
||||
root_child1_child0.setWidth(50);
|
||||
root_child1_child0.setHeight(15);
|
||||
root_child1.insertChild(root_child1_child0, 0);
|
||||
@@ -885,17 +885,17 @@ it("align_baseline_double_nested_child", function () {
|
||||
});
|
||||
it("align_baseline_column", function () {
|
||||
try {
|
||||
var root = Yoga.Node.create();
|
||||
var root = Yoga.Node.create(config);
|
||||
root.setAlignItems(Yoga.ALIGN_BASELINE);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
|
||||
var root_child0 = Yoga.Node.create();
|
||||
var root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setWidth(50);
|
||||
root_child0.setHeight(50);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
var root_child1 = Yoga.Node.create();
|
||||
var root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setWidth(50);
|
||||
root_child1.setHeight(20);
|
||||
root.insertChild(root_child1, 1);
|
||||
@@ -940,13 +940,13 @@ it("align_baseline_column", function () {
|
||||
});
|
||||
it("align_baseline_child_margin", function () {
|
||||
try {
|
||||
var root = Yoga.Node.create();
|
||||
var root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
|
||||
root.setAlignItems(Yoga.ALIGN_BASELINE);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
|
||||
var root_child0 = Yoga.Node.create();
|
||||
var root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setMargin(Yoga.EDGE_LEFT, 5);
|
||||
root_child0.setMargin(Yoga.EDGE_TOP, 5);
|
||||
root_child0.setMargin(Yoga.EDGE_RIGHT, 5);
|
||||
@@ -955,12 +955,12 @@ it("align_baseline_child_margin", function () {
|
||||
root_child0.setHeight(50);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
var root_child1 = Yoga.Node.create();
|
||||
var root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setWidth(50);
|
||||
root_child1.setHeight(20);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
var root_child1_child0 = Yoga.Node.create();
|
||||
var root_child1_child0 = Yoga.Node.create(config);
|
||||
root_child1_child0.setMargin(Yoga.EDGE_LEFT, 1);
|
||||
root_child1_child0.setMargin(Yoga.EDGE_TOP, 1);
|
||||
root_child1_child0.setMargin(Yoga.EDGE_RIGHT, 1);
|
||||
@@ -1019,7 +1019,7 @@ it("align_baseline_child_margin", function () {
|
||||
});
|
||||
it("align_baseline_child_padding", function () {
|
||||
try {
|
||||
var root = Yoga.Node.create();
|
||||
var root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
|
||||
root.setAlignItems(Yoga.ALIGN_BASELINE);
|
||||
root.setPadding(Yoga.EDGE_LEFT, 5);
|
||||
@@ -1029,12 +1029,12 @@ it("align_baseline_child_padding", function () {
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
|
||||
var root_child0 = Yoga.Node.create();
|
||||
var root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setWidth(50);
|
||||
root_child0.setHeight(50);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
var root_child1 = Yoga.Node.create();
|
||||
var root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setPadding(Yoga.EDGE_LEFT, 5);
|
||||
root_child1.setPadding(Yoga.EDGE_TOP, 5);
|
||||
root_child1.setPadding(Yoga.EDGE_RIGHT, 5);
|
||||
@@ -1043,7 +1043,7 @@ it("align_baseline_child_padding", function () {
|
||||
root_child1.setHeight(20);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
var root_child1_child0 = Yoga.Node.create();
|
||||
var root_child1_child0 = Yoga.Node.create(config);
|
||||
root_child1_child0.setWidth(50);
|
||||
root_child1_child0.setHeight(10);
|
||||
root_child1.insertChild(root_child1_child0, 0);
|
||||
@@ -1098,39 +1098,39 @@ it("align_baseline_child_padding", function () {
|
||||
});
|
||||
it("align_baseline_multiline", function () {
|
||||
try {
|
||||
var root = Yoga.Node.create();
|
||||
var root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
|
||||
root.setAlignItems(Yoga.ALIGN_BASELINE);
|
||||
root.setFlexWrap(Yoga.WRAP_WRAP);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
|
||||
var root_child0 = Yoga.Node.create();
|
||||
var root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setWidth(50);
|
||||
root_child0.setHeight(50);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
var root_child1 = Yoga.Node.create();
|
||||
var root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setWidth(50);
|
||||
root_child1.setHeight(20);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
var root_child1_child0 = Yoga.Node.create();
|
||||
var root_child1_child0 = Yoga.Node.create(config);
|
||||
root_child1_child0.setWidth(50);
|
||||
root_child1_child0.setHeight(10);
|
||||
root_child1.insertChild(root_child1_child0, 0);
|
||||
|
||||
var root_child2 = Yoga.Node.create();
|
||||
var root_child2 = Yoga.Node.create(config);
|
||||
root_child2.setWidth(50);
|
||||
root_child2.setHeight(20);
|
||||
root.insertChild(root_child2, 2);
|
||||
|
||||
var root_child2_child0 = Yoga.Node.create();
|
||||
var root_child2_child0 = Yoga.Node.create(config);
|
||||
root_child2_child0.setWidth(50);
|
||||
root_child2_child0.setHeight(10);
|
||||
root_child2.insertChild(root_child2_child0, 0);
|
||||
|
||||
var root_child3 = Yoga.Node.create();
|
||||
var root_child3 = Yoga.Node.create(config);
|
||||
root_child3.setWidth(50);
|
||||
root_child3.setHeight(50);
|
||||
root.insertChild(root_child3, 3);
|
||||
@@ -1215,38 +1215,38 @@ it("align_baseline_multiline", function () {
|
||||
});
|
||||
it("align_baseline_multiline_column", function () {
|
||||
try {
|
||||
var root = Yoga.Node.create();
|
||||
var root = Yoga.Node.create(config);
|
||||
root.setAlignItems(Yoga.ALIGN_BASELINE);
|
||||
root.setFlexWrap(Yoga.WRAP_WRAP);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
|
||||
var root_child0 = Yoga.Node.create();
|
||||
var root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setWidth(50);
|
||||
root_child0.setHeight(50);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
var root_child1 = Yoga.Node.create();
|
||||
var root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setWidth(30);
|
||||
root_child1.setHeight(50);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
var root_child1_child0 = Yoga.Node.create();
|
||||
var root_child1_child0 = Yoga.Node.create(config);
|
||||
root_child1_child0.setWidth(20);
|
||||
root_child1_child0.setHeight(20);
|
||||
root_child1.insertChild(root_child1_child0, 0);
|
||||
|
||||
var root_child2 = Yoga.Node.create();
|
||||
var root_child2 = Yoga.Node.create(config);
|
||||
root_child2.setWidth(40);
|
||||
root_child2.setHeight(70);
|
||||
root.insertChild(root_child2, 2);
|
||||
|
||||
var root_child2_child0 = Yoga.Node.create();
|
||||
var root_child2_child0 = Yoga.Node.create(config);
|
||||
root_child2_child0.setWidth(10);
|
||||
root_child2_child0.setHeight(10);
|
||||
root_child2.insertChild(root_child2_child0, 0);
|
||||
|
||||
var root_child3 = Yoga.Node.create();
|
||||
var root_child3 = Yoga.Node.create(config);
|
||||
root_child3.setWidth(50);
|
||||
root_child3.setHeight(20);
|
||||
root.insertChild(root_child3, 3);
|
||||
@@ -1331,38 +1331,38 @@ it("align_baseline_multiline_column", function () {
|
||||
});
|
||||
it("align_baseline_multiline_column2", function () {
|
||||
try {
|
||||
var root = Yoga.Node.create();
|
||||
var root = Yoga.Node.create(config);
|
||||
root.setAlignItems(Yoga.ALIGN_BASELINE);
|
||||
root.setFlexWrap(Yoga.WRAP_WRAP);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
|
||||
var root_child0 = Yoga.Node.create();
|
||||
var root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setWidth(50);
|
||||
root_child0.setHeight(50);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
var root_child1 = Yoga.Node.create();
|
||||
var root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setWidth(30);
|
||||
root_child1.setHeight(50);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
var root_child1_child0 = Yoga.Node.create();
|
||||
var root_child1_child0 = Yoga.Node.create(config);
|
||||
root_child1_child0.setWidth(20);
|
||||
root_child1_child0.setHeight(20);
|
||||
root_child1.insertChild(root_child1_child0, 0);
|
||||
|
||||
var root_child2 = Yoga.Node.create();
|
||||
var root_child2 = Yoga.Node.create(config);
|
||||
root_child2.setWidth(40);
|
||||
root_child2.setHeight(70);
|
||||
root.insertChild(root_child2, 2);
|
||||
|
||||
var root_child2_child0 = Yoga.Node.create();
|
||||
var root_child2_child0 = Yoga.Node.create(config);
|
||||
root_child2_child0.setWidth(10);
|
||||
root_child2_child0.setHeight(10);
|
||||
root_child2.insertChild(root_child2_child0, 0);
|
||||
|
||||
var root_child3 = Yoga.Node.create();
|
||||
var root_child3 = Yoga.Node.create(config);
|
||||
root_child3.setWidth(50);
|
||||
root_child3.setHeight(20);
|
||||
root.insertChild(root_child3, 3);
|
||||
@@ -1447,39 +1447,39 @@ it("align_baseline_multiline_column2", function () {
|
||||
});
|
||||
it("align_baseline_multiline_row_and_column", function () {
|
||||
try {
|
||||
var root = Yoga.Node.create();
|
||||
var root = Yoga.Node.create(config);
|
||||
root.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
|
||||
root.setAlignItems(Yoga.ALIGN_BASELINE);
|
||||
root.setFlexWrap(Yoga.WRAP_WRAP);
|
||||
root.setWidth(100);
|
||||
root.setHeight(100);
|
||||
|
||||
var root_child0 = Yoga.Node.create();
|
||||
var root_child0 = Yoga.Node.create(config);
|
||||
root_child0.setWidth(50);
|
||||
root_child0.setHeight(50);
|
||||
root.insertChild(root_child0, 0);
|
||||
|
||||
var root_child1 = Yoga.Node.create();
|
||||
var root_child1 = Yoga.Node.create(config);
|
||||
root_child1.setWidth(50);
|
||||
root_child1.setHeight(50);
|
||||
root.insertChild(root_child1, 1);
|
||||
|
||||
var root_child1_child0 = Yoga.Node.create();
|
||||
var root_child1_child0 = Yoga.Node.create(config);
|
||||
root_child1_child0.setWidth(50);
|
||||
root_child1_child0.setHeight(10);
|
||||
root_child1.insertChild(root_child1_child0, 0);
|
||||
|
||||
var root_child2 = Yoga.Node.create();
|
||||
var root_child2 = Yoga.Node.create(config);
|
||||
root_child2.setWidth(50);
|
||||
root_child2.setHeight(20);
|
||||
root.insertChild(root_child2, 2);
|
||||
|
||||
var root_child2_child0 = Yoga.Node.create();
|
||||
var root_child2_child0 = Yoga.Node.create(config);
|
||||
root_child2_child0.setWidth(50);
|
||||
root_child2_child0.setHeight(10);
|
||||
root_child2.insertChild(root_child2_child0, 0);
|
||||
|
||||
var root_child3 = Yoga.Node.create();
|
||||
var root_child3 = Yoga.Node.create(config);
|
||||
root_child3.setWidth(50);
|
||||
root_child3.setHeight(20);
|
||||
root.insertChild(root_child3, 3);
|
||||
|
Reference in New Issue
Block a user