Add YGLayoutGetMargin

Summary:
Fix #326. I'll open another PR once this one gets accepted to add support for `YGLayoutGetBorder` 👌
Closes https://github.com/facebook/yoga/pull/335

Reviewed By: gkassabli

Differential Revision: D4409399

Pulled By: emilsjolander

fbshipit-source-id: 8153f6701cab60b55a485f6d2e0b9f7767481090
This commit is contained in:
Maël Nison
2017-01-15 15:16:10 -08:00
committed by Facebook Github Bot
parent 498a5980e8
commit d70f289e73
16 changed files with 288 additions and 29 deletions

View File

@@ -434,6 +434,23 @@ namespace Facebook.Yoga
});
}
[Test]
public void TestLayoutMargin() {
YogaNode node = new YogaNode();
node.Width = 100;
node.Height = 100;
node.MarginStart = 1;
node.MarginEnd = 2;
node.MarginTop = 3;
node.MarginBottom = 4;
node.CalculateLayout();
Assert.AreEqual(1, node.LayoutMarginLeft);
Assert.AreEqual(2, node.LayoutMarginRight);
Assert.AreEqual(3, node.LayoutMarginTop);
Assert.AreEqual(4, node.LayoutMarginBottom);
}
[Test]
public void TestLayoutPadding() {
YogaNode node = new YogaNode();