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

@@ -168,6 +168,23 @@ public class YogaNodeTest {
assertEquals(100, (int) node0.getMaxHeight().value);
}
@Test
public void testLayoutMargin() {
final YogaNode node = new YogaNode();
node.setWidth(100);
node.setHeight(100);
node.setMargin(YogaEdge.START, 1);
node.setMargin(YogaEdge.END, 2);
node.setMargin(YogaEdge.TOP, 3);
node.setMargin(YogaEdge.BOTTOM, 4);
node.calculateLayout();
assertEquals(1, (int) node.getLayoutMargin(YogaEdge.LEFT));
assertEquals(2, (int) node.getLayoutMargin(YogaEdge.RIGHT));
assertEquals(3, (int) node.getLayoutMargin(YogaEdge.TOP));
assertEquals(4, (int) node.getLayoutMargin(YogaEdge.BOTTOM));
}
@Test
public void testLayoutPadding() {
final YogaNode node = new YogaNode();