Add layout margin functions to the csharp interface

This commit is contained in:
Maël Nison
2017-01-12 11:14:07 +01:00
parent f033c835e5
commit 3d82659b46
3 changed files with 57 additions and 0 deletions

View File

@@ -312,6 +312,9 @@ namespace Facebook.Yoga
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] [DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
public static extern float YGNodeLayoutGetHeight(YGNodeHandle node); public static extern float YGNodeLayoutGetHeight(YGNodeHandle node);
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
public static extern float YGNodeLayoutGetMargin(YGNodeHandle node, YogaEdge edge);
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] [DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
public static extern float YGNodeLayoutGetPadding(YGNodeHandle node, YogaEdge edge); public static extern float YGNodeLayoutGetPadding(YGNodeHandle node, YogaEdge edge);

View File

@@ -452,6 +452,54 @@ namespace Facebook.Yoga
} }
} }
public float LayoutMarginLeft
{
get
{
return Native.YGNodeLayoutGetMargin(_ygNode, YogaEdge.Left);
}
}
public float LayoutMarginTop
{
get
{
return Native.YGNodeLayoutGetMargin(_ygNode, YogaEdge.Top);
}
}
public float LayoutMarginRight
{
get
{
return Native.YGNodeLayoutGetMargin(_ygNode, YogaEdge.Right);
}
}
public float LayoutMarginBottom
{
get
{
return Native.YGNodeLayoutGetMargin(_ygNode, YogaEdge.Bottom);
}
}
public float LayoutMarginStart
{
get
{
return Native.YGNodeLayoutGetMargin(_ygNode, YogaEdge.Start);
}
}
public float LayoutMarginEnd
{
get
{
return Native.YGNodeLayoutGetMargin(_ygNode, YogaEdge.End);
}
}
public float LayoutPaddingLeft public float LayoutPaddingLeft
{ {
get get

View File

@@ -333,6 +333,12 @@ 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)
{ {