Cleaning
This commit is contained in:
@@ -333,12 +333,6 @@ namespace Facebook.Yoga
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[Obsolete("use LayoutMargin properties")]
|
|
||||||
public float GetLayoutMargin(YogaEdge edge)
|
|
||||||
{
|
|
||||||
return Native.YGNodeLayoutGetMargin(_ygNode, edge);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Obsolete("use LayoutPadding properties")]
|
[Obsolete("use LayoutPadding properties")]
|
||||||
public float GetLayoutPadding(YogaEdge edge)
|
public float GetLayoutPadding(YogaEdge edge)
|
||||||
{
|
{
|
||||||
|
@@ -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]
|
[Test]
|
||||||
public void TestLayoutPadding() {
|
public void TestLayoutPadding() {
|
||||||
YogaNode node = new YogaNode();
|
YogaNode node = new YogaNode();
|
||||||
|
@@ -168,6 +168,23 @@ public class YogaNodeTest {
|
|||||||
assertEquals(100, (int) node0.getMaxHeight().value);
|
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
|
@Test
|
||||||
public void testLayoutPadding() {
|
public void testLayoutPadding() {
|
||||||
final YogaNode node = new YogaNode();
|
final YogaNode node = new YogaNode();
|
||||||
|
Reference in New Issue
Block a user