Expose layout border to java

Summary: Expose layout border to java

Reviewed By: astreet

Differential Revision: D4543284

fbshipit-source-id: 6030915fc6f758e785a688f94c8ffbec7fbac8b8
This commit is contained in:
Emil Sjolander
2017-02-11 06:19:52 -08:00
committed by Facebook Github Bot
parent 240c2dd657
commit 6ceb4af2d4
4 changed files with 56 additions and 0 deletions

View File

@@ -202,6 +202,23 @@ public class YogaNodeTest {
assertEquals(4, (int) node.getLayoutPadding(YogaEdge.BOTTOM));
}
@Test
public void testLayoutBorder() {
final YogaNode node = new YogaNode();
node.setWidth(100);
node.setHeight(100);
node.setBorder(YogaEdge.START, 1);
node.setBorder(YogaEdge.END, 2);
node.setBorder(YogaEdge.TOP, 3);
node.setBorder(YogaEdge.BOTTOM, 4);
node.calculateLayout(YogaConstants.UNDEFINED, YogaConstants.UNDEFINED);
assertEquals(1, (int) node.getLayoutBorder(YogaEdge.LEFT));
assertEquals(2, (int) node.getLayoutBorder(YogaEdge.RIGHT));
assertEquals(3, (int) node.getLayoutBorder(YogaEdge.TOP));
assertEquals(4, (int) node.getLayoutBorder(YogaEdge.BOTTOM));
}
@Test
public void testPercentPaddingOnRoot() {
final YogaNode node = new YogaNode();