Add spacing properties

Summary:
Align C# implementation with YogaKit #322
Closes https://github.com/facebook/yoga/pull/327

Reviewed By: emilsjolander

Differential Revision: D4390687

Pulled By: splhack

fbshipit-source-id: 28c87a45898fcd958a422d5e254ead0ec00d3562
This commit is contained in:
Kazuki Sakamoto
2017-01-08 07:58:31 -08:00
committed by Facebook Github Bot
parent 969b3709db
commit 8ed71b2777
17 changed files with 805 additions and 318 deletions

View File

@@ -409,16 +409,16 @@ namespace Facebook.Yoga
YogaNode node = new YogaNode();
node.Width = 100;
node.Height = 100;
node.SetPadding(YogaEdge.Start, 1);
node.SetPadding(YogaEdge.End, 2);
node.SetPadding(YogaEdge.Top, 3);
node.SetPadding(YogaEdge.Bottom, 4);
node.PaddingStart = 1;
node.PaddingEnd = 2;
node.PaddingTop = 3;
node.PaddingBottom = 4;
node.CalculateLayout();
Assert.AreEqual(1, node.GetLayoutPadding(YogaEdge.Left));
Assert.AreEqual(2, node.GetLayoutPadding(YogaEdge.Right));
Assert.AreEqual(3, node.GetLayoutPadding(YogaEdge.Top));
Assert.AreEqual(4, node.GetLayoutPadding(YogaEdge.Bottom));
Assert.AreEqual(1, node.LayoutPaddingLeft);
Assert.AreEqual(2, node.LayoutPaddingRight);
Assert.AreEqual(3, node.LayoutPaddingTop);
Assert.AreEqual(4, node.LayoutPaddingBottom);
}
}
}