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:
committed by
Facebook Github Bot
parent
969b3709db
commit
8ed71b2777
@@ -13,6 +13,7 @@ namespace Facebook.Yoga
|
||||
{
|
||||
public partial class YogaNode
|
||||
{
|
||||
[Obsolete("use Object Initializer")]
|
||||
public static YogaNode Create(
|
||||
YogaDirection? styleDirection = null,
|
||||
YogaFlexDirection? flexDirection = null,
|
||||
@@ -109,22 +110,22 @@ namespace Facebook.Yoga
|
||||
{
|
||||
if (position.Top.HasValue)
|
||||
{
|
||||
node.SetPosition(YogaEdge.Top, position.Top.Value);
|
||||
node.Top = position.Top.Value;
|
||||
}
|
||||
|
||||
if (position.Bottom.HasValue)
|
||||
{
|
||||
node.SetPosition(YogaEdge.Bottom, position.Bottom.Value);
|
||||
node.Bottom = position.Bottom.Value;
|
||||
}
|
||||
|
||||
if (position.Left.HasValue)
|
||||
{
|
||||
node.SetPosition(YogaEdge.Left, position.Left.Value);
|
||||
node.Left = position.Left.Value;
|
||||
}
|
||||
|
||||
if (position.Right.HasValue)
|
||||
{
|
||||
node.SetPosition(YogaEdge.Right, position.Right.Value);
|
||||
node.Right = position.Right.Value;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -132,22 +133,22 @@ namespace Facebook.Yoga
|
||||
{
|
||||
if (margin.Top.HasValue)
|
||||
{
|
||||
node.SetMargin(YogaEdge.Top, margin.Top.Value);
|
||||
node.MarginTop = margin.Top.Value;
|
||||
}
|
||||
|
||||
if (margin.Bottom.HasValue)
|
||||
{
|
||||
node.SetMargin(YogaEdge.Bottom, margin.Bottom.Value);
|
||||
node.MarginBottom = margin.Bottom.Value;
|
||||
}
|
||||
|
||||
if (margin.Left.HasValue)
|
||||
{
|
||||
node.SetMargin(YogaEdge.Left, margin.Left.Value);
|
||||
node.MarginLeft = margin.Left.Value;
|
||||
}
|
||||
|
||||
if (margin.Right.HasValue)
|
||||
{
|
||||
node.SetMargin(YogaEdge.Right, margin.Right.Value);
|
||||
node.MarginRight = margin.Right.Value;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -155,22 +156,22 @@ namespace Facebook.Yoga
|
||||
{
|
||||
if (padding.Top.HasValue)
|
||||
{
|
||||
node.SetPadding(YogaEdge.Top, padding.Top.Value);
|
||||
node.PaddingTop = padding.Top.Value;
|
||||
}
|
||||
|
||||
if (padding.Bottom.HasValue)
|
||||
{
|
||||
node.SetPadding(YogaEdge.Bottom, padding.Bottom.Value);
|
||||
node.PaddingBottom = padding.Bottom.Value;
|
||||
}
|
||||
|
||||
if (padding.Left.HasValue)
|
||||
{
|
||||
node.SetPadding(YogaEdge.Left, padding.Left.Value);
|
||||
node.PaddingLeft = padding.Left.Value;
|
||||
}
|
||||
|
||||
if (padding.Right.HasValue)
|
||||
{
|
||||
node.SetPadding(YogaEdge.Right, padding.Right.Value);
|
||||
node.PaddingRight = padding.Right.Value;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -178,22 +179,22 @@ namespace Facebook.Yoga
|
||||
{
|
||||
if (border.Top.HasValue)
|
||||
{
|
||||
node.SetBorder(YogaEdge.Top, border.Top.Value);
|
||||
node.BorderTopWidth = border.Top.Value;
|
||||
}
|
||||
|
||||
if (border.Bottom.HasValue)
|
||||
{
|
||||
node.SetBorder(YogaEdge.Bottom, border.Bottom.Value);
|
||||
node.BorderBottomWidth = border.Bottom.Value;
|
||||
}
|
||||
|
||||
if (border.Left.HasValue)
|
||||
{
|
||||
node.SetBorder(YogaEdge.Left, border.Left.Value);
|
||||
node.BorderLeftWidth = border.Left.Value;
|
||||
}
|
||||
|
||||
if (border.Right.HasValue)
|
||||
{
|
||||
node.SetBorder(YogaEdge.Right, border.Right.Value);
|
||||
node.BorderRightWidth = border.Right.Value;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user